Search in sources :

Example 26 with AttrTO

use of org.apache.syncope.common.lib.to.AttrTO in project syncope by apache.

the class GroupITCase method aDynMembershipCount.

@Test
public void aDynMembershipCount() {
    // Create a new printer as a dynamic member of a new group
    GroupTO group = getBasicSampleTO("aDynamicMembership");
    String fiql = SyncopeClient.getAnyObjectSearchConditionBuilder("PRINTER").is("location").equalTo("home").query();
    group.getADynMembershipConds().put("PRINTER", fiql);
    group = createGroup(group).getEntity();
    AnyObjectTO printer = new AnyObjectTO();
    printer.setRealm(SyncopeConstants.ROOT_REALM);
    printer.setName("Printer_" + getUUIDString());
    printer.setType("PRINTER");
    AttrTO location = new AttrTO.Builder().schema("location").value("home").build();
    printer.getPlainAttrs().add(location);
    printer = createAnyObject(printer).getEntity();
    group = groupService.read(group.getKey());
    assertEquals(0, group.getStaticAnyObjectMembershipCount());
    assertEquals(1, group.getDynamicAnyObjectMembershipCount());
    anyObjectService.delete(printer.getKey());
    groupService.delete(group.getKey());
}
Also used : AnyObjectTO(org.apache.syncope.common.lib.to.AnyObjectTO) AttrTO(org.apache.syncope.common.lib.to.AttrTO) GroupTO(org.apache.syncope.common.lib.to.GroupTO) Test(org.junit.jupiter.api.Test)

Example 27 with AttrTO

use of org.apache.syncope.common.lib.to.AttrTO in project syncope by apache.

the class GroupITCase method aDynMembership.

