Search in sources :

Example 11 with ExternalResource

use of org.apache.syncope.core.persistence.api.entity.resource.ExternalResource in project syncope by apache.

the class PriorityPropagationTaskExecutor method doExecute.

@Override
protected void doExecute(final Collection<PropagationTaskTO> tasks, final PropagationReporter reporter, final boolean nullPriorityAsync) {
    Map<PropagationTaskTO, ExternalResource> taskToResource = tasks.stream().collect(Collectors.toMap(Function.identity(), task -> resourceDAO.find(task.getResource())));
    List<PropagationTaskTO> prioritizedTasks = tasks.stream().filter(task -> taskToResource.get(task).getPropagationPriority() != null).collect(Collectors.toList());
    Collections.sort(prioritizedTasks, new PriorityComparator(taskToResource));
    LOG.debug("Propagation tasks sorted by priority, for serial execution: {}", prioritizedTasks);
    Collection<PropagationTaskTO> concurrentTasks = tasks.stream().filter(task -> !prioritizedTasks.contains(task)).collect(Collectors.toSet());
    LOG.debug("Propagation tasks for concurrent execution: {}", concurrentTasks);
    // first process priority resources sequentially and fail as soon as any propagation failure is reported
    prioritizedTasks.forEach(task -> {
        TaskExec execution = null;
        PropagationTaskExecStatus execStatus;
        try {
            execution = newPropagationTaskCallable(task, reporter).call();
            execStatus = PropagationTaskExecStatus.valueOf(execution.getStatus());
        } catch (Exception e) {
            LOG.error("Unexpected exception", e);
            execStatus = PropagationTaskExecStatus.FAILURE;
        }
        if (execStatus != PropagationTaskExecStatus.SUCCESS) {
            throw new PropagationException(task.getResource(), execution == null ? null : execution.getMessage());
        }
    });
    // then process non-priority resources concurrently...
    CompletionService<TaskExec> completionService = new ExecutorCompletionService<>(executor);
    Map<PropagationTaskTO, Future<TaskExec>> nullPriority = new HashMap<>(concurrentTasks.size());
    concurrentTasks.forEach(task -> {
        try {
            nullPriority.put(task, completionService.submit(newPropagationTaskCallable(task, reporter)));
        } catch (Exception e) {
            LOG.error("Unexpected exception", e);
        }
    });
    // ...waiting for all callables to complete, if async processing was not required
    if (!nullPriority.isEmpty()) {
        if (nullPriorityAsync) {
            nullPriority.forEach((task, exec) -> {
                reporter.onSuccessOrNonPriorityResourceFailures(task, PropagationTaskExecStatus.CREATED, null, null, null);
            });
        } else {
            final Set<Future<TaskExec>> nullPriorityFutures = new HashSet<>(nullPriority.values());
            try {
                executor.submit(() -> {
                    while (!nullPriorityFutures.isEmpty()) {
                        try {
                            nullPriorityFutures.remove(completionService.take());
                        } catch (Exception e) {
                            LOG.error("Unexpected exception", e);
                        }
                    }
                }).get(60, TimeUnit.SECONDS);
            } catch (Exception e) {
                LOG.error("Unexpected exception", e);
            } finally {
                nullPriorityFutures.forEach(future -> {
                    future.cancel(true);
                });
                nullPriorityFutures.clear();
                nullPriority.clear();
            }
        }
    }
}
Also used : PropagationTaskExecStatus(org.apache.syncope.common.lib.types.PropagationTaskExecStatus) HashMap(java.util.HashMap) AbstractBeanDefinition(org.springframework.beans.factory.support.AbstractBeanDefinition) Function(java.util.function.Function) PropagationTaskCallable(org.apache.syncope.core.provisioning.api.propagation.PropagationTaskCallable) CompletionService(java.util.concurrent.CompletionService) HashSet(java.util.HashSet) Future(java.util.concurrent.Future) PropagationTaskTO(org.apache.syncope.common.lib.to.PropagationTaskTO) Map(java.util.Map) TaskExec(org.apache.syncope.core.persistence.api.entity.task.TaskExec) ThreadPoolTaskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor) Collection(java.util.Collection) Resource(javax.annotation.Resource) PropagationException(org.apache.syncope.core.provisioning.api.propagation.PropagationException) Set(java.util.Set) PropagationReporter(org.apache.syncope.core.provisioning.api.propagation.PropagationReporter) Collectors(java.util.stream.Collectors) Serializable(java.io.Serializable) TimeUnit(java.util.concurrent.TimeUnit) ExternalResource(org.apache.syncope.core.persistence.api.entity.resource.ExternalResource) List(java.util.List) Comparator(java.util.Comparator) ApplicationContextProvider(org.apache.syncope.core.spring.ApplicationContextProvider) Collections(java.util.Collections) ExecutorCompletionService(java.util.concurrent.ExecutorCompletionService) PropagationTaskTO(org.apache.syncope.common.lib.to.PropagationTaskTO) HashMap(java.util.HashMap) PropagationTaskExecStatus(org.apache.syncope.common.lib.types.PropagationTaskExecStatus) ExecutorCompletionService(java.util.concurrent.ExecutorCompletionService) ExternalResource(org.apache.syncope.core.persistence.api.entity.resource.ExternalResource) PropagationException(org.apache.syncope.core.provisioning.api.propagation.PropagationException) PropagationException(org.apache.syncope.core.provisioning.api.propagation.PropagationException) TaskExec(org.apache.syncope.core.persistence.api.entity.task.TaskExec) Future(java.util.concurrent.Future) HashSet(java.util.HashSet)

