@Override protected IdentityType doPopulateEntry(Map<String, Serializable> properties) throws Exception { IdentityType identityType = super.doPopulateEntry(properties); String partitionType = properties.get("partitionType").toString(); String partitionId = properties.get("partitionId").toString(); Partition partition = (Partition) Class.forName(partitionType).getConstructor(new Class[]{String.class}).newInstance(""); partition.setId(partitionId); identityType.setPartition(partition); identityType.setCreatedDate((Date) properties.get("createdDate")); identityType.setExpirationDate((Date) properties.get("expirationDate")); identityType.setEnabled((Boolean) properties.get("enabled")); return identityType; }
@Override protected IdentityType doPopulateEntry(Map<String, Serializable> properties) throws Exception { IdentityType identityType = super.doPopulateEntry(properties); String partitionType = properties.get("partitionType").toString(); String partitionId = properties.get("partitionId").toString(); Partition partition = (Partition) Class.forName(partitionType).getConstructor(new Class[]{String.class}).newInstance(""); partition.setId(partitionId); identityType.setPartition(partition); identityType.setCreatedDate((Date) properties.get("createdDate")); identityType.setExpirationDate((Date) properties.get("expirationDate")); identityType.setEnabled((Boolean) properties.get("enabled")); return identityType; }
private void configurePartition(Partition partition, Object identity, IdentityType identityType) { if (getConfig().isModelPropertySet(PROPERTY_IDENTITY_PARTITION)) { // TODO implement cache support for partitions Object partitionInstance = getModelProperty(Object.class, identity, PROPERTY_IDENTITY_PARTITION); identityType.setPartition(convertPartitionEntityToPartition(partitionInstance)); } else { identityType.setPartition(partition); } }
@Override public void update(IdentityContext context, AttributedType attributedType) { if (IdentityType.class.isInstance(attributedType)) { IdentityType identityType = (IdentityType) attributedType; identityType.setPartition(context.getPartition()); } updateAttributedType(context, attributedType); if (isTraceEnabled()) { IDENTITY_STORE_LOGGER.tracef("Type with identifier [%s] successfully updated to identity store [%s].", attributedType.getId(), this); } }
@Override public void update(IdentityContext context, AttributedType attributedType) { if (IdentityType.class.isInstance(attributedType)) { IdentityType identityType = (IdentityType) attributedType; identityType.setPartition(context.getPartition()); } updateAttributedType(context, attributedType); if (isTraceEnabled()) { IDENTITY_STORE_LOGGER.tracef("Type with identifier [%s] successfully updated to identity store [%s].", attributedType.getId(), this); } }
@Override public void remove(IdentityContext context, AttributedType attributedType) { if (IdentityType.class.isInstance(attributedType)) { IdentityType identityType = (IdentityType) attributedType; identityType.setPartition(context.getPartition()); if (getConfig().supportsRelationship()) removeFromRelationships(context, identityType); if (Account.class.isInstance(identityType)) { removeCredentials(context, (Account) identityType); } } removeAttributedType(context, attributedType); if (isTraceEnabled()) { IDENTITY_STORE_LOGGER.tracef("Type with identifier [%s] successfully removed from identity store [%s].", attributedType.getId(), this); } }
@Override public void remove(IdentityContext context, AttributedType attributedType) { if (IdentityType.class.isInstance(attributedType)) { IdentityType identityType = (IdentityType) attributedType; identityType.setPartition(context.getPartition()); if (getConfig().supportsRelationship()) removeFromRelationships(context, identityType); if (Account.class.isInstance(identityType)) { removeCredentials(context, (Account) identityType); } } removeAttributedType(context, attributedType); if (isTraceEnabled()) { IDENTITY_STORE_LOGGER.tracef("Type with identifier [%s] successfully removed from identity store [%s].", attributedType.getId(), this); } }
IdentityType identityType = (IdentityType) attributedType; identityType.setPartition(context.getPartition()); clonedIdentityType.setPartition(identityType.getPartition()); clonedIdentityType.setExpirationDate(identityType.getExpirationDate()); clonedIdentityType.setCreatedDate(identityType.getCreatedDate());
IdentityType identityType = (IdentityType) attributedType; identityType.setPartition(context.getPartition()); clonedIdentityType.setPartition(identityType.getPartition()); clonedIdentityType.setExpirationDate(identityType.getExpirationDate()); clonedIdentityType.setCreatedDate(identityType.getCreatedDate());
identityType.setPartition(partition);
identityType.setPartition(partition);
@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); } }
@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); } }