public void addAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, IdentityObjectAttribute[] attributes) throws IdentityException { defaultAttributeStore.addAttributes(resolveAttributeStoreInvocationContext(invocationCtx), identity, attributes); }
public IdentityStoreSession createIdentityStoreSession() throws IdentityException { return attributeStore.createIdentityStoreSession(); }
public IdentityObject findIdentityObjectByUniqueAttribute(IdentityStoreInvocationContext invocationCtx, IdentityObjectType identityObjectType, IdentityObjectAttribute attribute) throws IdentityException { return attributeStore.findIdentityObjectByUniqueAttribute(invocationCtx, identityObjectType, attribute); }
public void updateAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, IdentityObjectAttribute[] attributes) throws IdentityException { attributeStore.updateAttributes(invocationCtx, identity, attributes); cacheSupport.removeAttributesFromCache(identity); if (reloadAttributesToCacheOnUpdate) { Map<String, IdentityObjectAttribute> results = attributeStore.getAttributes(invocationCtx, identity); if (results != null && results.size() > 0) { //TODO:FIXME // cacheSupport.putIntoCache(identity, results); } } else { // update attributes in node map directly } }
public IdentityStoreSession createIdentityStoreSession() throws IdentityException { Map<String, IdentityStoreSession> sessions = new HashMap<String, IdentityStoreSession>(); sessions.put(defaultAttributeStore.getId(), defaultAttributeStore.createIdentityStoreSession()); if (!sessions.containsKey(defaultIdentityStore.getId())) { sessions.put(defaultIdentityStore.getId(), defaultIdentityStore.createIdentityStoreSession()); } return new RepositoryIdentityStoreSessionImpl(sessions); }
public void addAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, IdentityObjectAttribute[] attributes) throws IdentityException { attributeStore.addAttributes(invocationCtx, identity, attributes); cacheSupport.removeAttributesFromCache(identity); if (reloadAttributesToCacheOnUpdate) { Map<String, IdentityObjectAttribute> results = attributeStore.getAttributes(invocationCtx, identity); if (results != null && results.size() > 0) { //TODO:FIXME // cacheSupport.putIntoCache(identity, results); } } else { // add attributes in node map directly } }
public void removeAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, String[] attributeNames) throws IdentityException { attributeStore.removeAttributes(invocationCtx, identity, attributeNames); cacheSupport.removeAttributesFromCache(identity); if (reloadAttributesToCacheOnUpdate) { Map<String, IdentityObjectAttribute> results = attributeStore.getAttributes(invocationCtx, identity); if (results != null && results.size() > 0) { cacheSupport.putIntoCache(identity, results); } } else { // remove attributes in node map directly } }
defaultAttributeStore.removeAttributes(defaultCtx, identity, leftAttrs.toArray(new String[leftAttrs.size()])); Set<String> supportedAttrs = defaultAttributeStore.getSupportedAttributeNames(defaultCtx, identity.getIdentityType()); for (String name : leftAttrs) defaultAttributeStore.removeAttributes(defaultCtx, identity, leftAttrs.toArray(new String[leftAttrs.size()]));
defaultAttributeStore.updateAttributes(defaultCtx, identity, attributesToAdd); Set<String> supportedAttrs = defaultAttributeStore.getSupportedAttributeNames(defaultCtx, identity.getIdentityType()); for (IdentityObjectAttribute entry : leftAttrs) defaultAttributeStore.updateAttributes(defaultCtx, identity, attributesToAdd);
defaultAttributeStore.addAttributes(defaultCtx, identity, attributesToAdd); Set<String> supportedAttrs = defaultAttributeStore.getSupportedAttributeNames(defaultCtx, identity.getIdentityType()); for (IdentityObjectAttribute entry : attributesToAdd) defaultAttributeStore.addAttributes(defaultCtx, identity, attributesToAdd);
public IdentityObject findIdentityObjectByUniqueAttribute(IdentityStoreInvocationContext invocationCtx, IdentityObjectType identityObjectType, IdentityObjectAttribute attribute) throws IdentityException { List<String> filteredAttrs = new LinkedList<String>(); List<String> leftAttrs = new LinkedList<String>(); IdentityStore toStore = resolveIdentityStore(identityObjectType); IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, invocationCtx); // Put supported attrs to the main store if (toStore != defaultAttributeStore) { Set<String> supportedAttrs = toStore.getSupportedAttributeNames(targetCtx, identityObjectType); if (supportedAttrs.contains(attribute.getName())) { return toStore.findIdentityObjectByUniqueAttribute(targetCtx, identityObjectType, attribute); } } IdentityStoreInvocationContext defaultCtx = resolveInvocationContext(defaultAttributeStore, invocationCtx); if (isAllowNotDefinedAttributes()) { defaultAttributeStore.findIdentityObjectByUniqueAttribute(defaultCtx, identityObjectType, attribute); } else { Set<String> supportedAttrs = defaultAttributeStore.getSupportedAttributeNames(defaultCtx, identityObjectType); if (supportedAttrs.contains(attribute.getName())) { return toStore.findIdentityObjectByUniqueAttribute(defaultCtx, identityObjectType, attribute); } } return null; }
@Override public String toString() { return "JBossCacheAttributeStoreWrapper (AttributeStore=" + attributeStore.getId() + ")"; }
public Set<String> getSupportedAttributeNames(IdentityStoreInvocationContext invocationContext, IdentityObjectType identityType) throws IdentityException { // Doesn't need to be cached return attributeStore.getSupportedAttributeNames(invocationContext, identityType); }
public Map<String, IdentityObjectAttributeMetaData> getAttributesMetaData(IdentityStoreInvocationContext invocationContext, IdentityObjectType identityType) { // Doesn't need to be cached return attributeStore.getAttributesMetaData(invocationContext, identityType); }
public IdentityObjectAttribute getAttribute(IdentityStoreInvocationContext invocationContext, IdentityObject identity, String name) throws IdentityException { return defaultAttributeStore.getAttribute(resolveAttributeStoreInvocationContext(invocationContext), identity, name); }
public Map<String, IdentityObjectAttribute> getAttributes(IdentityStoreInvocationContext invocationContext, IdentityObject identity) throws IdentityException { return defaultAttributeStore.getAttributes(resolveAttributeStoreInvocationContext(invocationContext), identity); }
public void updateAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, IdentityObjectAttribute[] attributes) throws IdentityException { defaultAttributeStore.updateAttributes(resolveAttributeStoreInvocationContext(invocationCtx), identity, attributes); }
public void removeAttributes(IdentityStoreInvocationContext invocationCtx, IdentityObject identity, String[] attributeNames) throws IdentityException { defaultAttributeStore.removeAttributes(resolveAttributeStoreInvocationContext(invocationCtx), identity, attributeNames); }
public IdentityStoreSession createIdentityStoreSession() throws IdentityException { Map<String, IdentityStoreSession> sessions = new HashMap<String, IdentityStoreSession>(); for (IdentityStore identityStore : identityStoreMappings.values()) { sessions.put(identityStore.getId(), identityStore.createIdentityStoreSession()); } for (AttributeStore attributeStore : attributeStoreMappings.values()) { if (!sessions.containsKey(attributeStore.getId())) { sessions.put(attributeStore.getId(), attributeStore.createIdentityStoreSession()); } } if (!sessions.containsKey(defaultAttributeStore.getId())) { sessions.put(defaultAttributeStore.getId(), defaultAttributeStore.createIdentityStoreSession()); } if (!sessions.containsKey(defaultIdentityStore.getId())) { sessions.put(defaultIdentityStore.getId(), defaultIdentityStore.createIdentityStoreSession()); } return new RepositoryIdentityStoreSessionImpl(sessions); }
public String getId() { return attributeStore.getId(); }