@Override public <V extends Serializable> Attribute<V> getAttribute(IdentityContext context, AttributedType attributedType, String attributeName) { loadAttributes(context, attributedType); return attributedType.getAttribute(attributeName); }
protected FileAttribute(AttributedType identityType) { super(VERSION, Collections.synchronizedList(new ArrayList<Attribute<? extends Serializable>>(identityType .getAttributes()))); this.identityTypeId = identityType.getId(); }
@Override public void loadAttributes(IdentityContext context, AttributedType attributedType) { if (attributedType != null) { // We need to load the attributes from DB into attributedType AbstractJdbcType ajt = mapper.getInstance(attributedType.getClass()); ajt.setDataSource(dataSource); ajt.setId(attributedType.getId()); Collection<? extends Attribute> attributes = ajt.getAttributes(); if (attributes != null) { for (Attribute attribute : attributes) { attributedType.setAttribute(attribute); } } } }
@Override public void add(IdentityContext context, AttributedType attributedType) { attributedType.setId(context.getIdGenerator().generate()); if (IdentityType.class.isInstance(attributedType)) { IdentityType identityType = (IdentityType) attributedType; identityType.setPartition(context.getPartition()); if (isTraceEnabled()) { IDENTITY_STORE_LOGGER.tracef("Type with identifier [%s] belongs to partition [%s][%s]", attributedType.getId(), context.getPartition().getName(), context.getPartition()); } } addAttributedType(context, attributedType); if (isTraceEnabled()) { IDENTITY_STORE_LOGGER.tracef("Type with identifier [%s] successfully added to identity store [%s].", attributedType.getId(), this); } }
private Map<String, Serializable> getAttributes(AttributedType attributedType) { HashMap<String, Serializable> attributes = new HashMap<String, Serializable>(); for (Attribute attribute : attributedType.getAttributes()) { attributes.put(attribute.getName(), attribute.getValue()); } return attributes; } }
attributedType.setAttribute(new org.picketlink.idm.model.Attribute<String>(ENTRY_DN_ATTRIBUTE_NAME, entryDN)); attributedType.setId(this.operationManager.decodeEntryUUID(attributeValue)); } else { String attributeName = findAttributeName(mappingConfig.getMappedProperties(), ldapAttributeName); attributedType.setAttribute(new org.picketlink.idm.model.Attribute(attributeName, (Serializable) attributeValue));
@Override public void setValue(Object instance, String value) { if (!(instance instanceof AttributedType)) { throw new IllegalStateException("Instance [ " + instance + " ] not an instance of AttributedType"); } AttributedType attributedType = (AttributedType) instance; attributedType.setAttribute(new Attribute(bindingPropertyName, value)); }
@Override protected T doPopulateEntry(Map<String, Serializable> properties) throws Exception { T attributedType = doCreateInstance(properties); attributedType.setId(properties.get("id").toString()); for (Property<Serializable> property: getAttributedProperties(attributedType)) { Serializable value = properties.get(property.getName()); if (value != null) { property.setValue(attributedType, value); } } return attributedType; }
@Override public void add(IdentityContext context, AttributedType attributedType) { attributedType.setId(context.getIdGenerator().generate()); if (IdentityType.class.isInstance(attributedType)) { IdentityType identityType = (IdentityType) attributedType; identityType.setPartition(context.getPartition()); if (isTraceEnabled()) { IDENTITY_STORE_LOGGER.tracef("Type with identifier [%s] belongs to partition [%s][%s]", attributedType.getId(), context.getPartition().getName(), context.getPartition()); } } addAttributedType(context, attributedType); if (isTraceEnabled()) { IDENTITY_STORE_LOGGER.tracef("Type with identifier [%s] successfully added to identity store [%s].", attributedType.getId(), this); } }
private Map<String, Serializable> getAttributes(AttributedType attributedType) { HashMap<String, Serializable> attributes = new HashMap<String, Serializable>(); for (Attribute attribute : attributedType.getAttributes()) { attributes.put(attribute.getName(), attribute.getValue()); } return attributes; } }
attributedType.setAttribute(new org.picketlink.idm.model.Attribute<String>(ENTRY_DN_ATTRIBUTE_NAME, entryDN)); attributedType.setId(this.operationManager.decodeEntryUUID(attributeValue)); } else { String attributeName = findAttributeName(mappingConfig.getMappedProperties(), ldapAttributeName); attributedType.setAttribute(new org.picketlink.idm.model.Attribute(attributeName, (Serializable) attributeValue));
@Override public void setValue(Object instance, String value) { if (!(instance instanceof AttributedType)) { throw new IllegalStateException("Instance [ " + instance + " ] not an instance of AttributedType"); } AttributedType attributedType = (AttributedType) instance; attributedType.setAttribute(new Attribute(bindingPropertyName, value)); }
@Override protected T doPopulateEntry(Map<String, Serializable> properties) throws Exception { T attributedType = doCreateInstance(properties); attributedType.setId(properties.get("id").toString()); for (Property<Serializable> property: getAttributedProperties(attributedType)) { Serializable value = properties.get(property.getName()); if (value != null) { property.setValue(attributedType, value); } } return attributedType; }
public String getId() { return getEntry().getId(); }
@Override public void loadAttributes(IdentityContext context, AttributedType attributedType) { if (attributedType != null) { // We need to load the attributes from DB into attributedType AbstractJdbcType ajt = mapper.getInstance(attributedType.getClass()); ajt.setDataSource(dataSource); ajt.setId(attributedType.getId()); Collection<? extends Attribute> attributes = ajt.getAttributes(); if (attributes != null) { for (Attribute attribute : attributes) { attributedType.setAttribute(attribute); } } } }
protected FileAttribute(AttributedType identityType) { super(VERSION, Collections.synchronizedList(new ArrayList<Attribute<? extends Serializable>>(identityType .getAttributes()))); this.identityTypeId = identityType.getId(); }
private Map<String, Serializable> getAttributes(AttributedType attributedType) { HashMap<String, Serializable> attributes = new HashMap<String, Serializable>(); for (Attribute attribute : attributedType.getAttributes()) { attributes.put(attribute.getName(), attribute.getValue()); } return attributes; } }