public IdentityObject createIdentityObject(IdentityStoreInvocationContext invocationCtx, String name, IdentityObjectType identityObjectType, Map<String, String[]> attributes) throws IdentityException { return defaultIdentityStore.createIdentityObject(resolveIdentityStoreInvocationContext(invocationCtx), name, identityObjectType, attributes); }
public IdentityObject createIdentityObject(IdentityStoreInvocationContext invocationCtx, String name, IdentityObjectType identityObjectType) throws IdentityException { IdentityStore targetStore = resolveIdentityStore(identityObjectType); IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore, invocationCtx); return targetStore.createIdentityObject(targetCtx, name, identityObjectType); }
public IdentityObject createIdentityObject(IdentityStoreInvocationContext invocationCtx, String name, IdentityObjectType identityObjectType, Map<String, String[]> attributes) throws IdentityException { IdentityStore targetStore = resolveIdentityStore(identityObjectType); IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore, invocationCtx); return targetStore.createIdentityObject(targetCtx, name, identityObjectType, attributes); }
public IdentityObject createIdentityObject(IdentityStoreInvocationContext invocationCtx, String name, IdentityObjectType identityObjectType) throws IdentityException { IdentityObject io = identityStore.createIdentityObject(invocationCtx, name, identityObjectType); if (io != null) { //should also invalidate IO searches cache - searches/type - clear all children cacheSupport.invalidateCachedIdentityObjectSearches(io); cacheSupport.invalidateCachedIdentityObjectCount(identityObjectType); cacheSupport.putIntoCache(io); } return io; }
public IdentityObject createIdentityObject(IdentityStoreInvocationContext invocationCtx, String name, IdentityObjectType identityObjectType, Map<String, String[]> attributes) throws IdentityException { IdentityObject io = identityStore.createIdentityObject(invocationCtx, name, identityObjectType, attributes); if (io != null) { //should also invalidate IO searches cache - searches/type - clear all children cacheSupport.invalidateCachedIdentityObjectSearches(io); //grab profile - because IS can add extra attributes we canno rely only on attributes passed cacheSupport.putIntoCache(io, identityStore.getAttributes(invocationCtx, io)); } return io; }
public void removeRelationships(IdentityStoreInvocationContext invocationCtx, IdentityObject identity1, IdentityObject identity2, boolean named) throws IdentityException { IdentityStore fromStore = resolveIdentityStore(identity1); IdentityStore toStore = resolveIdentityStore(identity2); IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore, invocationCtx); IdentityStoreInvocationContext defaultTargetCtx = resolveInvocationContext(defaultIdentityStore, invocationCtx); if (fromStore == toStore) { fromStore.removeRelationships(toTargetCtx, identity1, identity2, named); return; } if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, identity1)) { defaultIdentityStore.createIdentityObject(defaultTargetCtx, identity1.getName(), identity1.getIdentityType()); } if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, identity2)) { defaultIdentityStore.createIdentityObject(defaultTargetCtx, identity2.getName(), identity2.getIdentityType()); } defaultIdentityStore.removeRelationships(defaultTargetCtx, identity1, identity2, named); }
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); }