use of eu.bcvsolutions.idm.core.monitoring.api.dto.IdmMonitoringDto in project CzechIdMng by bcvsolutions.
the class IdentityDemoChangeProcessor method process.
@Override
public EventResult<IdmIdentityDto> process(EntityEvent<IdmIdentityDto> event) {
String evaluatorType = AutowireHelper.getTargetType(demoAdminMonitoringEvaluator);
IdmMonitoringDto monitoring = initMonitoringProcessor.findMonitoring(evaluatorType, null, null);
// evaluate monitoring, if registered and enabled
if (monitoring != null && !monitoring.isDisabled()) {
manager.execute(monitoring);
}
//
return new DefaultEventResult<>(event, this);
}
use of eu.bcvsolutions.idm.core.monitoring.api.dto.IdmMonitoringDto in project CzechIdMng by bcvsolutions.
the class InitMonitoringProcessor method initLoggingEventMonitoring.
protected IdmMonitoringDto initLoggingEventMonitoring() {
String evaluatorType = AutowireHelper.getTargetType(loggingEventMonitoringEvaluator);
IdmMonitoringDto monitoring = findMonitoring(evaluatorType, null, null);
if (monitoring == null) {
monitoring = new IdmMonitoringDto();
monitoring.setEvaluatorType(evaluatorType);
monitoring.setInstanceId(configurationService.getInstanceId());
// ~ per hour
monitoring.setCheckPeriod(3600L);
// ~ quick
monitoring.setSeq((short) 0);
monitoring.setDescription(PRODUCT_PROVIDED_MONITORING_DESCRIPTION);
ConfigurationMap evaluatorProperties = new ConfigurationMap();
evaluatorProperties.put(LongRunningTaskMonitoringEvaluator.PARAMETER_NUMBER_OF_DAYS, LongRunningTaskMonitoringEvaluator.DEFAULT_NUMBER_OF_DAYS);
monitoring.setEvaluatorProperties(evaluatorProperties);
//
monitoring = monitoringService.save(monitoring);
LOG.info("Logging events monitoring configured automatically.");
}
//
return monitoring;
}
use of eu.bcvsolutions.idm.core.monitoring.api.dto.IdmMonitoringDto in project CzechIdMng by bcvsolutions.
the class InitMonitoringProcessor method initDatabaseTableMonitoring.
protected IdmMonitoringDto initDatabaseTableMonitoring(Class<? extends ReadDtoService<?, ?>> readDtoService) {
String evaluatorType = AutowireHelper.getTargetType(databaseTableMonitoringEvaluator);
String serviceBeanName = applicationContext.getBeanNamesForType(readDtoService)[0];
ConfigurationMap properties = new ConfigurationMap();
properties.put(DatabaseTableMonitoringEvaluator.PARAMETER_READ_SERVICE_BEAN_NAME, serviceBeanName);
IdmMonitoringDto monitoring = findMonitoring(evaluatorType, null, properties);
if (monitoring == null) {
monitoring = new IdmMonitoringDto();
monitoring.setEvaluatorType(evaluatorType);
monitoring.setInstanceId(configurationService.getInstanceId());
// ~ per hour
monitoring.setCheckPeriod(3600L);
// FIXME: dto mapper to get AvailableServiceDto with table => #978
monitoring.setDescription(String.format("%s for service [%s].", StringUtils.substring(PRODUCT_PROVIDED_MONITORING_DESCRIPTION, 0, -1), serviceBeanName));
ConfigurationMap evaluatorProperties = new ConfigurationMap();
evaluatorProperties.put(DatabaseTableMonitoringEvaluator.PARAMETER_READ_SERVICE_BEAN_NAME, serviceBeanName);
evaluatorProperties.put(DatabaseTableMonitoringEvaluator.PARAMETER_THRESHOLD, DatabaseTableMonitoringEvaluator.DEFAULT_THRESHOLD);
monitoring.setEvaluatorProperties(evaluatorProperties);
// ~ quick
monitoring.setSeq((short) 0);
//
monitoring = monitoringService.save(monitoring);
LOG.info("Databate table monitoring for service bean name [{}] configured automatically.", serviceBeanName);
}
//
return monitoring;
}
use of eu.bcvsolutions.idm.core.monitoring.api.dto.IdmMonitoringDto in project CzechIdMng by bcvsolutions.
the class InitMonitoringProcessor method initDemoAdminMonitoring.
protected IdmMonitoringDto initDemoAdminMonitoring() {
String evaluatorType = AutowireHelper.getTargetType(demoAdminMonitoringEvaluator);
IdmMonitoringDto monitoring = findMonitoring(evaluatorType, null, null);
if (monitoring == null) {
monitoring = new IdmMonitoringDto();
monitoring.setEvaluatorType(evaluatorType);
monitoring.setInstanceId(configurationService.getInstanceId());
// ~ application start only
monitoring.setCheckPeriod(0L);
// ~ quick
monitoring.setSeq((short) 0);
monitoring.setDescription(PRODUCT_PROVIDED_MONITORING_DESCRIPTION);
//
monitoring = monitoringService.save(monitoring);
LOG.info("Demo admin monitoring configured automatically.");
}
//
return monitoring;
}
use of eu.bcvsolutions.idm.core.monitoring.api.dto.IdmMonitoringDto in project CzechIdMng by bcvsolutions.
the class SyncConfigMonitoringAutoConfigurationProcessor method configureMonitoring.
/**
* Configure monitoring evaluator for given synchronization configuration, if monitoring evaluator is not already configured.
*
* @param synchronizationId synchronization configuration identifier
* @return configured monitoring evaluator
*/
public IdmMonitoringDto configureMonitoring(UUID synchronizationId) {
IdmMonitoringDto monitoring = findMonitoring(synchronizationId);
if (monitoring != null) {
return monitoring;
}
//
monitoring = new IdmMonitoringDto();
// once per hour
monitoring.setCheckPeriod(3600L);
monitoring.setEvaluatorType(AutowireHelper.getTargetType(synchronizationMonitoringEvaluator));
monitoring.getEvaluatorProperties().put(SynchronizationMonitoringEvaluator.PARAMETER_SYNCHRONIZATION, synchronizationId);
monitoring.setInstanceId(configurationService.getInstanceId());
monitoring.setDescription(InitMonitoringProcessor.PRODUCT_PROVIDED_MONITORING_DESCRIPTION);
//
monitoring = monitoringService.save(monitoring);
LOG.info("Monitoring [{}] configured automatically for synchronization configuration [{}]", monitoring.getId(), synchronizationId);
//
return monitoring;
}
Aggregations