return Boolean.valueOf(o1.isEnabled()).compareTo(o2.isEnabled()); } else if (queryParameter.equals(IdentityType.CREATED_DATE)) { return o1.getCreatedDate().compareTo(o2.getCreatedDate()); } else if (queryParameter.equals(IdentityType.EXPIRY_DATE)) { return o1.getExpirationDate().compareTo(o2.getExpirationDate());
return Boolean.valueOf(o1.isEnabled()).compareTo(o2.isEnabled()); } else if (queryParameter.equals(IdentityType.CREATED_DATE)) { return o1.getCreatedDate().compareTo(o2.getCreatedDate()); } else if (queryParameter.equals(IdentityType.EXPIRY_DATE)) { return o1.getExpirationDate().compareTo(o2.getExpirationDate());
@Override protected void doPopulateProperties(Map<String, Serializable> properties) throws Exception { super.doPopulateProperties(properties); IdentityType identityType = getEntry(); if (identityType.getPartition() == null) { throw new IllegalStateException("Partition Null"); } if (identityType.getPartition().getId() == null) { throw new IllegalStateException("Partition ID Null"); } properties.put("partitionId", identityType.getPartition().getId()); properties.put("partitionType", identityType.getPartition().getClass().getName()); properties.put("createdDate", identityType.getCreatedDate()); if (identityType.getExpirationDate() != null) { properties.put("expirationDate", identityType.getExpirationDate()); } properties.put("enabled", identityType.isEnabled()); } }
@Override protected void doPopulateProperties(Map<String, Serializable> properties) throws Exception { super.doPopulateProperties(properties); IdentityType identityType = getEntry(); if (identityType.getPartition() == null) { throw new IllegalStateException("Partition Null"); } if (identityType.getPartition().getId() == null) { throw new IllegalStateException("Partition ID Null"); } properties.put("partitionId", identityType.getPartition().getId()); properties.put("partitionType", identityType.getPartition().getClass().getName()); properties.put("createdDate", identityType.getCreatedDate()); if (identityType.getExpirationDate() != null) { properties.put("expirationDate", identityType.getExpirationDate()); } properties.put("enabled", identityType.isEnabled()); } }
/** * <p> * Updated the common properties for a specific {@link IdentityType} instance from another instance. * </p> * * @param fromIdentityType * @param toIdentityType */ private void updateCommonProperties(IdentityType fromIdentityType, IdentityType toIdentityType) { toIdentityType.setEnabled(fromIdentityType.isEnabled()); toIdentityType.setCreatedDate(fromIdentityType.getCreatedDate()); toIdentityType.setExpirationDate(fromIdentityType.getExpirationDate()); for (Object object : toIdentityType.getAttributes().toArray()) { Attribute<? extends Serializable> attribute = (Attribute<? extends Serializable>) object; toIdentityType.removeAttribute(attribute.getName()); } for (Attribute<? extends Serializable> attrib : fromIdentityType.getAttributes()) { toIdentityType.setAttribute(attrib); } }
clonedIdentityType.setCreatedDate(identityType.getCreatedDate()); clonedIdentityType.setEnabled(identityType.isEnabled()); } else if (Relationship.class.isInstance(attributedType)) {
clonedIdentityType.setCreatedDate(identityType.getCreatedDate()); clonedIdentityType.setEnabled(identityType.isEnabled()); } else if (Relationship.class.isInstance(attributedType)) {
/** * <p> * Populates the given {@link Object} argument representing a Identity Class (from the config) with the information from the * specified {@link IdentityType}. * </p> * * @param toIdentity * @param fromIdentityType */ protected void populateIdentityInstance(Realm realm, Object toIdentity, T fromIdentityType, JPAIdentityStore store) { // populate the common properties from IdentityType String identityDiscriminator = store.getConfig().getIdentityDiscriminator(fromIdentityType.getClass()); store.setModelProperty(toIdentity, PROPERTY_IDENTITY_DISCRIMINATOR, identityDiscriminator, true); store.setModelProperty(toIdentity, PROPERTY_IDENTITY_KEY, fromIdentityType.getKey(), true); store.setModelProperty(toIdentity, PROPERTY_IDENTITY_ENABLED, fromIdentityType.isEnabled(), true); store.setModelProperty(toIdentity, PROPERTY_IDENTITY_CREATED, fromIdentityType.getCreatedDate(), true); store.setModelProperty(toIdentity, PROPERTY_IDENTITY_EXPIRES, fromIdentityType.getExpirationDate()); if (realm != null) { store.setModelProperty(toIdentity, PROPERTY_IDENTITY_PARTITION, store.lookupPartitionObject(realm)); } doPopulateIdentityInstance(toIdentity, fromIdentityType, store); }
Date createdDate = storedIdentityType.getCreatedDate();