Search in sources :

Example 76 with DefaultResultModel

use of eu.bcvsolutions.idm.core.api.dto.DefaultResultModel in project CzechIdMng by bcvsolutions.

the class DefaultEntityEventManager method putToQueue.

/**
 * Try put event to queue - event is put into queue, only if it's not executed synchronously.
 * If event is executed synchronously, then {@link EventContext} is returned, {@code null} is returned otherwise.
 *
 * @param entityEvent
 * @return
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
private EventContext<?> putToQueue(IdmEntityEventDto entityEvent) {
    if (entityEvent.getPriority() == PriorityType.IMMEDIATE) {
        LOG.trace("Event type [{}] for owner with id [{}] will be executed synchronously.", entityEvent.getEventType(), entityEvent.getOwnerId());
        // we don't persist events and their states
        return process(new CoreEvent<>(EntityEventType.EXECUTE, entityEvent));
    }
    if (!eventConfiguration.isAsynchronous()) {
        LOG.trace("Event type [{}] for owner with id [{}] will be executed synchronously, asynchronous event processing [{}] is disabled.", entityEvent.getEventType(), entityEvent.getOwnerId(), EventConfiguration.PROPERTY_EVENT_ASYNCHRONOUS_ENABLED);
        // synchronous processing
        return process(new CoreEvent<>(EntityEventType.EXECUTE, entityEvent));
    }
    // 
    // get enabled processors, which listen given event (conditional is evaluated)
    final EntityEvent<?> event = toEvent(entityEvent);
    List<EntityEventProcessor> listenProcessors = getEnabledProcessors(event).stream().filter(processor -> processor.conditional(event)).collect(Collectors.toList());
    if (listenProcessors.isEmpty()) {
        LOG.debug("Event type [{}] for owner with id [{}] will not be executed, no enabled processor is registered.", entityEvent.getEventType(), entityEvent.getOwnerId());
        // return empty context - nothing is processed
        return new DefaultEventContext<>();
    }
    // 
    // evaluate event priority by registered processors
    PriorityType priority = evaluatePriority(event, listenProcessors);
    if (priority != null && priority.getPriority() < entityEvent.getPriority().getPriority()) {
        entityEvent.setPriority(priority);
    }
    // registered processors voted about event will be processed synchronously
    if (entityEvent.getPriority() == PriorityType.IMMEDIATE) {
        LOG.trace("Event type [{}] for owner with id [{}] will be executed synchronously.", entityEvent.getEventType(), entityEvent.getOwnerId());
        // synchronous processing
        // we don't persist events and their states
        process(new CoreEvent<>(EntityEventType.EXECUTE, entityEvent));
    }
    // 
    // TODO: send notification only when event fails
    // notification - info about registered (asynchronous) processors
    // Map<String, Object> parameters = new LinkedHashMap<>();
    // parameters.put("eventType", entityEvent.getEventType());
    // parameters.put("ownerId", entityEvent.getOwnerId());
    // parameters.put("instanceId", entityEvent.getInstanceId());
    // parameters.put("processors", registeredProcessors
    // .stream()
    // .map(DefaultEntityEventManager.this::toDto)
    // .collect(Collectors.toList()));
    // notificationManager.send(
    // CoreModuleDescriptor.TOPIC_EVENT,
    // new IdmMessageDto
    // .Builder()
    // .setLevel(NotificationLevel.INFO)
    // .setModel(new DefaultResultModel(CoreResultCode.EVENT_ACCEPTED, parameters))
    // .build());
    // 
    // persist event - asynchronous processing
    entityEvent = entityEventService.save(entityEvent);
    addEventCache(entityEvent.getId(), entityEvent.getTransactionId());
    // not processed - persisted into queue
    return null;
}
Also used : Auditable(eu.bcvsolutions.idm.core.api.domain.Auditable) DefaultEventContext(eu.bcvsolutions.idm.core.api.event.DefaultEventContext) DtoUtils(eu.bcvsolutions.idm.core.api.utils.DtoUtils) IdmEntityEventDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto) ZonedDateTime(java.time.ZonedDateTime) Autowired(org.springframework.beans.factory.annotation.Autowired) ConfigurationService(eu.bcvsolutions.idm.core.api.service.ConfigurationService) StringUtils(org.apache.commons.lang3.StringUtils) SecurityService(eu.bcvsolutions.idm.core.security.api.service.SecurityService) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) Map(java.util.Map) ApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) LongRunningTaskEventType(eu.bcvsolutions.idm.core.scheduler.api.event.LongRunningTaskEvent.LongRunningTaskEventType) Sort(org.springframework.data.domain.Sort) EntityEventProcessorFilter(eu.bcvsolutions.idm.core.api.dto.filter.EntityEventProcessorFilter) Set(java.util.Set) PageRequest(org.springframework.data.domain.PageRequest) Page(org.springframework.data.domain.Page) Serializable(java.io.Serializable) CreatedComparator(eu.bcvsolutions.idm.core.api.domain.comparator.CreatedComparator) EventType(eu.bcvsolutions.idm.core.api.event.EventType) Lazy(org.springframework.context.annotation.Lazy) AnnotationAwareOrderComparator(org.springframework.core.annotation.AnnotationAwareOrderComparator) Callable(java.util.concurrent.Callable) ValueWrapper(eu.bcvsolutions.idm.core.api.config.cache.domain.ValueWrapper) EntityEventProcessor(eu.bcvsolutions.idm.core.api.event.EntityEventProcessor) Scheduled(org.springframework.scheduling.annotation.Scheduled) TransactionContext(eu.bcvsolutions.idm.core.api.domain.TransactionContext) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) Lists(com.google.common.collect.Lists) LookupService(eu.bcvsolutions.idm.core.api.service.LookupService) IdmAuthorityUtils(eu.bcvsolutions.idm.core.security.api.utils.IdmAuthorityUtils) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) EventResult(eu.bcvsolutions.idm.core.api.event.EventResult) SchedulerConfiguration(eu.bcvsolutions.idm.core.scheduler.api.config.SchedulerConfiguration) IdmCacheManager(eu.bcvsolutions.idm.core.api.service.IdmCacheManager) OperationState(eu.bcvsolutions.idm.core.api.domain.OperationState) LongRunningTaskExecutor(eu.bcvsolutions.idm.core.scheduler.api.service.LongRunningTaskExecutor) EventContext(eu.bcvsolutions.idm.core.api.event.EventContext) HttpStatus(org.springframework.http.HttpStatus) EmptyEntityEventProcessor(eu.bcvsolutions.idm.core.api.event.EmptyEntityEventProcessor) IdmEntityEventService(eu.bcvsolutions.idm.core.api.service.IdmEntityEventService) IdmLongRunningTaskDto(eu.bcvsolutions.idm.core.scheduler.api.dto.IdmLongRunningTaskDto) CoreResultCode(eu.bcvsolutions.idm.core.api.domain.CoreResultCode) CoreEventType(eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType) BaseDto(eu.bcvsolutions.idm.core.api.dto.BaseDto) EventContentDeletedException(eu.bcvsolutions.idm.core.api.exception.EventContentDeletedException) LongRunningTaskEvent(eu.bcvsolutions.idm.core.scheduler.api.event.LongRunningTaskEvent) EntityEventManager(eu.bcvsolutions.idm.core.api.service.EntityEventManager) AutowireHelper(eu.bcvsolutions.idm.core.api.utils.AutowireHelper) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) BasePermission(eu.bcvsolutions.idm.core.security.api.domain.BasePermission) TransactionContextHolder(eu.bcvsolutions.idm.core.api.domain.TransactionContextHolder) Pageable(org.springframework.data.domain.Pageable) Objects(com.google.common.base.Objects) ImmutableMap(com.google.common.collect.ImmutableMap) AbstractEntity(eu.bcvsolutions.idm.core.api.entity.AbstractEntity) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) IdmEntityStateFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityStateFilter) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) PriorityType(eu.bcvsolutions.idm.core.api.domain.PriorityType) IdmEntityStateDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto) List(java.util.List) EventConfiguration(eu.bcvsolutions.idm.core.api.config.domain.EventConfiguration) ExceptionProcessable(eu.bcvsolutions.idm.core.security.api.service.ExceptionProcessable) ExceptionUtils(eu.bcvsolutions.idm.core.api.utils.ExceptionUtils) Entry(java.util.Map.Entry) Identifiable(eu.bcvsolutions.idm.core.api.domain.Identifiable) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) EntityEventProcessorDto(eu.bcvsolutions.idm.core.api.dto.EntityEventProcessorDto) IdmJwtAuthentication(eu.bcvsolutions.idm.core.security.api.domain.IdmJwtAuthentication) HashSet(java.util.HashSet) ModelMapper(org.modelmapper.ModelMapper) RejectedExecutionException(java.util.concurrent.RejectedExecutionException) EntityStateManager(eu.bcvsolutions.idm.core.api.service.EntityStateManager) ReadDtoService(eu.bcvsolutions.idm.core.api.service.ReadDtoService) Propagation(org.springframework.transaction.annotation.Propagation) OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto) Direction(org.springframework.data.domain.Sort.Direction) EntityEvent(eu.bcvsolutions.idm.core.api.event.EntityEvent) EntityEventLock(eu.bcvsolutions.idm.core.api.event.EntityEventLock) EntityEventType(eu.bcvsolutions.idm.core.api.event.EntityEventEvent.EntityEventType) TransactionalEventListener(org.springframework.transaction.event.TransactionalEventListener) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmEntityEventFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityEventFilter) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) EnabledEvaluator(eu.bcvsolutions.idm.core.security.api.service.EnabledEvaluator) ApplicationContext(org.springframework.context.ApplicationContext) AsyncEntityEventProcessor(eu.bcvsolutions.idm.core.api.event.AsyncEntityEventProcessor) ConfigurationMap(eu.bcvsolutions.idm.core.api.domain.ConfigurationMap) Comparator(java.util.Comparator) Collections(java.util.Collections) ResultModel(eu.bcvsolutions.idm.core.api.dto.ResultModel) Transactional(org.springframework.transaction.annotation.Transactional) Assert(org.springframework.util.Assert) PriorityType(eu.bcvsolutions.idm.core.api.domain.PriorityType) EntityEventProcessor(eu.bcvsolutions.idm.core.api.event.EntityEventProcessor) EmptyEntityEventProcessor(eu.bcvsolutions.idm.core.api.event.EmptyEntityEventProcessor) AsyncEntityEventProcessor(eu.bcvsolutions.idm.core.api.event.AsyncEntityEventProcessor) DefaultEventContext(eu.bcvsolutions.idm.core.api.event.DefaultEventContext)

Example 77 with DefaultResultModel

use of eu.bcvsolutions.idm.core.api.dto.DefaultResultModel in project CzechIdMng by bcvsolutions.

the class DefaultIdmTreeNodeServiceIntegrationTest method testRecountAutomaticRoleWithMissingContent.

@Test
public void testRecountAutomaticRoleWithMissingContent() {
    // create state with missing content
    IdmEntityStateDto state = new IdmEntityStateDto();
    UUID ownerId = UUID.randomUUID();
    state.setOwnerId(ownerId);
    state.setOwnerType(entityStateManager.getOwnerType(IdmRoleTreeNodeDto.class));
    state.setResult(new OperationResultDto.Builder(OperationState.BLOCKED).setModel(new DefaultResultModel(CoreResultCode.AUTOMATIC_ROLE_SKIPPED)).build());
    entityStateManager.saveState(null, state);
    // 
    state = new IdmEntityStateDto();
    state.setOwnerId(ownerId);
    state.setOwnerType(entityStateManager.getOwnerType(IdmRoleTreeNodeDto.class));
    state.setResult(new OperationResultDto.Builder(OperationState.BLOCKED).setModel(new DefaultResultModel(CoreResultCode.AUTOMATIC_ROLE_SKIPPED)).build());
    entityStateManager.saveState(null, state);
    // 
    // recount skipped automatic roles
    LongRunningFutureTask<Boolean> executor = longRunningTaskManager.execute(new ProcessSkippedAutomaticRoleByTreeTaskExecutor());
    IdmLongRunningTaskDto longRunningTask = longRunningTaskManager.getLongRunningTask(executor);
    Assert.assertTrue(longRunningTask.getWarningItemCount() > 0);
}
Also used : IdmEntityStateDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto) IdmLongRunningTaskDto(eu.bcvsolutions.idm.core.scheduler.api.dto.IdmLongRunningTaskDto) IdmRoleTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto) ProcessSkippedAutomaticRoleByTreeTaskExecutor(eu.bcvsolutions.idm.core.scheduler.task.impl.ProcessSkippedAutomaticRoleByTreeTaskExecutor) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto) UUID(java.util.UUID) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 78 with DefaultResultModel

use of eu.bcvsolutions.idm.core.api.dto.DefaultResultModel in project CzechIdMng by bcvsolutions.

the class AbstractProvisioningExecutor method changePassword.

@Override
public List<OperationResult> changePassword(DTO dto, PasswordChangeDto passwordChange) {
    Assert.notNull(dto, "DTO is required.");
    Assert.notNull(dto.getId(), "Password can be changed, when dto is already persisted.");
    Assert.notNull(passwordChange, "Password change dto is required.");
    List<SysProvisioningOperationDto> preparedOperations = new ArrayList<>();
    // 
    EntityAccountFilter filter = this.createEntityAccountFilter();
    filter.setEntityId(dto.getId());
    List<? extends EntityAccountDto> entityAccountList = getEntityAccountService().find(filter, null).getContent();
    if (entityAccountList == null) {
        return Collections.<OperationResult>emptyList();
    }
    // Distinct by accounts
    List<UUID> accountIds = new ArrayList<>();
    entityAccountList.stream().filter(entityAccount -> {
        if (!entityAccount.isOwnership()) {
            return false;
        }
        if (passwordChange.isAll()) {
            // Add all account supports change password
            if (entityAccount.getAccount() == null) {
                return false;
            }
            // Check if system for this account support change password
            AccAccountFilter accountFilter = new AccAccountFilter();
            accountFilter.setSupportChangePassword(Boolean.TRUE);
            accountFilter.setId(entityAccount.getAccount());
            List<AccAccountDto> accountsChecked = accountService.find(accountFilter, null).getContent();
            if (accountsChecked.size() == 1) {
                return true;
            }
            return false;
        } else {
            return passwordChange.getAccounts().contains(entityAccount.getAccount().toString());
        }
    }).forEach(entityAccount -> {
        if (!accountIds.contains(entityAccount.getAccount())) {
            accountIds.add(entityAccount.getAccount());
        }
    });
    // 
    // Is possible that some account has disabled password attributes
    List<OperationResult> notExecutedPasswordChanged = new ArrayList<>();
    // 
    List<AccAccountDto> accounts = new ArrayList<>();
    accountIds.forEach(accountId -> {
        AccAccountDto account = accountService.get(accountId);
        // Skip account in protection
        if (account.isInProtection()) {
            // Skip this iteration
            return;
        }
        // 
        accounts.add(account);
        // find UID from system entity or from account
        SysSystemDto system = DtoUtils.getEmbedded(account, AccAccount_.system);
        if (account.getSystemEntity() == null) {
            throw new SystemEntityNotFoundException(AccResultCode.PROVISIONING_PASSWORD_SYSTEM_ENTITY_NOT_FOUND, String.valueOf(account.getUid()), system.getCode());
        }
        SysSystemEntityDto systemEntity = systemEntityService.get(account.getSystemEntity());
        // 
        // Find mapped attributes (include overloaded attributes)
        List<AttributeMapping> finalAttributes = resolveMappedAttributes(account, dto, system, systemEntity.getEntityType());
        if (CollectionUtils.isEmpty(finalAttributes)) {
            return;
        }
        // We try find __PASSWORD__ attribute in mapped attributes
        AttributeMapping mappedAttribute = finalAttributes.stream().filter((attribute) -> {
            SysSchemaAttributeDto schemaAttributeDto = getSchemaAttribute(attribute);
            return ProvisioningService.PASSWORD_SCHEMA_PROPERTY_NAME.equals(schemaAttributeDto.getName());
        }).findFirst().orElse(null);
        // 
        // get all another passwords, list with all passwords (included primary password marked as __PASSWORD__)
        SysSystemMappingDto systemMappingDto = getMapping(system, systemEntity.getEntityType());
        List<SysSystemAttributeMappingDto> passwordAttributes = attributeMappingService.getAllPasswordAttributes(system.getId(), systemMappingDto.getId());
        // 
        // create account object with all another password
        Map<ProvisioningAttributeDto, Object> accountObjectWithAnotherPassword = new HashMap<>(passwordAttributes.size());
        for (AttributeMapping passwordAttribute : passwordAttributes) {
            // all password attributes contains also main __PASSWORD__ the attribute must be skipped
            if (mappedAttribute != null && mappedAttribute.equals(passwordAttribute)) {
                continue;
            }
            GuardedString transformPassword = transformPassword(passwordChange.getNewPassword(), passwordAttribute, systemEntity.getUid(), dto);
            SysSchemaAttributeDto schemaAttribute = schemaAttributeService.get(passwordAttribute.getSchemaAttribute());
            ProvisioningAttributeDto passwordProvisiongAttributeDto = ProvisioningAttributeDto.createProvisioningAttributeKey(passwordAttribute, schemaAttribute.getName(), schemaAttribute.getClassType());
            accountObjectWithAnotherPassword.put(passwordProvisiongAttributeDto, transformPassword);
        }
        // for this account doesn't exist mapped attribute as password
        if (accountObjectWithAnotherPassword.isEmpty() && mappedAttribute == null) {
            // Beware we cant use AccAccountDto from acc module, in core is checked by this
            notExecutedPasswordChanged.add(new OperationResult.Builder(OperationState.NOT_EXECUTED).setModel(new DefaultResultModel(CoreResultCode.PASSWORD_CHANGE_ACCOUNT_FAILED, ImmutableMap.of(IdmAccountDto.PARAMETER_NAME, createResultAccount(account, system)))).build());
            // for this account is this failed password change
            return;
        }
        // 
        // add all account attributes => standard provisioning
        SysProvisioningOperationDto additionalProvisioningOperation = null;
        // resolve another attributes that must be sent together with password
        List<AttributeMapping> additionalPasswordChangeAttributes = resolveAdditionalPasswordChangeAttributes(account, dto, system, systemEntity.getEntityType());
        if (!additionalPasswordChangeAttributes.isEmpty()) {
            additionalProvisioningOperation = prepareProvisioning(systemEntity, dto, dto.getId(), ProvisioningOperationType.UPDATE, additionalPasswordChangeAttributes);
        }
        // add another password
        if (!accountObjectWithAnotherPassword.isEmpty()) {
            if (additionalProvisioningOperation == null) {
                // if additional operation is null create one
                additionalProvisioningOperation = prepareProvisioningOperationForAdditionalPassword(systemEntity, dto, dto.getId(), ProvisioningOperationType.UPDATE, systemMappingDto, accountObjectWithAnotherPassword);
            } else {
                // if additional operation exists just add all account object with additional passwords
                additionalProvisioningOperation.getProvisioningContext().getAccountObject().putAll(accountObjectWithAnotherPassword);
            }
        }
        // 
        // password change operation
        SysProvisioningOperationDto operation;
        if (provisioningExecutor.getConfiguration().isSendPasswordAttributesTogether() && additionalProvisioningOperation != null) {
            // all attributes including another password attributes will be sent with password one provisioning operation
            operation = additionalProvisioningOperation;
            // 
            if (mappedAttribute != null) {
                // Main password attribute isn't mapped
                // transform password value trough transformation
                GuardedString transformPassword = transformPassword(passwordChange.getNewPassword(), mappedAttribute, systemEntity.getUid(), dto);
                // 
                // add wish for password
                SysSchemaAttributeDto schemaAttributeDto = schemaAttributeService.get(mappedAttribute.getSchemaAttribute());
                ProvisioningAttributeDto passwordAttribute = ProvisioningAttributeDto.createProvisioningAttributeKey(mappedAttribute, schemaAttributeDto.getName(), schemaAttributeDto.getClassType());
                // 
                // newly isn't needed check if password is constant or etc.
                // 
                operation.getProvisioningContext().getAccountObject().put(passwordAttribute, transformPassword);
            }
            // 
            // do provisioning for additional attributes and password
            // together
            preparedOperations.add(operation);
        } else {
            // 
            if (mappedAttribute != null) {
                // Main password attribute isn't mapped
                // transform password value trough transformation
                GuardedString transformPassword = transformPassword(passwordChange.getNewPassword(), mappedAttribute, systemEntity.getUid(), dto);
                // 
                operation = prepareProvisioningForAttribute(systemEntity, mappedAttribute, transformPassword, ProvisioningOperationType.UPDATE, dto);
                preparedOperations.add(operation);
            }
            // do provisioning for additional attributes and passwords in second
            if (additionalProvisioningOperation != null) {
                preparedOperations.add(additionalProvisioningOperation);
            }
        }
    });
    // 
    // execute prepared operations
    List<OperationResult> results = preparedOperations.stream().map(operation -> {
        SysProvisioningOperationDto result = provisioningExecutor.executeSync(operation);
        Map<String, Object> parameters = new LinkedHashMap<String, Object>();
        AccAccountDto account = accounts.stream().filter(a -> {
            return a.getRealUid().equals(result.getSystemEntityUid()) && a.getSystem().equals(operation.getSystem());
        }).findFirst().get();
        SysSystemDto system = DtoUtils.getEmbedded(account, AccAccount_.system);
        // 
        parameters.put(IdmAccountDto.PARAMETER_NAME, createResultAccount(account, system));
        // 
        if (result.getResult().getState() == OperationState.EXECUTED) {
            // Add success changed password account
            return new OperationResult.Builder(OperationState.EXECUTED).setModel(new DefaultResultModel(CoreResultCode.PASSWORD_CHANGE_ACCOUNT_SUCCESS, parameters)).build();
        }
        OperationResult changeResult = new OperationResult.Builder(result.getResult().getState()).setModel(new DefaultResultModel(CoreResultCode.PASSWORD_CHANGE_ACCOUNT_FAILED, parameters)).build();
        changeResult.setCause(result.getResult().getCause());
        changeResult.setCode(result.getResult().getCode());
        return changeResult;
    }).collect(Collectors.toList());
    // 
    // add not executed changed from prepare stage
    results.addAll(notExecutedPasswordChanged);
    return results;
}
Also used : ProvisioningExecutor(eu.bcvsolutions.idm.acc.service.api.ProvisioningExecutor) DtoUtils(eu.bcvsolutions.idm.core.api.utils.DtoUtils) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) Autowired(org.springframework.beans.factory.annotation.Autowired) SysSystemEntityDto(eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto) AccIdentityAccount_(eu.bcvsolutions.idm.acc.entity.AccIdentityAccount_) EntityAccountDto(eu.bcvsolutions.idm.acc.dto.EntityAccountDto) StringUtils(org.apache.commons.lang3.StringUtils) ProvisioningException(eu.bcvsolutions.idm.acc.exception.ProvisioningException) SysSystemAttributeMapping_(eu.bcvsolutions.idm.acc.entity.SysSystemAttributeMapping_) IdmRoleRequestService(eu.bcvsolutions.idm.core.api.service.IdmRoleRequestService) SysRoleSystemService(eu.bcvsolutions.idm.acc.service.api.SysRoleSystemService) AccAccountDto(eu.bcvsolutions.idm.acc.dto.AccAccountDto) SysSystemEntity_(eu.bcvsolutions.idm.acc.entity.SysSystemEntity_) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) Map(java.util.Map) ProvisioningEntityExecutor(eu.bcvsolutions.idm.acc.service.api.ProvisioningEntityExecutor) SysSystemAttributeMapping(eu.bcvsolutions.idm.acc.entity.SysSystemAttributeMapping) ImmutableMap(com.google.common.collect.ImmutableMap) Collection(java.util.Collection) SystemOperationType(eu.bcvsolutions.idm.acc.domain.SystemOperationType) ReadWriteDtoService(eu.bcvsolutions.idm.core.api.service.ReadWriteDtoService) Set(java.util.Set) PageRequest(org.springframework.data.domain.PageRequest) ProvisioningAttributeDto(eu.bcvsolutions.idm.acc.dto.ProvisioningAttributeDto) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Serializable(java.io.Serializable) AttributeMapping(eu.bcvsolutions.idm.acc.domain.AttributeMapping) List(java.util.List) EntityAccountFilter(eu.bcvsolutions.idm.acc.dto.filter.EntityAccountFilter) AccAccountService(eu.bcvsolutions.idm.acc.service.api.AccAccountService) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) CollectionUtils(org.springframework.util.CollectionUtils) AccountType(eu.bcvsolutions.idm.acc.domain.AccountType) Optional(java.util.Optional) IcUidAttribute(eu.bcvsolutions.idm.ic.api.IcUidAttribute) SysRoleSystemDto(eu.bcvsolutions.idm.acc.dto.SysRoleSystemDto) AccAccountFilter(eu.bcvsolutions.idm.acc.dto.filter.AccAccountFilter) SysSchemaObjectClassService(eu.bcvsolutions.idm.acc.service.api.SysSchemaObjectClassService) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) AccResultCode(eu.bcvsolutions.idm.acc.domain.AccResultCode) IcConnectorConfiguration(eu.bcvsolutions.idm.ic.api.IcConnectorConfiguration) MappingContext(eu.bcvsolutions.idm.acc.domain.MappingContext) IcConnectorFacade(eu.bcvsolutions.idm.ic.service.api.IcConnectorFacade) ProvisioningEvent(eu.bcvsolutions.idm.acc.event.ProvisioningEvent) AttributeMappingStrategyType(eu.bcvsolutions.idm.acc.domain.AttributeMappingStrategyType) SysRoleSystem_(eu.bcvsolutions.idm.acc.entity.SysRoleSystem_) ProvisioningEventType(eu.bcvsolutions.idm.acc.domain.ProvisioningEventType) SysSystemEntityService(eu.bcvsolutions.idm.acc.service.api.SysSystemEntityService) IdmAccountDto(eu.bcvsolutions.idm.core.api.dto.IdmAccountDto) HashMap(java.util.HashMap) IcObjectClassImpl(eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) SysRoleSystemAttribute_(eu.bcvsolutions.idm.acc.entity.SysRoleSystemAttribute_) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) SystemEntityNotFoundException(eu.bcvsolutions.idm.acc.exception.SystemEntityNotFoundException) SysSystemMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemMappingService) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) ImmutableList(com.google.common.collect.ImmutableList) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) OperationResult(eu.bcvsolutions.idm.core.api.entity.OperationResult) IcConnectorObjectImpl(eu.bcvsolutions.idm.ic.impl.IcConnectorObjectImpl) ProvisioningOperationType(eu.bcvsolutions.idm.acc.domain.ProvisioningOperationType) LinkedHashSet(java.util.LinkedHashSet) SysProvisioningOperationDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto) ProvisioningContext(eu.bcvsolutions.idm.acc.domain.ProvisioningContext) Codeable(eu.bcvsolutions.idm.core.api.domain.Codeable) SysSystemMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemMappingFilter) SysRoleSystemAttributeService(eu.bcvsolutions.idm.acc.service.api.SysRoleSystemAttributeService) SysSchemaObjectClass_(eu.bcvsolutions.idm.acc.entity.SysSchemaObjectClass_) SysSystemService(eu.bcvsolutions.idm.acc.service.api.SysSystemService) IdmRoleService(eu.bcvsolutions.idm.core.api.service.IdmRoleService) OperationState(eu.bcvsolutions.idm.core.api.domain.OperationState) IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute) EventContext(eu.bcvsolutions.idm.core.api.event.EventContext) SysRoleSystemAttributeDto(eu.bcvsolutions.idm.acc.dto.SysRoleSystemAttributeDto) SysSchemaAttributeService(eu.bcvsolutions.idm.acc.service.api.SysSchemaAttributeService) SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) Contextable(eu.bcvsolutions.idm.core.api.domain.Contextable) AccAccount_(eu.bcvsolutions.idm.acc.entity.AccAccount_) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) CoreResultCode(eu.bcvsolutions.idm.core.api.domain.CoreResultCode) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) ProvisioningService(eu.bcvsolutions.idm.acc.service.api.ProvisioningService) Collections(java.util.Collections) SysSystemAttributeMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemAttributeMappingService) PasswordChangeDto(eu.bcvsolutions.idm.core.api.dto.PasswordChangeDto) EntityEventManager(eu.bcvsolutions.idm.core.api.service.EntityEventManager) Assert(org.springframework.util.Assert) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) ArrayList(java.util.ArrayList) OperationResult(eu.bcvsolutions.idm.core.api.entity.OperationResult) ProvisioningAttributeDto(eu.bcvsolutions.idm.acc.dto.ProvisioningAttributeDto) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) AccAccountFilter(eu.bcvsolutions.idm.acc.dto.filter.AccAccountFilter) List(java.util.List) ArrayList(java.util.ArrayList) ImmutableList(com.google.common.collect.ImmutableList) UUID(java.util.UUID) SysSystemEntityDto(eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto) SysProvisioningOperationDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SystemEntityNotFoundException(eu.bcvsolutions.idm.acc.exception.SystemEntityNotFoundException) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) AccAccountDto(eu.bcvsolutions.idm.acc.dto.AccAccountDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) EntityAccountFilter(eu.bcvsolutions.idm.acc.dto.filter.EntityAccountFilter) SysSystemAttributeMapping(eu.bcvsolutions.idm.acc.entity.SysSystemAttributeMapping) AttributeMapping(eu.bcvsolutions.idm.acc.domain.AttributeMapping) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap)

Example 79 with DefaultResultModel

use of eu.bcvsolutions.idm.core.api.dto.DefaultResultModel in project CzechIdMng by bcvsolutions.

the class DefaultAccAccountManagementService method deleteIdentityAccount.

@Override
@Transactional
public void deleteIdentityAccount(EntityEvent<IdmIdentityRoleDto> event) {
    Assert.notNull(event, "Event is required.");
    IdmIdentityRoleDto identityRole = event.getContent();
    Assert.notNull(identityRole, "Identity role is required.");
    Assert.notNull(identityRole, "Identity role identifier is required.");
    // 
    boolean skipPropagate = event.getBooleanProperty(IdmAccountDto.SKIP_PROPAGATE);
    boolean bulk = event.getRootId() != null && entityEventManager.isRunnable(event.getRootId()) && !// check parent event is not role request
    entityEventManager.getEvent(event.getRootId()).getOwnerType().equals(entityEventManager.getOwnerType(IdmRoleRequestDto.class));
    if (!skipPropagate && !bulk) {
        // role is deleted without request or without any parent ... we need to remove account synchronously
        List<UUID> accountIds = deleteIdentityAccount(identityRole);
        // We needs accounts which were connected to deleted identity-role in next
        // processor (we want to execute provisioning only for that accounts)
        event.getProperties().put(ACCOUNT_IDS_FOR_DELETED_IDENTITY_ROLE, (Serializable) accountIds);
        return;
    }
    // Role is deleted in bulk (e.g. role request) - account management has to be called outside
    // we just mark identity account to be deleted and remove identity role
    AccIdentityAccountFilter filter = new AccIdentityAccountFilter();
    filter.setIdentityRoleId(identityRole.getId());
    // 
    identityAccountService.find(filter, null).getContent().forEach(identityAccount -> {
        // 
        // Set relation on identity-role to null
        identityAccount.setIdentityRole(null);
        if (bulk) {
            // For bulk create entity state for identity account.
            IdmEntityStateDto stateDeleted = new IdmEntityStateDto();
            stateDeleted.setSuperOwnerId(identityAccount.getIdentity());
            stateDeleted.setResult(new OperationResultDto.Builder(OperationState.RUNNING).setModel(new DefaultResultModel(CoreResultCode.DELETED)).build());
            entityStateManager.saveState(identityAccount, stateDeleted);
        } else {
            // Noting identity-accounts for delayed delete and account management
            notingIdentityAccountForDelayedAcm(event, identityAccount, IdmAccountDto.IDENTITY_ACCOUNT_FOR_DELAYED_ACM);
        }
        identityAccountService.save(identityAccount);
    });
    // If default creation of accounts is disabled for this role-system  (or system is in a cross-domain group), then relation between identity
    // and account may not exist. In this scenario we have to made provisioning too.
    // So we try to find these role-systems and its accounts.
    SysRoleSystemFilter roleSystemForProvisioningFilter = new SysRoleSystemFilter();
    roleSystemForProvisioningFilter.setRoleId(identityRole.getRole());
    roleSystemService.find(roleSystemForProvisioningFilter, null).getContent().stream().filter(roleSystem -> {
        if (!roleSystem.isCreateAccountByDefault()) {
            return true;
        } else {
            SysSystemGroupSystemFilter systemGroupSystemFilter = new SysSystemGroupSystemFilter();
            systemGroupSystemFilter.setCrossDomainsGroupsForRoleSystemId(roleSystem.getId());
            if (systemGroupSystemService.count(systemGroupSystemFilter) >= 1 && (identityRole.getRoleSystem() == null || roleSystem.getId().equals(identityRole.getRoleSystem()))) {
                // -> Provisioning should be made.
                return true;
            }
        }
        return false;
    }).forEach(roleSystem -> {
        IdmIdentityContractDto contractDto = lookupService.lookupEmbeddedDto(identityRole, IdmIdentityRole_.identityContract);
        AccIdentityAccountFilter identityAccountFilter = new AccIdentityAccountFilter();
        identityAccountFilter.setSystemId(roleSystem.getSystem());
        identityAccountFilter.setIdentityId(contractDto.getIdentity());
        identityAccountService.find(identityAccountFilter, null).getContent().forEach(identityAccount -> {
            // Noting identity-accounts for delayed additional provisioning.
            notingIdentityAccountForDelayedAcm(event, identityAccount, IdmAccountDto.ACCOUNT_FOR_ADDITIONAL_PROVISIONING);
        });
    });
}
Also used : IdmEntityStateDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto) DtoUtils(eu.bcvsolutions.idm.core.api.utils.DtoUtils) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) Autowired(org.springframework.beans.factory.annotation.Autowired) AccIdentityAccount_(eu.bcvsolutions.idm.acc.entity.AccIdentityAccount_) ProvisioningException(eu.bcvsolutions.idm.acc.exception.ProvisioningException) SysRoleSystemService(eu.bcvsolutions.idm.acc.service.api.SysRoleSystemService) AccAccountDto(eu.bcvsolutions.idm.acc.dto.AccAccountDto) AccIdentityAccountDto(eu.bcvsolutions.idm.acc.dto.AccIdentityAccountDto) ImmutableMap(com.google.common.collect.ImmutableMap) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) Set(java.util.Set) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto) IdmEntityStateFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityStateFilter) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Serializable(java.io.Serializable) IdmEntityStateDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto) List(java.util.List) AccAccountService(eu.bcvsolutions.idm.acc.service.api.AccAccountService) SysRoleSystemAttributeFilter(eu.bcvsolutions.idm.acc.dto.filter.SysRoleSystemAttributeFilter) CollectionUtils(org.springframework.util.CollectionUtils) AccountType(eu.bcvsolutions.idm.acc.domain.AccountType) AccIdentityAccountService(eu.bcvsolutions.idm.acc.service.api.AccIdentityAccountService) SysRoleSystemDto(eu.bcvsolutions.idm.acc.dto.SysRoleSystemDto) AccAccountFilter(eu.bcvsolutions.idm.acc.dto.filter.AccAccountFilter) SysSchemaObjectClassService(eu.bcvsolutions.idm.acc.service.api.SysSchemaObjectClassService) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) AccResultCode(eu.bcvsolutions.idm.acc.domain.AccResultCode) IdmIdentityRole_(eu.bcvsolutions.idm.core.model.entity.IdmIdentityRole_) SysSystemGroupSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemGroupSystemFilter) SysRoleSystem_(eu.bcvsolutions.idm.acc.entity.SysRoleSystem_) IdmAccountDto(eu.bcvsolutions.idm.core.api.dto.IdmAccountDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) SysRoleSystemAttribute_(eu.bcvsolutions.idm.acc.entity.SysRoleSystemAttribute_) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) AccAccountManagementService(eu.bcvsolutions.idm.acc.service.api.AccAccountManagementService) HashSet(java.util.HashSet) SysRoleSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysRoleSystemFilter) SysSystemMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemMappingService) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) EntityStateManager(eu.bcvsolutions.idm.core.api.service.EntityStateManager) LookupService(eu.bcvsolutions.idm.core.api.service.LookupService) Lists(com.google.common.collect.Lists) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) Service(org.springframework.stereotype.Service) OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) SysSystemGroupSystemService(eu.bcvsolutions.idm.acc.service.api.SysSystemGroupSystemService) EntityEvent(eu.bcvsolutions.idm.core.api.event.EntityEvent) SysRoleSystemAttributeService(eu.bcvsolutions.idm.acc.service.api.SysRoleSystemAttributeService) IdmIdentityRoleService(eu.bcvsolutions.idm.core.api.service.IdmIdentityRoleService) SysSchemaObjectClass_(eu.bcvsolutions.idm.acc.entity.SysSchemaObjectClass_) AccIdentityAccountFilter(eu.bcvsolutions.idm.acc.dto.filter.AccIdentityAccountFilter) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) OperationState(eu.bcvsolutions.idm.core.api.domain.OperationState) SysRoleSystemAttributeDto(eu.bcvsolutions.idm.acc.dto.SysRoleSystemAttributeDto) SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) CoreResultCode(eu.bcvsolutions.idm.core.api.domain.CoreResultCode) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysSystemAttributeMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemAttributeMappingService) EntityEventManager(eu.bcvsolutions.idm.core.api.service.EntityEventManager) Transactional(org.springframework.transaction.annotation.Transactional) Assert(org.springframework.util.Assert) SysSystemGroupSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemGroupSystemFilter) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto) SysRoleSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysRoleSystemFilter) AccIdentityAccountFilter(eu.bcvsolutions.idm.acc.dto.filter.AccIdentityAccountFilter) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) UUID(java.util.UUID) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) Transactional(org.springframework.transaction.annotation.Transactional)

Example 80 with DefaultResultModel

use of eu.bcvsolutions.idm.core.api.dto.DefaultResultModel in project CzechIdMng by bcvsolutions.

the class AbstractSchedulableStatefulExecutor method processCandidate.

private Optional<OperationResult> processCandidate(DTO candidate, boolean dryRun) {
    if (isInProcessedQueue(candidate)) {
        // item was processed earlier - just drop the count by one
        // FIXME: this is confusing => task ends with 0 count, if all items are skipped (processed before)
        --count;
        return Optional.empty();
    }
    // Is not possible to get real cause from UnexpectedRollbackException,
    // so result has to be evaluated inside before this exception is catch.
    List<Optional<OperationResult>> results = new ArrayList<>(1);
    // 
    if (dryRun) {
        if (!supportsDryRun()) {
            throw new DryRunNotSupportedException(getName());
        }
        // dry run mode - operation is not executed with dry run code (no content)
        results.add(Optional.of(new OperationResult.Builder(OperationState.NOT_EXECUTED).setModel(new DefaultResultModel(CoreResultCode.DRY_RUN)).build()));
    } else if (requireNewTransaction()) {
        TransactionTemplate template = new TransactionTemplate(platformTransactionManager);
        template.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
        // 
        try {
            template.execute(new TransactionCallbackWithoutResult() {

                @Override
                protected void doInTransactionWithoutResult(TransactionStatus status) {
                    results.add(processItemInternal(candidate));
                }
            });
        } catch (UnexpectedRollbackException ex) {
            // Just log for sure ... exception solved in new transaction, but this lower transaction is marked as roll-back.
            LOG.debug("Statefull process [{}] processed item [{}] failed", getClass().getSimpleName(), candidate, ex);
        }
    } else {
        results.add(this.processItemInternal(candidate));
    }
    // 
    ++counter;
    Optional<OperationResult> result;
    if (!results.isEmpty()) {
        result = results.get(0);
        if (result == null) {
            // null can be returned simply => empty result
            result = Optional.empty();
        }
    } else {
        result = Optional.empty();
    }
    // 
    if (result.isPresent()) {
        OperationResult opResult = result.get();
        this.logItemProcessed(candidate, opResult);
        if (OperationState.isSuccessful(opResult.getState())) {
            this.addToProcessedQueue(candidate, opResult);
        }
        LOG.debug("Statefull process [{}] intermediate result: [{}], count: [{}/{}]", getClass().getSimpleName(), opResult.getState(), count, counter);
        if (!continueOnException() && opResult.getException() != null) {
            ResultCodeException resultCodeException;
            if (opResult.getException() instanceof ResultCodeException) {
                resultCodeException = (ResultCodeException) opResult.getException();
            } else {
                resultCodeException = new ResultCodeException(CoreResultCode.LONG_RUNNING_TASK_ITEM_FAILED, ImmutableMap.of("referencedEntityId", candidate.getId()), opResult.getException());
            }
            LOG.error("[" + resultCodeException.getId() + "] ", resultCodeException);
            // 
            throw resultCodeException;
        }
    } else {
        LOG.debug("Statefull process [{}] processed item [{}] without result.", getClass().getSimpleName(), candidate);
    }
    // 
    return result;
}
Also used : Optional(java.util.Optional) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) ArrayList(java.util.ArrayList) TransactionTemplate(org.springframework.transaction.support.TransactionTemplate) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) TransactionStatus(org.springframework.transaction.TransactionStatus) OperationResult(eu.bcvsolutions.idm.core.api.entity.OperationResult) DryRunNotSupportedException(eu.bcvsolutions.idm.core.scheduler.api.exception.DryRunNotSupportedException) UnexpectedRollbackException(org.springframework.transaction.UnexpectedRollbackException) TransactionCallbackWithoutResult(org.springframework.transaction.support.TransactionCallbackWithoutResult)

Aggregations

DefaultResultModel (eu.bcvsolutions.idm.core.api.dto.DefaultResultModel)104 ResultModel (eu.bcvsolutions.idm.core.api.dto.ResultModel)52 UUID (java.util.UUID)48 OperationResultDto (eu.bcvsolutions.idm.core.api.dto.OperationResultDto)40 OperationResult (eu.bcvsolutions.idm.core.api.entity.OperationResult)35 ResultCodeException (eu.bcvsolutions.idm.core.api.exception.ResultCodeException)25 IdmEntityStateDto (eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto)24 DefaultEventResult (eu.bcvsolutions.idm.core.api.event.DefaultEventResult)21 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)19 HashMap (java.util.HashMap)19 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)18 OperationState (eu.bcvsolutions.idm.core.api.domain.OperationState)16 IdmRoleRequestDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto)16 Autowired (org.springframework.beans.factory.annotation.Autowired)16 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)15 List (java.util.List)15 IdmConceptRoleRequestDto (eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto)14 Set (java.util.Set)14 ImmutableMap (com.google.common.collect.ImmutableMap)13 CoreResultCode (eu.bcvsolutions.idm.core.api.domain.CoreResultCode)13