Example 12 with ExternalResource

use of org.apache.syncope.core.persistence.api.entity.resource.ExternalResource in project syncope by apache.

the class PolicyDataBinderImpl method getPolicy.

@SuppressWarnings("unchecked")
private <T extends Policy> T getPolicy(final T policy, final PolicyTO policyTO) {
    T result = policy;
    if (policyTO instanceof PasswordPolicyTO) {
        if (result == null) {
            result = (T) entityFactory.newEntity(PasswordPolicy.class);
        }
        PasswordPolicy passwordPolicy = PasswordPolicy.class.cast(result);
        PasswordPolicyTO passwordPolicyTO = PasswordPolicyTO.class.cast(policyTO);
        passwordPolicy.setAllowNullPassword(passwordPolicyTO.isAllowNullPassword());
        passwordPolicy.setHistoryLength(passwordPolicyTO.getHistoryLength());
        passwordPolicyTO.getRules().forEach(ruleKey -> {
            Implementation rule = implementationDAO.find(ruleKey);
            if (rule == null) {
                LOG.debug("Invalid " + Implementation.class.getSimpleName() + " {}, ignoring...", ruleKey);
            } else {
                passwordPolicy.add(rule);
            }
        });
        // remove all implementations not contained in the TO
        passwordPolicy.getRules().removeIf(implementation -> !passwordPolicyTO.getRules().contains(implementation.getKey()));
    } else if (policyTO instanceof AccountPolicyTO) {
        if (result == null) {
            result = (T) entityFactory.newEntity(AccountPolicy.class);
        }
        AccountPolicy accountPolicy = AccountPolicy.class.cast(result);
        AccountPolicyTO accountPolicyTO = AccountPolicyTO.class.cast(policyTO);
        accountPolicy.setMaxAuthenticationAttempts(accountPolicyTO.getMaxAuthenticationAttempts());
        accountPolicy.setPropagateSuspension(accountPolicyTO.isPropagateSuspension());
        accountPolicyTO.getRules().forEach(ruleKey -> {
            Implementation rule = implementationDAO.find(ruleKey);
            if (rule == null) {
                LOG.debug("Invalid " + Implementation.class.getSimpleName() + " {}, ignoring...", ruleKey);
            } else {
                accountPolicy.add(rule);
            }
        });
        // remove all implementations not contained in the TO
        accountPolicy.getRules().removeIf(implementation -> !accountPolicyTO.getRules().contains(implementation.getKey()));
        accountPolicy.getResources().clear();
        accountPolicyTO.getPassthroughResources().forEach(resourceName -> {
            ExternalResource resource = resourceDAO.find(resourceName);
            if (resource == null) {
                LOG.debug("Ignoring invalid resource {} ", resourceName);
            } else {
                accountPolicy.add(resource);
            }
        });
    } else if (policyTO instanceof PullPolicyTO) {
        if (result == null) {
            result = (T) entityFactory.newEntity(PullPolicy.class);
        }
        PullPolicy pullPolicy = PullPolicy.class.cast(result);
        PullPolicyTO pullPolicyTO = PullPolicyTO.class.cast(policyTO);
        pullPolicy.setConflictResolutionAction(pullPolicyTO.getConflictResolutionAction());
        pullPolicyTO.getCorrelationRules().forEach((type, impl) -> {
            AnyType anyType = anyTypeDAO.find(type);
            if (anyType == null) {
                LOG.debug("Invalid AnyType {} specified, ignoring...", type);
            } else {
                CorrelationRule correlationRule = pullPolicy.getCorrelationRule(anyType).orElse(null);
                if (correlationRule == null) {
                    correlationRule = entityFactory.newEntity(CorrelationRule.class);
                    correlationRule.setAnyType(anyType);
                    correlationRule.setPullPolicy(pullPolicy);
                    pullPolicy.add(correlationRule);
                }
                Implementation rule = implementationDAO.find(impl);
                if (rule == null) {
                    throw new NotFoundException("Implementation " + type);
                }
                correlationRule.setImplementation(rule);
            }
        });
        // remove all rules not contained in the TO
        pullPolicy.getCorrelationRules().removeIf(anyFilter -> !pullPolicyTO.getCorrelationRules().containsKey(anyFilter.getAnyType().getKey()));
    }
    if (result != null) {
        result.setDescription(policyTO.getDescription());
    }
    return result;
}
Also used : PullPolicy(org.apache.syncope.core.persistence.api.entity.policy.PullPolicy) Realm(org.apache.syncope.core.persistence.api.entity.Realm) LoggerFactory(org.slf4j.LoggerFactory) AnyType(org.apache.syncope.core.persistence.api.entity.AnyType) Autowired(org.springframework.beans.factory.annotation.Autowired) Entity(org.apache.syncope.core.persistence.api.entity.Entity) PolicyDataBinder(org.apache.syncope.core.provisioning.api.data.PolicyDataBinder) PasswordPolicy(org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy) RealmDAO(org.apache.syncope.core.persistence.api.dao.RealmDAO) ImplementationDAO(org.apache.syncope.core.persistence.api.dao.ImplementationDAO) PolicyTO(org.apache.syncope.common.lib.policy.PolicyTO) PasswordPolicyTO(org.apache.syncope.common.lib.policy.PasswordPolicyTO) Logger(org.slf4j.Logger) Policy(org.apache.syncope.core.persistence.api.entity.policy.Policy) Implementation(org.apache.syncope.core.persistence.api.entity.Implementation) Collectors(java.util.stream.Collectors) AnyTypeDAO(org.apache.syncope.core.persistence.api.dao.AnyTypeDAO) NotFoundException(org.apache.syncope.core.persistence.api.dao.NotFoundException) EntityFactory(org.apache.syncope.core.persistence.api.entity.EntityFactory) ExternalResource(org.apache.syncope.core.persistence.api.entity.resource.ExternalResource) AccountPolicy(org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy) Component(org.springframework.stereotype.Component) CorrelationRule(org.apache.syncope.core.persistence.api.entity.policy.CorrelationRule) AccountPolicyTO(org.apache.syncope.common.lib.policy.AccountPolicyTO) PullPolicyTO(org.apache.syncope.common.lib.policy.PullPolicyTO) ExternalResourceDAO(org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO) PullPolicyTO(org.apache.syncope.common.lib.policy.PullPolicyTO) NotFoundException(org.apache.syncope.core.persistence.api.dao.NotFoundException) AccountPolicyTO(org.apache.syncope.common.lib.policy.AccountPolicyTO) ExternalResource(org.apache.syncope.core.persistence.api.entity.resource.ExternalResource) Implementation(org.apache.syncope.core.persistence.api.entity.Implementation) AccountPolicy(org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy) PasswordPolicy(org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy) PullPolicy(org.apache.syncope.core.persistence.api.entity.policy.PullPolicy) CorrelationRule(org.apache.syncope.core.persistence.api.entity.policy.CorrelationRule) AnyType(org.apache.syncope.core.persistence.api.entity.AnyType) PasswordPolicyTO(org.apache.syncope.common.lib.policy.PasswordPolicyTO)

