use of eu.bcvsolutions.idm.core.exception.ModuleNotDisableableException in project CzechIdMng by bcvsolutions.
the class ModuleDisableProcessor method process.
@Override
public EventResult<ModuleDescriptorDto> process(EntityEvent<ModuleDescriptorDto> event) {
ModuleDescriptorDto moduleDescriptor = event.getContent();
String moduleId = moduleDescriptor.getId();
// validation
if (!moduleDescriptor.isDisableable()) {
throw new ModuleNotDisableableException(moduleId);
}
// disable module
String propertyName = moduleService.getModuleConfigurationProperty(moduleId, ConfigurationService.PROPERTY_ENABLED);
configurationService.setBooleanValue(propertyName, false);
//
return new DefaultEventResult<>(event, this);
}
Aggregations