@Test
public void aDynMembership() {
    String fiql = SyncopeClient.getAnyObjectSearchConditionBuilder("PRINTER").is("location").notNullValue().query();
    // 1. create group with a given aDynMembership condition
    GroupTO group = getBasicSampleTO("aDynMembership");
    group.getADynMembershipConds().put("PRINTER", fiql);
    group = createGroup(group).getEntity();
    assertEquals(fiql, group.getADynMembershipConds().get("PRINTER"));
    group = groupService.read(group.getKey());
    final String groupKey = group.getKey();
    assertEquals(fiql, group.getADynMembershipConds().get("PRINTER"));
    // verify that the condition is dynamically applied
    AnyObjectTO newAny = AnyObjectITCase.getSampleTO("aDynMembership");
    newAny.getResources().clear();
    newAny = createAnyObject(newAny).getEntity();
    assertNotNull(newAny.getPlainAttr("location"));
    List<MembershipTO> memberships = anyObjectService.read("fc6dbc3a-6c07-4965-8781-921e7401a4a5").getDynMemberships();
    assertTrue(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
    memberships = anyObjectService.read("8559d14d-58c2-46eb-a2d4-a7d35161e8f8").getDynMemberships();
    assertTrue(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
    memberships = anyObjectService.read(newAny.getKey()).getDynMemberships();
    assertTrue(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
    // 2. update group and change aDynMembership condition
    fiql = SyncopeClient.getAnyObjectSearchConditionBuilder("PRINTER").is("location").nullValue().query();
    GroupPatch patch = new GroupPatch();
    patch.setKey(group.getKey());
    patch.getADynMembershipConds().put("PRINTER", fiql);
    group = updateGroup(patch).getEntity();
    assertEquals(fiql, group.getADynMembershipConds().get("PRINTER"));
    group = groupService.read(group.getKey());
    assertEquals(fiql, group.getADynMembershipConds().get("PRINTER"));
    // verify that the condition is dynamically applied
    AnyObjectPatch anyPatch = new AnyObjectPatch();
    anyPatch.setKey(newAny.getKey());
    anyPatch.getPlainAttrs().add(new AttrPatch.Builder().operation(PatchOperation.DELETE).attrTO(new AttrTO.Builder().schema("location").build()).build());
    newAny = updateAnyObject(anyPatch).getEntity();
    assertFalse(newAny.getPlainAttr("location").isPresent());
    memberships = anyObjectService.read("fc6dbc3a-6c07-4965-8781-921e7401a4a5").getDynMemberships();
    assertFalse(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
    memberships = anyObjectService.read("8559d14d-58c2-46eb-a2d4-a7d35161e8f8").getDynMemberships();
    assertFalse(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
    memberships = anyObjectService.read(newAny.getKey()).getDynMemberships();
    assertTrue(memberships.stream().anyMatch(m -> m.getGroupKey().equals(groupKey)));
}
Also used : StringPatchItem(org.apache.syncope.common.lib.patch.StringPatchItem) ProvisionTO(org.apache.syncope.common.lib.to.ProvisionTO) SyncopeClientException(org.apache.syncope.common.lib.SyncopeClientException) NamingException(javax.naming.NamingException) ProvisioningResult(org.apache.syncope.common.lib.to.ProvisioningResult) ConnObjectTO(org.apache.syncope.common.lib.to.ConnObjectTO) ResourceDeassociationAction(org.apache.syncope.common.lib.types.ResourceDeassociationAction) AnyTypeKind(org.apache.syncope.common.lib.types.AnyTypeKind) GroupPatch(org.apache.syncope.common.lib.patch.GroupPatch) SchedTaskTO(org.apache.syncope.common.lib.to.SchedTaskTO) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) AttrSchemaType(org.apache.syncope.common.lib.types.AttrSchemaType) Map(java.util.Map) PagedResult(org.apache.syncope.common.lib.to.PagedResult) ExecTO(org.apache.syncope.common.lib.to.ExecTO) BulkActionResult(org.apache.syncope.common.lib.to.BulkActionResult) MappingTO(org.apache.syncope.common.lib.to.MappingTO) SchemaType(org.apache.syncope.common.lib.types.SchemaType) UUID(java.util.UUID) GroupTO(org.apache.syncope.common.lib.to.GroupTO) GenericType(javax.ws.rs.core.GenericType) Test(org.junit.jupiter.api.Test) DerSchemaTO(org.apache.syncope.common.lib.to.DerSchemaTO) List(java.util.List) AttrPatch(org.apache.syncope.common.lib.patch.AttrPatch) TypeExtensionTO(org.apache.syncope.common.lib.to.TypeExtensionTO) Response(javax.ws.rs.core.Response) DeassociationPatch(org.apache.syncope.common.lib.patch.DeassociationPatch) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) AccessControlException(java.security.AccessControlException) NamingEnumeration(javax.naming.NamingEnumeration) TaskJob(org.apache.syncope.core.provisioning.java.job.TaskJob) SearchResult(javax.naming.directory.SearchResult) Assertions.fail(org.junit.jupiter.api.Assertions.fail) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) AnonymousAuthenticationHandler(org.apache.syncope.client.lib.AnonymousAuthenticationHandler) PropagationTaskExecStatus(org.apache.syncope.common.lib.types.PropagationTaskExecStatus) AttrTO(org.apache.syncope.common.lib.to.AttrTO) GroupService(org.apache.syncope.common.rest.api.service.GroupService) SyncopeService(org.apache.syncope.common.rest.api.service.SyncopeService) BulkMembersActionType(org.apache.syncope.common.lib.types.BulkMembersActionType) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) EntityTOUtils(org.apache.syncope.common.lib.EntityTOUtils) AnyObjectPatch(org.apache.syncope.common.lib.patch.AnyObjectPatch) SerializationUtils(org.apache.commons.lang3.SerializationUtils) SearchControls(javax.naming.directory.SearchControls) PlainSchemaTO(org.apache.syncope.common.lib.to.PlainSchemaTO) AssociationPatch(org.apache.syncope.common.lib.patch.AssociationPatch) ItemTO(org.apache.syncope.common.lib.to.ItemTO) PropagationStatus(org.apache.syncope.common.lib.to.PropagationStatus) ClientExceptionType(org.apache.syncope.common.lib.types.ClientExceptionType) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) AbstractITCase(org.apache.syncope.fit.AbstractITCase) AnyQuery(org.apache.syncope.common.rest.api.beans.AnyQuery) MembershipTO(org.apache.syncope.common.lib.to.MembershipTO) AnyTypeClassTO(org.apache.syncope.common.lib.to.AnyTypeClassTO) SyncopeConstants(org.apache.syncope.common.lib.SyncopeConstants) ForbiddenException(javax.ws.rs.ForbiddenException) ResourceTO(org.apache.syncope.common.lib.to.ResourceTO) ResourceAssociationAction(org.apache.syncope.common.lib.types.ResourceAssociationAction) DirContext(javax.naming.directory.DirContext) AnyTypeTO(org.apache.syncope.common.lib.to.AnyTypeTO) MappingPurpose(org.apache.syncope.common.lib.types.MappingPurpose) ConnectorCapability(org.apache.syncope.common.lib.types.ConnectorCapability) PatchOperation(org.apache.syncope.common.lib.types.PatchOperation) StringReplacePatchItem(org.apache.syncope.common.lib.patch.StringReplacePatchItem) ConnInstanceTO(org.apache.syncope.common.lib.to.ConnInstanceTO) SyncopeClient(org.apache.syncope.client.lib.SyncopeClient) UserTO(org.apache.syncope.common.lib.to.UserTO) Collections(java.util.Collections) AnyOperations(org.apache.syncope.common.lib.AnyOperations) AnyObjectTO(org.apache.syncope.common.lib.to.AnyObjectTO) TaskType(org.apache.syncope.common.lib.types.TaskType) AnyObjectTO(org.apache.syncope.common.lib.to.AnyObjectTO) MembershipTO(org.apache.syncope.common.lib.to.MembershipTO) AttrTO(org.apache.syncope.common.lib.to.AttrTO) AnyObjectPatch(org.apache.syncope.common.lib.patch.AnyObjectPatch) GroupPatch(org.apache.syncope.common.lib.patch.GroupPatch) GroupTO(org.apache.syncope.common.lib.to.GroupTO) Test(org.junit.jupiter.api.Test)