Example 13 with ExternalResource

use of org.apache.syncope.core.persistence.api.entity.resource.ExternalResource in project syncope by apache.

the class RealmDataBinderImpl method create.

@Override
public Realm create(final Realm parent, final RealmTO realmTO) {
    Realm realm = entityFactory.newEntity(Realm.class);
    realm.setName(realmTO.getName());
    realm.setParent(parent);
    if (realmTO.getPasswordPolicy() != null) {
        Policy policy = policyDAO.find(realmTO.getPasswordPolicy());
        if (policy instanceof PasswordPolicy) {
            realm.setPasswordPolicy((PasswordPolicy) policy);
        } else {
            SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidPolicy);
            sce.getElements().add("Expected " + PasswordPolicy.class.getSimpleName() + ", found " + policy.getClass().getSimpleName());
            throw sce;
        }
    }
    if (realmTO.getAccountPolicy() != null) {
        Policy policy = policyDAO.find(realmTO.getAccountPolicy());
        if (policy instanceof AccountPolicy) {
            realm.setAccountPolicy((AccountPolicy) policy);
        } else {
            SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidPolicy);
            sce.getElements().add("Expected " + AccountPolicy.class.getSimpleName() + ", found " + policy.getClass().getSimpleName());
            throw sce;
        }
    }
    realmTO.getActions().forEach(logicActionsKey -> {
        Implementation logicAction = implementationDAO.find(logicActionsKey);
        if (logicAction == null) {
            LOG.debug("Invalid " + Implementation.class.getSimpleName() + " {}, ignoring...", logicActionsKey);
        } else {
            realm.add(logicAction);
        }
    });
    setTemplates(realmTO, realm);
    realmTO.getResources().forEach(resourceKey -> {
        ExternalResource resource = resourceDAO.find(resourceKey);
        if (resource == null) {
            LOG.debug("Invalid " + ExternalResource.class.getSimpleName() + " {}, ignoring...", resourceKey);
        } else {
            realm.add(resource);
        }
    });
    return realm;
}
Also used : PasswordPolicy(org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy) Policy(org.apache.syncope.core.persistence.api.entity.policy.Policy) AccountPolicy(org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy) AccountPolicy(org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy) PasswordPolicy(org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy) SyncopeClientException(org.apache.syncope.common.lib.SyncopeClientException) Realm(org.apache.syncope.core.persistence.api.entity.Realm) AnyTemplateRealm(org.apache.syncope.core.persistence.api.entity.AnyTemplateRealm) ExternalResource(org.apache.syncope.core.persistence.api.entity.resource.ExternalResource) Implementation(org.apache.syncope.core.persistence.api.entity.Implementation)

