use of eu.bcvsolutions.idm.core.api.event.DefaultEventResult in project CzechIdMng by bcvsolutions.
the class RoleRequestRealizationProcessor method process.
@Override
public EventResult<IdmRoleRequestDto> process(EntityEvent<IdmRoleRequestDto> event) {
IdmRoleRequestDto dto = event.getContent();
event.setContent(service.executeRequest(dto.getId()));
return new DefaultEventResult<>(event, this);
}
use of eu.bcvsolutions.idm.core.api.event.DefaultEventResult in project CzechIdMng by bcvsolutions.
the class RoleSaveProcessor method process.
@Override
public EventResult<IdmRoleDto> process(EntityEvent<IdmRoleDto> event) {
IdmRoleDto entity = event.getContent();
entity = service.saveInternal(entity);
event.setContent(entity);
// TODO: clone content - mutable previous event content :/
return new DefaultEventResult<>(event, this);
}
use of eu.bcvsolutions.idm.core.api.event.DefaultEventResult in project CzechIdMng by bcvsolutions.
the class RoleTreeNodeDeleteProcessor method process.
@Override
public EventResult<IdmRoleTreeNodeDto> process(EntityEvent<IdmRoleTreeNodeDto> event) {
IdmRoleTreeNodeDto roleTreeNode = event.getContent();
// Find all automatic role requests and remove relation on automatic role
if (roleTreeNode.getId() != null) {
//
// delete all assigned roles gained by this automatic role by long running task
RemoveAutomaticRoleTaskExecutor automaticRoleTask = AutowireHelper.createBean(RemoveAutomaticRoleTaskExecutor.class);
automaticRoleTask.setAutomaticRoleId(roleTreeNode.getId());
longRunningTaskManager.executeSync(automaticRoleTask);
}
//
return new DefaultEventResult<>(event, this);
}
use of eu.bcvsolutions.idm.core.api.event.DefaultEventResult in project CzechIdMng by bcvsolutions.
the class RoleTreeNodeSaveProcessor method process.
@Override
public EventResult<IdmRoleTreeNodeDto> process(EntityEvent<IdmRoleTreeNodeDto> event) {
IdmRoleTreeNodeDto dto = event.getContent();
//
dto = service.saveInternal(dto);
event.setContent(dto);
//
// assign role by this added automatic role to all existing identity contracts with long running task
AddNewAutomaticRoleTaskExecutor automaticRoleTask = AutowireHelper.createBean(AddNewAutomaticRoleTaskExecutor.class);
automaticRoleTask.setAutomaticRoleId(dto.getId());
longRunningTaskManager.execute(automaticRoleTask);
return new DefaultEventResult<>(event, this);
}
use of eu.bcvsolutions.idm.core.api.event.DefaultEventResult in project CzechIdMng by bcvsolutions.
the class TreeTypeSaveProcessor method process.
@Override
public EventResult<IdmTreeTypeDto> process(EntityEvent<IdmTreeTypeDto> event) {
IdmTreeTypeDto dto = event.getContent();
dto = service.saveInternal(dto);
event.setContent(dto);
//
return new DefaultEventResult<>(event, this);
}
Aggregations