public IdentityObject findIdentityObject(IdentityStoreInvocationContext invocationContext, String id) throws IdentityException { IdentityObjectSearchImpl search = new IdentityObjectSearchImpl(); search.setId(id); Collection<IdentityObject> results = cacheSupport.getIdentityObjectSearch(getCacheNS(invocationContext), search); if (results != null && results.size() == 1) { return results.iterator().next(); } IdentityObject io = identityStore.findIdentityObject(invocationContext, id); if (io != null) { Set<IdentityObject> temp = new HashSet<IdentityObject>(); temp.add(io); cacheSupport.putIdentityObjectSearch(getCacheNS(invocationContext), search, temp); } return io; }
public IdentityObject findIdentityObject(IdentityStoreInvocationContext invocationContext, String name, IdentityObjectType identityObjectType) throws IdentityException { IdentityObjectSearchImpl search = new IdentityObjectSearchImpl(); search.setName(name); if (identityObjectType != null) { search.setType(identityObjectType.getName()); } Collection<IdentityObject> results = cacheSupport.getIdentityObjectSearch(getCacheNS(invocationContext), search); if (results != null && results.size() == 1) { return results.iterator().next(); } IdentityObject io = identityStore.findIdentityObject(invocationContext, name, identityObjectType); if (io != null) { Set<IdentityObject> temp = new HashSet<IdentityObject>(); temp.add(io); cacheSupport.putIdentityObjectSearch(getCacheNS(invocationContext), search, temp); } return io; }
public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, IdentityObjectRelationshipType relationshipType, Collection<IdentityObjectType> excludes, boolean parent, IdentityObjectSearchCriteria criteria) throws IdentityException { IdentityObjectSearchImpl search = new IdentityObjectSearchImpl(); search.setIdentityObjectSearchCriteria(criteria); search.setParent(parent); if (relationshipType != null) { search.setRelationshipType(relationshipType.getName()); } if (identity != null) { search.setName(identity.getName()); search.setType(identity.getIdentityType().getName()); } Collection<IdentityObject> results = cacheSupport.getIdentityObjectSearch(getCacheNS(invocationCtx), search); if (results != null) { //TODO return results; } results = identityStore.findIdentityObject(invocationCtx, identity, relationshipType, parent, criteria); cacheSupport.putIdentityObjectSearch(getCacheNS(invocationCtx), search, results); return results; }