Example 14 with ExternalResource

use of org.apache.syncope.core.persistence.api.entity.resource.ExternalResource in project syncope by apache.

the class RealmDataBinderImpl method update.

@Override
public PropagationByResource update(final Realm realm, final RealmTO realmTO) {
    realm.setName(realmTO.getName());
    realm.setParent(realmTO.getParent() == null ? null : realmDAO.find(realmTO.getParent()));
    if (realmTO.getAccountPolicy() == null) {
        realm.setAccountPolicy(null);
    } else {
        Policy policy = policyDAO.find(realmTO.getAccountPolicy());
        if (policy instanceof AccountPolicy) {
            realm.setAccountPolicy((AccountPolicy) policy);
        } else {
            SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidPolicy);
            sce.getElements().add("Expected " + AccountPolicy.class.getSimpleName() + ", found " + policy.getClass().getSimpleName());
            throw sce;
        }
    }
    if (realmTO.getPasswordPolicy() == null) {
        realm.setPasswordPolicy(null);
    } else {
        Policy policy = policyDAO.find(realmTO.getPasswordPolicy());
        if (policy instanceof PasswordPolicy) {
            realm.setPasswordPolicy((PasswordPolicy) policy);
        } else {
            SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidPolicy);
            sce.getElements().add("Expected " + PasswordPolicy.class.getSimpleName() + ", found " + policy.getClass().getSimpleName());
            throw sce;
        }
    }
    realmTO.getActions().forEach(logicActionsKey -> {
        Implementation logicActions = implementationDAO.find(logicActionsKey);
        if (logicActions == null) {
            LOG.debug("Invalid " + Implementation.class.getSimpleName() + " {}, ignoring...", logicActionsKey);
        } else {
            realm.add(logicActions);
        }
    });
    // remove all implementations not contained in the TO
    realm.getActions().removeIf(implementation -> !realmTO.getActions().contains(implementation.getKey()));
    setTemplates(realmTO, realm);
    PropagationByResource propByRes = new PropagationByResource();
    realmTO.getResources().forEach(resourceKey -> {
        ExternalResource resource = resourceDAO.find(resourceKey);
        if (resource == null) {
            LOG.debug("Invalid " + ExternalResource.class.getSimpleName() + " {}, ignoring...", resourceKey);
        } else {
            realm.add(resource);
            propByRes.add(ResourceOperation.CREATE, resource.getKey());
        }
    });
    // remove all resources not contained in the TO
    realm.getResources().removeIf(resource -> {
        boolean contained = realmTO.getResources().contains(resource.getKey());
        if (!contained) {
            propByRes.add(ResourceOperation.DELETE, resource.getKey());
        }
        return !contained;
    });
    return propByRes;
}
Also used : PasswordPolicy(org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy) Policy(org.apache.syncope.core.persistence.api.entity.policy.Policy) AccountPolicy(org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy) AccountPolicy(org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy) SyncopeClientException(org.apache.syncope.common.lib.SyncopeClientException) PasswordPolicy(org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy) PropagationByResource(org.apache.syncope.core.provisioning.api.PropagationByResource) ExternalResource(org.apache.syncope.core.persistence.api.entity.resource.ExternalResource) Implementation(org.apache.syncope.core.persistence.api.entity.Implementation)

