@Override public <P extends Partition> List<P> get(IdentityContext identityContext, Class<P> partitionClass) { List<P> result = new ArrayList<P>(); for (FilePartition filePartition : this.fileDataSource.getPartitions().values()) { Partition partition = filePartition.getEntry(); if (Partition.class.equals(partitionClass) || partitionClass.equals(partition.getClass())) { result.add((P) cloneAttributedType(identityContext, partition)); } } return result; }
@Override public <P extends Partition> List<P> get(IdentityContext identityContext, Class<P> partitionClass) { List<P> result = new ArrayList<P>(); for (FilePartition filePartition : this.fileDataSource.getPartitions().values()) { Partition partition = filePartition.getEntry(); if (Partition.class.equals(partitionClass) || partitionClass.equals(partition.getClass())) { result.add((P) cloneAttributedType(identityContext, partition)); } } return result; }
@Override public void updateAttributedType(IdentityContext context, final AttributedType attributedType) { AttributedType updatedAttributedType = cloneAttributedType(context, (attributedType)); if (IdentityType.class.isInstance(attributedType)) { storeIdentityType(context, (IdentityType) updatedAttributedType); } else if (Relationship.class.isInstance(attributedType)) { storeRelationshipType((Relationship) updatedAttributedType); } }
@Override public void updateAttributedType(IdentityContext context, final AttributedType attributedType) { AttributedType updatedAttributedType = cloneAttributedType(context, (attributedType)); if (IdentityType.class.isInstance(attributedType)) { storeIdentityType(context, (IdentityType) updatedAttributedType); } else if (Relationship.class.isInstance(attributedType)) { storeRelationshipType((Relationship) updatedAttributedType); } }
@Override public <P extends Partition> P get(IdentityContext identityContext, Class<P> partitionClass, String name) { try { return (P) cloneAttributedType(identityContext, (P) resolve(partitionClass, name).getEntry()); } catch (IdentityManagementException ime) { //just ignore if not found. } return null; }
private IdentityType lookupIdentityById(IdentityContext context, String id, Partition partition) { FilePartition filePartition = resolve(partition.getClass(), partition.getName()); Map<String, Map<String, FileIdentityType>> identityTypes = filePartition.getIdentityTypes(); Map<String, FileIdentityType> typedIdentityTypes = new HashMap<String, FileIdentityType>(); for (String type : identityTypes.keySet()) { typedIdentityTypes.putAll(identityTypes.get(type)); } if (id != null) { FileIdentityType fileAttributedType = typedIdentityTypes.get(id); if (fileAttributedType != null) { return cloneAttributedType(context, fileAttributedType.getEntry()); } } return null; } }
private IdentityType lookupIdentityById(IdentityContext context, String id, Partition partition) { FilePartition filePartition = resolve(partition.getClass(), partition.getName()); Map<String, Map<String, FileIdentityType>> identityTypes = filePartition.getIdentityTypes(); Map<String, FileIdentityType> typedIdentityTypes = new HashMap<String, FileIdentityType>(); for (String type : identityTypes.keySet()) { typedIdentityTypes.putAll(identityTypes.get(type)); } if (id != null) { FileIdentityType fileAttributedType = typedIdentityTypes.get(id); if (fileAttributedType != null) { return cloneAttributedType(context, fileAttributedType.getEntry()); } } return null; } }
@Override public <P extends Partition> P get(IdentityContext identityContext, Class<P> partitionClass, String name) { try { return (P) cloneAttributedType(identityContext, (P) resolve(partitionClass, name).getEntry()); } catch (IdentityManagementException ime) { //just ignore if not found. } return null; }
@Override public <P extends Partition> P lookupById(final IdentityContext context, final Class<P> partitionClass, final String id) { FilePartition filePartition = this.fileDataSource.getPartitions().get(id); if (filePartition != null && partitionClass.isInstance(filePartition.getEntry())) { return (P) cloneAttributedType(context, filePartition.getEntry()); } return null; }
@Override public <P extends Partition> P lookupById(final IdentityContext context, final Class<P> partitionClass, final String id) { FilePartition filePartition = this.fileDataSource.getPartitions().get(id); if (filePartition != null && partitionClass.isInstance(filePartition.getEntry())) { return (P) cloneAttributedType(context, filePartition.getEntry()); } return null; }
@Override public void addAttributedType(IdentityContext context, final AttributedType attributedType) { AttributedType clonedAttributedType = cloneAttributedType(context, attributedType); if (IdentityType.class.isInstance(clonedAttributedType)) { storeIdentityType(context, (IdentityType) clonedAttributedType); } else if (Relationship.class.isInstance(clonedAttributedType)) { storeRelationshipType((Relationship) clonedAttributedType); } else { this.fileDataSource.getAttributedTypes().put(attributedType.getId(), new FileAttributedType(attributedType)); } }
@Override public void addAttributedType(IdentityContext context, final AttributedType attributedType) { AttributedType clonedAttributedType = cloneAttributedType(context, attributedType); if (IdentityType.class.isInstance(clonedAttributedType)) { storeIdentityType(context, (IdentityType) clonedAttributedType); } else if (Relationship.class.isInstance(clonedAttributedType)) { storeRelationshipType((Relationship) clonedAttributedType); } else { this.fileDataSource.getAttributedTypes().put(attributedType.getId(), new FileAttributedType(attributedType)); } }
@Override public void update(IdentityContext identityContext, Partition partition) { FilePartition filePartition = resolve(partition.getClass(), partition.getName()); this.fileDataSource.getPartitions().put(partition.getId(), new FilePartition(cloneAttributedType(identityContext, partition), filePartition.getConfigurationName())); this.fileDataSource.flushPartitions(); }
@Override public void update(IdentityContext identityContext, Partition partition) { FilePartition filePartition = resolve(partition.getClass(), partition.getName()); this.fileDataSource.getPartitions().put(partition.getId(), new FilePartition(cloneAttributedType(identityContext, partition), filePartition.getConfigurationName())); this.fileDataSource.flushPartitions(); }
@Override public void add(IdentityContext identityContext, Partition partition, String configurationName) { partition.setId(identityContext.getIdGenerator().generate()); FilePartition filePartition = new FilePartition(cloneAttributedType(identityContext, partition), configurationName); this.fileDataSource.getPartitions().put(filePartition.getId(), filePartition); this.fileDataSource.flushPartitions(filePartition); }
@Override public void add(IdentityContext identityContext, Partition partition, String configurationName) { partition.setId(identityContext.getIdGenerator().generate()); FilePartition filePartition = new FilePartition(cloneAttributedType(identityContext, partition), configurationName); this.fileDataSource.getPartitions().put(filePartition.getId(), filePartition); this.fileDataSource.flushPartitions(filePartition); }
result.add((T) cloneAttributedType(context, storedRelationship.getEntry())); return result; T relationship = (T) cloneAttributedType(context, storedRelationship.getEntry());
result.add(cloneAttributedType(context, (V) fileAttributedType.getEntry())); result.add((V) cloneAttributedType(context, storedEntry));
result.add(cloneAttributedType(context, (V) fileAttributedType.getEntry())); result.add((V) cloneAttributedType(context, storedEntry));
result.add((T) cloneAttributedType(context, storedRelationship.getEntry())); return result; T relationship = (T) cloneAttributedType(context, storedRelationship.getEntry());