Search in sources :

Example 1 with RemoveAutomaticRoleTaskExecutor

use of eu.bcvsolutions.idm.core.scheduler.task.impl.RemoveAutomaticRoleTaskExecutor in project CzechIdMng by bcvsolutions.

the class DefaultIdmIdentityContractServiceIntegrationTest method deleteAutomaticRole.

private void deleteAutomaticRole(IdmRoleTreeNodeDto automaticRole) {
    RemoveAutomaticRoleTaskExecutor task = new RemoveAutomaticRoleTaskExecutor();
    task.setAutomaticRoleId(automaticRole.getId());
    taskManager.executeSync(task);
}
Also used : RemoveAutomaticRoleTaskExecutor(eu.bcvsolutions.idm.core.scheduler.task.impl.RemoveAutomaticRoleTaskExecutor)

Example 2 with RemoveAutomaticRoleTaskExecutor

use of eu.bcvsolutions.idm.core.scheduler.task.impl.RemoveAutomaticRoleTaskExecutor in project CzechIdMng by bcvsolutions.

the class AutomaticRoleAttributeDeleteProcessor method process.

@Override
public EventResult<IdmAutomaticRoleAttributeDto> process(EntityEvent<IdmAutomaticRoleAttributeDto> event) {
    IdmAutomaticRoleAttributeDto content = event.getContent();
    // 
    // delete all assigned roles gained by this automatic role by long running task
    RemoveAutomaticRoleTaskExecutor automaticRoleTask = AutowireHelper.createBean(RemoveAutomaticRoleTaskExecutor.class);
    automaticRoleTask.setAutomaticRoleId(content.getId());
    longRunningTaskManager.executeSync(automaticRoleTask);
    // 
    return new DefaultEventResult<>(event, this);
}
Also used : DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) RemoveAutomaticRoleTaskExecutor(eu.bcvsolutions.idm.core.scheduler.task.impl.RemoveAutomaticRoleTaskExecutor) IdmAutomaticRoleAttributeDto(eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleAttributeDto)

Example 3 with RemoveAutomaticRoleTaskExecutor

use of eu.bcvsolutions.idm.core.scheduler.task.impl.RemoveAutomaticRoleTaskExecutor in project CzechIdMng by bcvsolutions.

the class AutomaticRoleAttributeRuleDeleteProcessor method removeAllRoles.

/**
 * Remove all identity role via request, but automatic role iselft will not be deleted.
 *
 * @param automaticRoleId
 */
private void removeAllRoles(UUID automaticRoleId) {
    RemoveAutomaticRoleTaskExecutor automaticRoleTask = AutowireHelper.createBean(RemoveAutomaticRoleTaskExecutor.class);
    automaticRoleTask.setAutomaticRoleId(automaticRoleId);
    // we dont want delete entity
    automaticRoleTask.setDeleteEntity(false);
    longRunningTaskManager.executeSync(automaticRoleTask);
}
Also used : RemoveAutomaticRoleTaskExecutor(eu.bcvsolutions.idm.core.scheduler.task.impl.RemoveAutomaticRoleTaskExecutor)

Example 4 with RemoveAutomaticRoleTaskExecutor

use of eu.bcvsolutions.idm.core.scheduler.task.impl.RemoveAutomaticRoleTaskExecutor 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)

Aggregations

RemoveAutomaticRoleTaskExecutor (eu.bcvsolutions.idm.core.scheduler.task.impl.RemoveAutomaticRoleTaskExecutor)4 DefaultEventResult (eu.bcvsolutions.idm.core.api.event.DefaultEventResult)2 IdmAutomaticRoleAttributeDto (eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleAttributeDto)1 IdmRoleTreeNodeDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto)1