Example 15 with ExternalResource

use of org.apache.syncope.core.persistence.api.entity.resource.ExternalResource in project syncope by apache.

the class ResourceDataBinderImpl method getResourceTO.

@Override
public ResourceTO getResourceTO(final ExternalResource resource) {
    ResourceTO resourceTO = new ResourceTO();
    // set the resource name
    resourceTO.setKey(resource.getKey());
    // set the connector instance
    ConnInstance connector = resource.getConnector();
    resourceTO.setConnector(connector == null ? null : connector.getKey());
    resourceTO.setConnectorDisplayName(connector == null ? null : connector.getDisplayName());
    // set the provision information
    resource.getProvisions().stream().map(provision -> {
        ProvisionTO provisionTO = new ProvisionTO();
        provisionTO.setKey(provision.getKey());
        provisionTO.setAnyType(provision.getAnyType().getKey());
        provisionTO.setObjectClass(provision.getObjectClass().getObjectClassValue());
        provisionTO.getAuxClasses().addAll(provision.getAuxClasses().stream().map(cls -> cls.getKey()).collect(Collectors.toList()));
        provisionTO.setSyncToken(provision.getSerializedSyncToken());
        if (provision.getMapping() != null) {
            MappingTO mappingTO = new MappingTO();
            provisionTO.setMapping(mappingTO);
            mappingTO.setConnObjectLink(provision.getMapping().getConnObjectLink());
            populateItems(provision.getMapping().getItems(), mappingTO);
        }
        virSchemaDAO.findByProvision(provision).forEach(virSchema -> {
            provisionTO.getVirSchemas().add(virSchema.getKey());
            MappingItem linkingMappingItem = virSchema.asLinkingMappingItem();
            ItemTO itemTO = new ItemTO();
            itemTO.setKey(linkingMappingItem.getKey());
            BeanUtils.copyProperties(linkingMappingItem, itemTO, ITEM_IGNORE_PROPERTIES);
            provisionTO.getMapping().getLinkingItems().add(itemTO);
        });
        return provisionTO;
    }).forEachOrdered(provisionTO -> {
        resourceTO.getProvisions().add(provisionTO);
    });
    if (resource.getOrgUnit() != null) {
        OrgUnit orgUnit = resource.getOrgUnit();
        OrgUnitTO orgUnitTO = new OrgUnitTO();
        orgUnitTO.setKey(orgUnit.getKey());
        orgUnitTO.setObjectClass(orgUnit.getObjectClass().getObjectClassValue());
        orgUnitTO.setSyncToken(orgUnit.getSerializedSyncToken());
        orgUnitTO.setConnObjectLink(orgUnit.getConnObjectLink());
        populateItems(orgUnit.getItems(), orgUnitTO);
        resourceTO.setOrgUnit(orgUnitTO);
    }
    resourceTO.setEnforceMandatoryCondition(resource.isEnforceMandatoryCondition());
    resourceTO.setPropagationPriority(resource.getPropagationPriority());
    resourceTO.setRandomPwdIfNotProvided(resource.isRandomPwdIfNotProvided());
    resourceTO.setCreateTraceLevel(resource.getCreateTraceLevel());
    resourceTO.setUpdateTraceLevel(resource.getUpdateTraceLevel());
    resourceTO.setDeleteTraceLevel(resource.getDeleteTraceLevel());
    resourceTO.setProvisioningTraceLevel(resource.getProvisioningTraceLevel());
    resourceTO.setPasswordPolicy(resource.getPasswordPolicy() == null ? null : resource.getPasswordPolicy().getKey());
    resourceTO.setAccountPolicy(resource.getAccountPolicy() == null ? null : resource.getAccountPolicy().getKey());
    resourceTO.setPullPolicy(resource.getPullPolicy() == null ? null : resource.getPullPolicy().getKey());
    resourceTO.getConfOverride().addAll(resource.getConfOverride());
    Collections.sort(resourceTO.getConfOverride());
    resourceTO.setOverrideCapabilities(resource.isOverrideCapabilities());
    resourceTO.getCapabilitiesOverride().addAll(resource.getCapabilitiesOverride());
    resourceTO.getPropagationActions().addAll(resource.getPropagationActions().stream().map(Entity::getKey).collect(Collectors.toList()));
    return resourceTO;
}
Also used : ProvisionTO(org.apache.syncope.common.lib.to.ProvisionTO) SyncopeClientException(org.apache.syncope.common.lib.SyncopeClientException) PullPolicy(org.apache.syncope.core.persistence.api.entity.policy.PullPolicy) Date(java.util.Date) LoggerFactory(org.slf4j.LoggerFactory) AnyType(org.apache.syncope.core.persistence.api.entity.AnyType) Autowired(org.springframework.beans.factory.annotation.Autowired) Entity(org.apache.syncope.core.persistence.api.entity.Entity) JexlUtils(org.apache.syncope.core.provisioning.java.jexl.JexlUtils) OrgUnit(org.apache.syncope.core.persistence.api.entity.resource.OrgUnit) AuthContextUtils(org.apache.syncope.core.spring.security.AuthContextUtils) ParseException(java.text.ParseException) ImplementationDAO(org.apache.syncope.core.persistence.api.dao.ImplementationDAO) AnyTypeClass(org.apache.syncope.core.persistence.api.entity.AnyTypeClass) MappingTO(org.apache.syncope.common.lib.to.MappingTO) OrgUnitItem(org.apache.syncope.core.persistence.api.entity.resource.OrgUnitItem) Implementation(org.apache.syncope.core.persistence.api.entity.Implementation) SchemaType(org.apache.syncope.common.lib.types.SchemaType) ConnInstanceDAO(org.apache.syncope.core.persistence.api.dao.ConnInstanceDAO) ResourceDataBinder(org.apache.syncope.core.provisioning.api.data.ResourceDataBinder) Collectors(java.util.stream.Collectors) MappingItem(org.apache.syncope.core.persistence.api.entity.resource.MappingItem) AnyTypeDAO(org.apache.syncope.core.persistence.api.dao.AnyTypeDAO) EntityFactory(org.apache.syncope.core.persistence.api.entity.EntityFactory) List(java.util.List) AccountPolicy(org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy) Provision(org.apache.syncope.core.persistence.api.entity.resource.Provision) ObjectClass(org.identityconnectors.framework.common.objects.ObjectClass) PolicyDAO(org.apache.syncope.core.persistence.api.dao.PolicyDAO) ConfDAO(org.apache.syncope.core.persistence.api.dao.ConfDAO) ExternalResourceHistoryConfDAO(org.apache.syncope.core.persistence.api.dao.ExternalResourceHistoryConfDAO) IntAttrName(org.apache.syncope.core.provisioning.api.IntAttrName) ResourceHistoryConfTO(org.apache.syncope.common.lib.to.ResourceHistoryConfTO) BeanUtils(org.apache.syncope.core.spring.BeanUtils) HashSet(java.util.HashSet) PasswordPolicy(org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy) ItemTO(org.apache.syncope.common.lib.to.ItemTO) SyncopeClientCompositeException(org.apache.syncope.common.lib.SyncopeClientCompositeException) ClientExceptionType(org.apache.syncope.common.lib.types.ClientExceptionType) Item(org.apache.syncope.core.persistence.api.entity.resource.Item) AnyTypeClassTO(org.apache.syncope.common.lib.to.AnyTypeClassTO) Mapping(org.apache.syncope.core.persistence.api.entity.resource.Mapping) Logger(org.slf4j.Logger) Iterator(java.util.Iterator) ResourceTO(org.apache.syncope.common.lib.to.ResourceTO) ItemContainerTO(org.apache.syncope.common.lib.to.ItemContainerTO) IteratorChain(org.apache.syncope.common.lib.collections.IteratorChain) ExternalResourceHistoryConf(org.apache.syncope.core.persistence.api.entity.resource.ExternalResourceHistoryConf) ConnInstance(org.apache.syncope.core.persistence.api.entity.ConnInstance) VirSchema(org.apache.syncope.core.persistence.api.entity.VirSchema) ExternalResource(org.apache.syncope.core.persistence.api.entity.resource.ExternalResource) Component(org.springframework.stereotype.Component) MappingPurpose(org.apache.syncope.common.lib.types.MappingPurpose) OrgUnitTO(org.apache.syncope.common.lib.to.OrgUnitTO) VirSchemaDAO(org.apache.syncope.core.persistence.api.dao.VirSchemaDAO) IntAttrNameParser(org.apache.syncope.core.provisioning.java.IntAttrNameParser) Collections(java.util.Collections) AnyTypeClassDAO(org.apache.syncope.core.persistence.api.dao.AnyTypeClassDAO) OrgUnit(org.apache.syncope.core.persistence.api.entity.resource.OrgUnit) Entity(org.apache.syncope.core.persistence.api.entity.Entity) MappingTO(org.apache.syncope.common.lib.to.MappingTO) MappingItem(org.apache.syncope.core.persistence.api.entity.resource.MappingItem) OrgUnitTO(org.apache.syncope.common.lib.to.OrgUnitTO) ResourceTO(org.apache.syncope.common.lib.to.ResourceTO) ProvisionTO(org.apache.syncope.common.lib.to.ProvisionTO) ItemTO(org.apache.syncope.common.lib.to.ItemTO) ConnInstance(org.apache.syncope.core.persistence.api.entity.ConnInstance)

Aggregations

ExternalResource (org.apache.syncope.core.persistence.api.entity.resource.ExternalResource)59 Test (org.junit.jupiter.api.Test)30 AbstractTest (org.apache.syncope.core.persistence.jpa.AbstractTest)28 Provision (org.apache.syncope.core.persistence.api.entity.resource.Provision)23 MappingItem (org.apache.syncope.core.persistence.api.entity.resource.MappingItem)21 ConnInstance (org.apache.syncope.core.persistence.api.entity.ConnInstance)15 List (java.util.List)14 Collectors (java.util.stream.Collectors)14 HashSet (java.util.HashSet)13 NotFoundException (org.apache.syncope.core.persistence.api.dao.NotFoundException)13 Autowired (org.springframework.beans.factory.annotation.Autowired)13 Set (java.util.Set)12 Transactional (org.springframework.transaction.annotation.Transactional)12 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)10 ExternalResourceDAO (org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO)10 Collections (java.util.Collections)9 AnyTypeDAO (org.apache.syncope.core.persistence.api.dao.AnyTypeDAO)9 Realm (org.apache.syncope.core.persistence.api.entity.Realm)9 PasswordPolicy (org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy)9 AnyType (org.apache.syncope.core.persistence.api.entity.AnyType)8