Example 28 with AttrTO

use of org.apache.syncope.common.lib.to.AttrTO in project syncope by apache.

the class BaseUserSelfResource method millisToDate.

protected void millisToDate(final Set<AttrTO> attrs, final PlainSchemaTO plainSchema) throws IllegalArgumentException {
    final FastDateFormat fmt = FastDateFormat.getInstance(plainSchema.getConversionPattern());
    attrs.stream().filter(attr -> (attr.getSchema().equals(plainSchema.getKey()))).forEachOrdered(attr -> {
        for (ListIterator<String> itor = attr.getValues().listIterator(); itor.hasNext(); ) {
            String value = itor.next();
            try {
                itor.set(fmt.format(Long.valueOf(value)));
            } catch (NumberFormatException ex) {
                LOG.error("Invalid format value for {}", value);
            }
        }
    });
}
Also used : PlainSchemaTO(org.apache.syncope.common.lib.to.PlainSchemaTO) ListIterator(java.util.ListIterator) AttrTO(org.apache.syncope.common.lib.to.AttrTO) Set(java.util.Set) IOException(java.io.IOException) ParseException(java.text.ParseException) StandardCharsets(java.nio.charset.StandardCharsets) FastDateFormat(org.apache.commons.lang3.time.FastDateFormat) FastDateFormat(org.apache.commons.lang3.time.FastDateFormat)

Example 29 with AttrTO

use of org.apache.syncope.common.lib.to.AttrTO in project syncope by apache.

the class UserRequestValidatorTest method testCompliant.

