public boolean isIdentityObjectAddRemoveSupported(IdentityObjectType objectType) { if (readOnlyObjectTypes.contains(objectType.getName())) { return false; } return true; }
public boolean isIdentityObjectTypeSupported(IdentityObjectType identityObjectType) { if (supportedTypeNames.contains(identityObjectType.getName())) { return true; } return false; }
public Map<String, IdentityObjectAttributeMetaData> getAttributesMetaData(IdentityStoreInvocationContext invocationContext, IdentityObjectType identityType) { return attributesMetaData.get(identityType.getName()); }
public String getGroupType(IdentityObjectType identityObjectType) { if (identityObjectType == null) { throw new IllegalArgumentException("identityObjectType is null"); } return identityObjectType.getName(); }
public String getGroupType(IdentityObjectType identityObjectType) { if (identityObjectType == null) { throw new IllegalArgumentException("identityObjectType is null"); } return groupTypeMap.get(identityObjectType.getName()); }
public boolean isIdentity(IdentityObjectType identityObjectType) { if (identityObjectType == null) { throw new IllegalArgumentException("identityObjectType is null"); } if (identityObjectType.getName().equals(identityTypeName)) { return true; } return false; } }
public boolean isIdentity(IdentityObjectType identityObjectType) { if (identityObjectType == null) { throw new IllegalArgumentException("identityObjectType is null"); } if (identityObjectType.getName().equals(identityTypeName)) { return true; } return false; } }
public boolean isRelationshipTypeSupported(IdentityObjectType fromType, IdentityObjectType toType, IdentityObjectRelationshipType relationshipType) throws IdentityException { Map<String, Set<String>> mappings = supportedRelationshipMappings.get(relationshipType.getName()); if (mappings != null && mappings.containsKey(fromType.getName())) { if (mappings.get(fromType.getName()).contains(toType.getName())) { return true; } } return false; }
public Set<String> getSupportedAttributeNames(IdentityStoreInvocationContext ctx, IdentityObjectType identityType) throws IdentityException { checkIOType(identityType); if (attributeMappings.containsKey(identityType.getName())) { return attributeMappings.get(identityType.getName()); } return new HashSet<String>(); }
public boolean isCredentialSupported(IdentityObjectType identityObjectType, IdentityObjectCredentialType credentialType) { Set<String> types = supportedCredentials.get(identityObjectType.getName()); if (types != null && types.contains(credentialType.getName())) { return true; } return false; }
private String resolveAttributeNameFromStoreMapping(IdentityObjectType type, String mapping) { if (reverseAttributeMappings.containsKey(type.getName())) { Map<String, String> map = reverseAttributeMappings.get(type.getName()); if (map != null) { String name = map.containsKey(mapping) ? map.get(mapping) : mapping; return name; } } if (isAllowNotDefinedAttributes()) { return mapping; } return null; }
public boolean isGroupType(IdentityObjectType identityObjectType) { if (identityObjectType == null) { throw new IllegalArgumentException("identityObjectType is null"); } if (isIdentity(identityObjectType)) { return false; } if (groupTypeMap.containsKey(identityObjectType.getName())) { return true; } return false; }
public AttributeStore getAttributeStore(IdentityObjectType identityObjectType) throws IdentityException { AttributeStore store = attributeStoreMappings.get(identityObjectType.getName()); if (store == null) { String option = configurationContext.getRepositoryConfigurationMetaData().getOptionSingleValue(ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION); if (option != null && option.equalsIgnoreCase("true")) { return defaultIdentityStore; } else { throw new IdentityException("IdentityObjectType not mapped in the configuration: " + identityObjectType); } } return store; }
public IdentityStore getIdentityStore(IdentityObjectType identityObjectType) throws IdentityException { IdentityStore store = identityStoreMappings.get(identityObjectType.getName()); if (store == null) { String option = configurationContext.getRepositoryConfigurationMetaData().getOptionSingleValue(ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION); if (option != null && option.equalsIgnoreCase("true")) { return defaultIdentityStore; } else { throw new IdentityException("IdentityObjectType not mapped in the configuration: " + identityObjectType); } } return store; }
public Collection<Group> findAssociatedGroups(User user, IdentitySearchCriteria criteria) throws IdentityException { checkNotNullArgument(user, "User"); List<Group> identities = new LinkedList<Group>(); Collection<IdentityObject> ios = getRepository().findIdentityObject(getInvocationContext(), createIdentityObject(user), MEMBER, false, convertSearchControls(criteria)); String userTypeName = getUserObjectType().getName(); for (IdentityObject io : ios) { // Filter out users if (!io.getIdentityType().getName().equals(userTypeName)) identities.add(createGroup(io)); } return identities; }
@Override public String toString() { return "IdentityObject[id=" + getId() + "; name=" + getName() + "; type=" + getIdentityType().getName() + "]"; } }
public Collection<Group> findRelatedGroups(User user, String groupType, IdentitySearchCriteria criteria) throws IdentityException { checkNotNullArgument(user, "User"); List<Group> identities = new LinkedList<Group>(); Collection<IdentityObject> ios = getRepository().findIdentityObject(getInvocationContext(), createIdentityObject(user), null, false, convertSearchControls(criteria)); String userTypeName = getUserObjectType().getName(); for (IdentityObject io : ios) { // Filter out users if (!io.getIdentityType().getName().equals(userTypeName)) identities.add(createGroup(io)); } return identities; }
public Collection<Group> findAssociatedGroups(User user, String groupType, IdentitySearchCriteria criteria) throws IdentityException { checkNotNullArgument(user, "User"); //checkNotNullArgument(groupType, "Group type"); List<Group> identities = new LinkedList<Group>(); IdentityObjectType iot = groupType != null ? getIdentityObjectType(groupType) : null; Collection<IdentityObject> ios = getRepository().findIdentityObject(getInvocationContext(), createIdentityObject(user), MEMBER, false, convertSearchControls(criteria)); for (IdentityObject io : ios) { if (iot == null || io.getIdentityType().getName().equals(iot.getName())) { identities.add(createGroup(io)); } } return identities; }
public Collection<User> findRelatedUsers(Group group, IdentitySearchCriteria criteria) throws IdentityException { checkNotNullArgument(group, "Group"); List<User> identities = new LinkedList<User>(); Collection<IdentityObject> ios = getRepository().findIdentityObject(getInvocationContext(), createIdentityObject(group), null, true, convertSearchControls(criteria)); String userTypeName = getUserObjectType().getName(); for (IdentityObject io : ios) { if (io.getIdentityType().getName().equals(userTypeName)) { User user = createUser(io); if (!identities.contains(user)) { identities.add(createUser(io)); } } } return identities; }