Search in sources :

Example 86 with DefaultEventResult

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);
}
Also used : DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto)

Example 87 with DefaultEventResult

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);
}
Also used : IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult)

Example 88 with DefaultEventResult

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);
}
Also used : IdmRoleTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) RemoveAutomaticRoleTaskExecutor(eu.bcvsolutions.idm.core.scheduler.task.impl.RemoveAutomaticRoleTaskExecutor)

Example 89 with DefaultEventResult

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);
}
Also used : AddNewAutomaticRoleTaskExecutor(eu.bcvsolutions.idm.core.scheduler.task.impl.AddNewAutomaticRoleTaskExecutor) IdmRoleTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult)

Example 90 with DefaultEventResult

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);
}
Also used : IdmTreeTypeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeTypeDto) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult)

Aggregations

DefaultEventResult (eu.bcvsolutions.idm.core.api.event.DefaultEventResult)91 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)20 ResultCodeException (eu.bcvsolutions.idm.core.api.exception.ResultCodeException)12 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)11 UUID (java.util.UUID)11 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)10 SysProvisioningOperationDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto)7 IdmIdentityRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto)7 PasswordChangeDto (eu.bcvsolutions.idm.core.api.dto.PasswordChangeDto)6 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)5 IdmEntityEventDto (eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto)5 IdmPasswordPolicyDto (eu.bcvsolutions.idm.core.api.dto.IdmPasswordPolicyDto)5 IdmRoleRequestDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto)5 OperationResult (eu.bcvsolutions.idm.core.api.entity.OperationResult)5 AccIdentityAccountDto (eu.bcvsolutions.idm.acc.dto.AccIdentityAccountDto)4 AccIdentityAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccIdentityAccountFilter)4 DefaultResultModel (eu.bcvsolutions.idm.core.api.dto.DefaultResultModel)4 IdmMessageDto (eu.bcvsolutions.idm.core.notification.api.dto.IdmMessageDto)4 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)4 ArrayList (java.util.ArrayList)4