@Test
public void testCompliant() throws IOException {
    UserTO userTO = new UserTO();
    // plain
    AttrTO firstname = attrTO("firstname", "defaultFirstname");
    AttrTO surname = attrTO("surname", "surnameValue");
    AttrTO additionalCtype = attrTO("additional#ctype", "ctypeValue");
    AttrTO notAllowed = attrTO("not_allowed", "notAllowedValue");
    userTO.getPlainAttrs().addAll(Arrays.asList(firstname, surname, notAllowed, additionalCtype));
    Map<String, CustomAttributesInfo> customForm = new ObjectMapper().readValue(new ClassPathResource("customForm.json").getFile(), new TypeReference<HashMap<String, CustomAttributesInfo>>() {
    });
    // not allowed because of presence of notAllowed attribute
    assertFalse(UserRequestValidator.compliant(userTO, customForm, true));
    // remove notAllowed attribute and make it compliant
    userTO.getPlainAttrs().remove(notAllowed);
    assertTrue(UserRequestValidator.compliant(userTO, customForm, true));
    // firstname must have only one defaultValue
    userTO.getPlainAttr("firstname").get().getValues().add("notAllowedFirstnameValue");
    assertFalse(UserRequestValidator.compliant(userTO, customForm, true));
    assertTrue(UserRequestValidator.compliant(userTO, customForm, false));
    // clean
    userTO.getPlainAttr("firstname").get().getValues().remove("notAllowedFirstnameValue");
    // derived must not be present
    AttrTO derivedNotAllowed = attrTO("derivedNotAllowed");
    userTO.getDerAttrs().add(derivedNotAllowed);
    assertFalse(UserRequestValidator.compliant(userTO, customForm, true));
    // clean
    userTO.getDerAttrs().clear();
    // virtual
    AttrTO virtualdata = attrTO("virtualdata", "defaultVirtualData");
    userTO.getVirAttrs().add(virtualdata);
    assertTrue(UserRequestValidator.compliant(userTO, customForm, true));
    // with empty form is compliant by definition
    assertTrue(UserRequestValidator.compliant(userTO, new HashMap<>(), true));
}
Also used : HashMap(java.util.HashMap) UserTO(org.apache.syncope.common.lib.to.UserTO) AttrTO(org.apache.syncope.common.lib.to.AttrTO) CustomAttributesInfo(org.apache.syncope.client.enduser.model.CustomAttributesInfo) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) ClassPathResource(org.springframework.core.io.ClassPathResource) Test(org.junit.jupiter.api.Test)

Example 30 with AttrTO

use of org.apache.syncope.common.lib.to.AttrTO in project syncope by apache.

the class PropagationManagerImpl method createTasks.

/**
 * Create propagation tasks.
 *
 * @param any to be provisioned
 * @param password clear text password to be provisioned
 * @param changePwd whether password should be included for propagation attributes or not
 * @param enable whether user must be enabled or not
 * @param deleteOnResource whether any must be deleted anyway from external resource or not
 * @param propByRes operation to be performed per resource
 * @param vAttrs virtual attributes to be set
 * @return list of propagation tasks created
 */
