public boolean isNamedRelationshipsSupported() { // If there is any IdentityStore that supports named relationships... for (IdentityStore identityStore : getIdentityStoreMappings().values()) { if (identityStore.getSupportedFeatures().isNamedRelationshipsSupported()) { return true; } } return defaultIdentityStore.getSupportedFeatures().isNamedRelationshipsSupported(); }
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObjectSearchCriteria criteria) throws IdentityException, OperationNotSupportedException { Set<String> results = new HashSet<String>(); // For any IdentityStore that supports named relationships... for (IdentityStore identityStore : configuredIdentityStores) { if (identityStore.getSupportedFeatures().isNamedRelationshipsSupported()) { IdentityStoreInvocationContext storeCtx = resolveInvocationContext(identityStore, ctx); results.addAll(identityStore.getRelationshipNames(storeCtx, criteria)); } } return results; }
public Map<String, String> getRelationshipNameProperties(IdentityStoreInvocationContext ctx, String name) throws IdentityException, OperationNotSupportedException { Map<String, String> results = new HashMap<String, String>(); // For any IdentityStore that supports named relationships... for (IdentityStore identityStore : configuredIdentityStores) { if (identityStore.getSupportedFeatures().isNamedRelationshipsSupported()) { IdentityStoreInvocationContext storeCtx = resolveInvocationContext(identityStore, ctx); Map<String, String> props = identityStore.getRelationshipNameProperties(storeCtx, name); if (props != null && props.keySet().size() > 0) { results.putAll(props); } } } return results; }
public void removeRelationshipNameProperties(IdentityStoreInvocationContext ctx, String name, Set<String> properties) throws IdentityException, OperationNotSupportedException { // For any IdentityStore that supports named relationships... for (IdentityStore identityStore : configuredIdentityStores) { if (identityStore.getSupportedFeatures().isNamedRelationshipsSupported()) { IdentityStoreInvocationContext storeCtx = resolveInvocationContext(identityStore, ctx); identityStore.removeRelationshipNameProperties(storeCtx, name, properties); } } }
public void setRelationshipNameProperties(IdentityStoreInvocationContext ctx, String name, Map<String, String> properties) throws IdentityException, OperationNotSupportedException { // For any IdentityStore that supports named relationships... for (IdentityStore identityStore : configuredIdentityStores) { if (identityStore.getSupportedFeatures().isNamedRelationshipsSupported()) { IdentityStoreInvocationContext storeCtx = resolveInvocationContext(identityStore, ctx); identityStore.setRelationshipNameProperties(storeCtx, name, properties); } } }
public boolean isRoleNameSearchCriteriaTypeSupported(IdentityObjectSearchCriteriaType constraint) { // If there is any IdentityStore that supports named relationships... for (IdentityStore identityStore : getIdentityStoreMappings().values()) { if (identityStore.getSupportedFeatures().isNamedRelationshipsSupported() && identityStore.getSupportedFeatures().isRoleNameSearchCriteriaTypeSupported(constraint)) { return true; } } return defaultIdentityStore.getSupportedFeatures().isNamedRelationshipsSupported() && defaultIdentityStore.getSupportedFeatures().isRoleNameSearchCriteriaTypeSupported(constraint); }
public String createRelationshipName(IdentityStoreInvocationContext ctx, String name) throws IdentityException, OperationNotSupportedException { // For any IdentityStore that supports named relationships... for (IdentityStore identityStore : configuredIdentityStores) { if (identityStore.getSupportedFeatures().isNamedRelationshipsSupported()) { IdentityStoreInvocationContext storeCtx = resolveInvocationContext(identityStore, ctx); identityStore.createRelationshipName(storeCtx, name); } } return name; }
public String removeRelationshipName(IdentityStoreInvocationContext ctx, String name) throws IdentityException, OperationNotSupportedException { // For any IdentityStore that supports named relationships... for (IdentityStore identityStore : configuredIdentityStores) { if (identityStore.getSupportedFeatures().isNamedRelationshipsSupported()) { IdentityStoreInvocationContext storeCtx = resolveInvocationContext(identityStore, ctx); identityStore.removeRelationshipName(storeCtx, name); } } return name; }
public Set<IdentityObjectRelationship> resolveRelationships(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectRelationshipType relationshipType, boolean parent, boolean named, String name) throws IdentityException { Set<IdentityObjectRelationship> relationships = new HashSet<IdentityObjectRelationship>(); // For any IdentityStore that supports named relationships... for (IdentityStore identityStore : configuredIdentityStores) { if (!identityStore.getSupportedFeatures().getSupportedRelationshipTypes().contains(relationshipType.getName())) { continue; } if (!named || (named && identityStore.getSupportedFeatures().isNamedRelationshipsSupported())) { IdentityStoreInvocationContext storeCtx = resolveInvocationContext(identityStore, ctx); relationships.addAll(identityStore.resolveRelationships(storeCtx, identity, relationshipType, parent, named, name)); } } return relationships; }
public RoleManager getRoleManager() throws FeatureNotSupportedException { if (!getSessionContext().getIdentityStoreRepository().getSupportedFeatures().isNamedRelationshipsSupported()) { throw new FeatureNotSupportedException("Role management not supported by underlaying configured identity stores"); } return roleManager; }
public RoleQueryBuilder createRoleQueryBuilder() throws FeatureNotSupportedException { if (!getSessionContext().getIdentityStoreRepository().getSupportedFeatures().isNamedRelationshipsSupported()) { throw new FeatureNotSupportedException("Role management not supported by underlaying configured identity stores"); } return new RoleQueryBuilderImpl(); }
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectSearchCriteria criteria) throws IdentityException, OperationNotSupportedException { IdentityStore toStore = resolveIdentityStore(identity); IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, ctx); if (toStore.getSupportedFeatures().isNamedRelationshipsSupported()) { return toStore.getRelationshipNames(targetCtx, identity, criteria); } IdentityStoreInvocationContext defaultCtx = resolveInvocationContext(defaultIdentityStore, ctx); return defaultIdentityStore.getRelationshipNames(defaultCtx, identity, criteria); }
public Map<String, String> getRelationshipProperties(IdentityStoreInvocationContext ctx, IdentityObjectRelationship relationship) throws IdentityException, OperationNotSupportedException { IdentityStore fromStore = resolveIdentityStore(relationship.getFromIdentityObject()); IdentityStore toStore = resolveIdentityStore(relationship.getToIdentityObject()); if (fromStore == toStore && toStore.getSupportedFeatures().isNamedRelationshipsSupported()) { return fromStore.getRelationshipProperties(resolveInvocationContext(fromStore, ctx), relationship); } return defaultIdentityStore.getRelationshipProperties(resolveInvocationContext(defaultIdentityStore, ctx), relationship); }
public void setRelationshipProperties(IdentityStoreInvocationContext ctx, IdentityObjectRelationship relationship, Map<String, String> properties) throws IdentityException, OperationNotSupportedException { IdentityStore fromStore = resolveIdentityStore(relationship.getFromIdentityObject()); IdentityStore toStore = resolveIdentityStore(relationship.getToIdentityObject()); if (fromStore == toStore && toStore.getSupportedFeatures().isNamedRelationshipsSupported()) { fromStore.setRelationshipProperties(resolveInvocationContext(fromStore, ctx), relationship, properties); return; } defaultIdentityStore.setRelationshipProperties(resolveInvocationContext(defaultIdentityStore, ctx), relationship, properties); }
public void removeRelationshipProperties(IdentityStoreInvocationContext ctx, IdentityObjectRelationship relationship, Set<String> properties) throws IdentityException, OperationNotSupportedException { IdentityStore fromStore = resolveIdentityStore(relationship.getFromIdentityObject()); IdentityStore toStore = resolveIdentityStore(relationship.getToIdentityObject()); if (fromStore == toStore && toStore.getSupportedFeatures().isNamedRelationshipsSupported()) { fromStore.removeRelationshipProperties(resolveInvocationContext(fromStore, ctx), relationship, properties); return; } defaultIdentityStore.removeRelationshipProperties(resolveInvocationContext(defaultIdentityStore, ctx), relationship, properties); }
mappedStore.getSupportedFeatures().isNamedRelationshipsSupported())
public Set<IdentityObjectRelationship> resolveRelationships(IdentityStoreInvocationContext invocationCxt, IdentityObject fromIdentity, IdentityObject toIdentity, IdentityObjectRelationshipType relationshipType) throws IdentityException { IdentityStore fromStore = resolveIdentityStore(fromIdentity); IdentityStore toStore = resolveIdentityStore(toIdentity); IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore, invocationCxt); IdentityStoreInvocationContext defaultTargetCtx = resolveInvocationContext(defaultIdentityStore, invocationCxt); if (fromStore == toStore && (!RoleManagerImpl.ROLE.getName().equals(relationshipType.getName()) || fromStore.getSupportedFeatures().isNamedRelationshipsSupported())) { return fromStore.resolveRelationships(toTargetCtx, fromIdentity, toIdentity, relationshipType); } if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, fromIdentity)) { defaultIdentityStore.createIdentityObject(defaultTargetCtx, fromIdentity.getName(), fromIdentity.getIdentityType()); } if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, toIdentity)) { defaultIdentityStore.createIdentityObject(defaultTargetCtx, toIdentity.getName(), toIdentity.getIdentityType()); } return defaultIdentityStore.resolveRelationships(defaultTargetCtx, fromIdentity, toIdentity, relationshipType); }
public void removeRelationship(IdentityStoreInvocationContext invocationCxt, IdentityObject fromIdentity, IdentityObject toIdentity, IdentityObjectRelationshipType relationshipType, String relationshipName) throws IdentityException { IdentityStore fromStore = resolveIdentityStore(fromIdentity); IdentityStore toStore = resolveIdentityStore(toIdentity); IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore, invocationCxt); IdentityStoreInvocationContext defaultTargetCtx = resolveInvocationContext(defaultIdentityStore, invocationCxt); if (fromStore == toStore) { if (relationshipName == null || (relationshipName != null && fromStore.getSupportedFeatures().isNamedRelationshipsSupported())) { fromStore.removeRelationship(toTargetCtx, fromIdentity, toIdentity, relationshipType, relationshipName); return; } } if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, fromIdentity)) { defaultIdentityStore.createIdentityObject(defaultTargetCtx, fromIdentity.getName(), fromIdentity.getIdentityType()); } if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, toIdentity)) { defaultIdentityStore.createIdentityObject(defaultTargetCtx, toIdentity.getName(), toIdentity.getIdentityType()); } defaultIdentityStore.removeRelationship(defaultTargetCtx, fromIdentity, toIdentity, relationshipType, relationshipName); }
public IdentityObjectRelationship createRelationship(IdentityStoreInvocationContext invocationCxt, IdentityObject fromIdentity, IdentityObject toIdentity, IdentityObjectRelationshipType relationshipType, String relationshipName, boolean createNames) throws IdentityException { IdentityStore fromStore = resolveIdentityStore(fromIdentity); IdentityStore toStore = resolveIdentityStore(toIdentity); IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore, invocationCxt); IdentityStoreInvocationContext defaultTargetCtx = resolveInvocationContext(defaultIdentityStore, invocationCxt); if (fromStore == toStore) { // If relationship is named and target store doesn't support named relationships it need to be put in default store anyway if (relationshipName == null || (relationshipName != null && fromStore.getSupportedFeatures().isNamedRelationshipsSupported())) { return fromStore.createRelationship(toTargetCtx, fromIdentity, toIdentity, relationshipType, relationshipName, createNames); } } if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, fromIdentity)) { defaultIdentityStore.createIdentityObject(defaultTargetCtx, fromIdentity.getName(), fromIdentity.getIdentityType()); } if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, toIdentity)) { defaultIdentityStore.createIdentityObject(defaultTargetCtx, toIdentity.getName(), toIdentity.getIdentityType()); } return defaultIdentityStore.createRelationship(defaultTargetCtx, fromIdentity, toIdentity, relationshipType, relationshipName, createNames); }