protected void addAttributes(IdentityContext identityContext, AttributedType identityType) { AttributeStore<?> attributeStore = getStoreSelector().getStoreForAttributeOperation(identityContext); if (attributeStore != null) { for (Attribute<? extends Serializable> attribute : getAttributes(identityContext, identityType).values()) { attributeStore.setAttribute(identityContext, identityType, attribute); } } }
protected void addAttributes(IdentityContext identityContext, AttributedType identityType) { AttributeStore<?> attributeStore = getStoreSelector().getStoreForAttributeOperation(identityContext); if (attributeStore != null) { for (Attribute<? extends Serializable> attribute : getAttributes(identityContext, identityType).values()) { attributeStore.setAttribute(identityContext, identityType, attribute); } } }
protected void removeAttributes(IdentityContext identityContext, AttributedType identityType, AttributedType storedType) { AttributeStore<?> attributeStore = getStoreSelector().getStoreForAttributeOperation(identityContext); if (attributeStore != null) { if (storedType != null) { Map<String, Attribute> attributes = getAttributes(identityContext, identityType); for (Attribute<? extends Serializable> attribute : storedType.getAttributes()) { if (attributes.get(attribute.getName()) == null) { attributeStore.removeAttribute(identityContext, identityType, attribute.getName()); } } } } }
protected void removeAttributes(IdentityContext identityContext, AttributedType identityType, AttributedType storedType) { AttributeStore<?> attributeStore = getStoreSelector().getStoreForAttributeOperation(identityContext); if (attributeStore != null) { if (storedType != null) { Map<String, Attribute> attributes = getAttributes(identityContext, identityType); for (Attribute<? extends Serializable> attribute : storedType.getAttributes()) { if (attributes.get(attribute.getName()) == null) { attributeStore.removeAttribute(identityContext, identityType, attribute.getName()); } } } } }