protected List<PropagationTaskTO> createTasks(final Any<?> any, final String password, final boolean changePwd, final Boolean enable, final boolean deleteOnResource, final PropagationByResource propByRes, final Collection<AttrTO> vAttrs) {
    LOG.debug("Provisioning {}:\n{}", any, propByRes);
    // Avoid duplicates - see javadoc
    propByRes.purge();
    LOG.debug("After purge {}:\n{}", any, propByRes);
    // Virtual attributes
    Set<String> virtualResources = new HashSet<>();
    virtualResources.addAll(propByRes.get(ResourceOperation.CREATE));
    virtualResources.addAll(propByRes.get(ResourceOperation.UPDATE));
    virtualResources.addAll(dao(any.getType().getKind()).findAllResourceKeys(any.getKey()));
    Map<String, Set<Attribute>> vAttrMap = new HashMap<>();
    if (vAttrs != null) {
        vAttrs.forEach(vAttr -> {
            VirSchema schema = virSchemaDAO.find(vAttr.getSchema());
            if (schema == null) {
                LOG.warn("Ignoring invalid {} {}", VirSchema.class.getSimpleName(), vAttr.getSchema());
            } else if (schema.isReadonly()) {
                LOG.warn("Ignoring read-only {} {}", VirSchema.class.getSimpleName(), vAttr.getSchema());
            } else if (anyUtilsFactory.getInstance(any).getAllowedSchemas(any, VirSchema.class).contains(schema) && virtualResources.contains(schema.getProvision().getResource().getKey())) {
                Set<Attribute> values = vAttrMap.get(schema.getProvision().getResource().getKey());
                if (values == null) {
                    values = new HashSet<>();
                    vAttrMap.put(schema.getProvision().getResource().getKey(), values);
                }
                values.add(AttributeBuilder.build(schema.getExtAttrName(), vAttr.getValues()));
                propByRes.add(ResourceOperation.UPDATE, schema.getProvision().getResource().getKey());
            } else {
                LOG.warn("{} not owned by or {} not allowed for {}", schema.getProvision().getResource(), schema, any);
            }
        });
    }
    LOG.debug("With virtual attributes {}:\n{}\n{}", any, propByRes, vAttrMap);
    List<PropagationTaskTO> tasks = new ArrayList<>();
    propByRes.asMap().forEach((resourceKey, operation) -> {
        ExternalResource resource = resourceDAO.find(resourceKey);
        Provision provision = resource == null ? null : resource.getProvision(any.getType()).orElse(null);
        List<? extends Item> mappingItems = provision == null ? Collections.<Item>emptyList() : MappingUtils.getPropagationItems(provision.getMapping().getItems());
        if (resource == null) {
            LOG.error("Invalid resource name specified: {}, ignoring...", resourceKey);
        } else if (provision == null) {
            LOG.error("No provision specified on resource {} for type {}, ignoring...", resource, any.getType());
        } else if (mappingItems.isEmpty()) {
            LOG.warn("Requesting propagation for {} but no propagation mapping provided for {}", any.getType(), resource);
        } else {
            PropagationTaskTO task = new PropagationTaskTO();
            task.setResource(resource.getKey());
            task.setObjectClassName(provision.getObjectClass().getObjectClassValue());
            task.setAnyTypeKind(any.getType().getKind());
            task.setAnyType(any.getType().getKey());
            if (!deleteOnResource) {
                task.setEntityKey(any.getKey());
            }
            task.setOperation(operation);
            task.setOldConnObjectKey(propByRes.getOldConnObjectKey(resource.getKey()));
            Pair<String, Set<Attribute>> preparedAttrs = mappingManager.prepareAttrs(any, password, changePwd, enable, provision);
            task.setConnObjectKey(preparedAttrs.getKey());
            // Check if any of mandatory attributes (in the mapping) is missing or not received any value:
            // if so, add special attributes that will be evaluated by PropagationTaskExecutor
            List<String> mandatoryMissing = new ArrayList<>();
            List<String> mandatoryNullOrEmpty = new ArrayList<>();
            mappingItems.stream().filter(item -> (!item.isConnObjectKey() && JexlUtils.evaluateMandatoryCondition(item.getMandatoryCondition(), any))).forEachOrdered(item -> {
                Attribute attr = AttributeUtil.find(item.getExtAttrName(), preparedAttrs.getValue());
                if (attr == null) {
                    mandatoryMissing.add(item.getExtAttrName());
                } else if (attr.getValue() == null || attr.getValue().isEmpty()) {
                    mandatoryNullOrEmpty.add(item.getExtAttrName());
                }
            });
            if (!mandatoryMissing.isEmpty()) {
                preparedAttrs.getValue().add(AttributeBuilder.build(PropagationTaskExecutor.MANDATORY_MISSING_ATTR_NAME, mandatoryMissing));
            }
            if (!mandatoryNullOrEmpty.isEmpty()) {
                preparedAttrs.getValue().add(AttributeBuilder.build(PropagationTaskExecutor.MANDATORY_NULL_OR_EMPTY_ATTR_NAME, mandatoryNullOrEmpty));
            }
            if (vAttrMap.containsKey(resource.getKey())) {
                preparedAttrs.getValue().addAll(vAttrMap.get(resource.getKey()));
            }
            task.setAttributes(POJOHelper.serialize(preparedAttrs.getValue()));
            tasks.add(task);
            LOG.debug("PropagationTask created: {}", task);
        }
    });
    return tasks;
}
Also used : Provision(org.apache.syncope.core.persistence.api.entity.resource.Provision) PropagationManager(org.apache.syncope.core.provisioning.api.propagation.PropagationManager) POJOHelper(org.apache.syncope.core.provisioning.api.serialization.POJOHelper) AttrTO(org.apache.syncope.common.lib.to.AttrTO) AnyUtilsFactory(org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory) Realm(org.apache.syncope.core.persistence.api.entity.Realm) LoggerFactory(org.slf4j.LoggerFactory) Autowired(org.springframework.beans.factory.annotation.Autowired) HashMap(java.util.HashMap) UserPatch(org.apache.syncope.common.lib.patch.UserPatch) ResourceOperation(org.apache.syncope.common.lib.types.ResourceOperation) WorkflowResult(org.apache.syncope.core.provisioning.api.WorkflowResult) StringUtils(org.apache.commons.lang3.StringUtils) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) AnyTypeKind(org.apache.syncope.common.lib.types.AnyTypeKind) JexlUtils(org.apache.syncope.core.provisioning.java.jexl.JexlUtils) Attribute(org.identityconnectors.framework.common.objects.Attribute) PropagationTaskTO(org.apache.syncope.common.lib.to.PropagationTaskTO) GroupDAO(org.apache.syncope.core.persistence.api.dao.GroupDAO) Pair(org.apache.commons.lang3.tuple.Pair) AnyObjectDAO(org.apache.syncope.core.persistence.api.dao.AnyObjectDAO) ConnObjectUtils(org.apache.syncope.core.provisioning.java.utils.ConnObjectUtils) MappingManager(org.apache.syncope.core.provisioning.api.MappingManager) Map(java.util.Map) PropagationByResource(org.apache.syncope.core.provisioning.api.PropagationByResource) Item(org.apache.syncope.core.persistence.api.entity.resource.Item) OrgUnit(org.apache.syncope.core.persistence.api.entity.resource.OrgUnit) Logger(org.slf4j.Logger) UserDAO(org.apache.syncope.core.persistence.api.dao.UserDAO) Collection(java.util.Collection) Set(java.util.Set) Collectors(java.util.stream.Collectors) VirSchema(org.apache.syncope.core.persistence.api.entity.VirSchema) MappingUtils(org.apache.syncope.core.provisioning.java.utils.MappingUtils) EntityFactory(org.apache.syncope.core.persistence.api.entity.EntityFactory) ExternalResource(org.apache.syncope.core.persistence.api.entity.resource.ExternalResource) List(java.util.List) Provision(org.apache.syncope.core.persistence.api.entity.resource.Provision) AttributeUtil(org.identityconnectors.framework.common.objects.AttributeUtil) AttributeBuilder(org.identityconnectors.framework.common.objects.AttributeBuilder) AnyDAO(org.apache.syncope.core.persistence.api.dao.AnyDAO) PropagationTaskExecutor(org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor) VirSchemaDAO(org.apache.syncope.core.persistence.api.dao.VirSchemaDAO) Collections(java.util.Collections) ExternalResourceDAO(org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO) Any(org.apache.syncope.core.persistence.api.entity.Any) Transactional(org.springframework.transaction.annotation.Transactional) HashSet(java.util.HashSet) Set(java.util.Set) PropagationTaskTO(org.apache.syncope.common.lib.to.PropagationTaskTO) HashMap(java.util.HashMap) VirSchema(org.apache.syncope.core.persistence.api.entity.VirSchema) Attribute(org.identityconnectors.framework.common.objects.Attribute) ArrayList(java.util.ArrayList) ExternalResource(org.apache.syncope.core.persistence.api.entity.resource.ExternalResource) HashSet(java.util.HashSet)

Aggregations

AttrTO (org.apache.syncope.common.lib.to.AttrTO)70 Test (org.junit.jupiter.api.Test)31 UserTO (org.apache.syncope.common.lib.to.UserTO)30 MembershipTO (org.apache.syncope.common.lib.to.MembershipTO)19 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)17 Map (java.util.Map)15 GroupTO (org.apache.syncope.common.lib.to.GroupTO)15 ArrayList (java.util.ArrayList)14 UserPatch (org.apache.syncope.common.lib.patch.UserPatch)14 List (java.util.List)13 Collections (java.util.Collections)11 StringUtils (org.apache.commons.lang3.StringUtils)11 AnyTO (org.apache.syncope.common.lib.to.AnyTO)10 Optional (java.util.Optional)9 Set (java.util.Set)9 Autowired (org.springframework.beans.factory.annotation.Autowired)9 HashMap (java.util.HashMap)8 Collectors (java.util.stream.Collectors)8 EntityTOUtils (org.apache.syncope.common.lib.EntityTOUtils)8 AnyObjectTO (org.apache.syncope.common.lib.to.AnyObjectTO)8