public ContextualRelationshipManager(DefaultPartitionManager partitionManager) { super(partitionManager.getConfiguration(), null); this.partitionManager = partitionManager; }
public ContextualRelationshipManager(DefaultPartitionManager partitionManager) { super(partitionManager.getConfiguration(), null); this.partitionManager = partitionManager; }
public AbstractAttributedTypeManager(DefaultPartitionManager partitionManager) { this(partitionManager.getConfiguration(), null); }
public AbstractAttributedTypeManager(DefaultPartitionManager partitionManager) { this(partitionManager.getConfiguration(), null); }
@Override public Collection<IdentityConfiguration> getConfigurations() { return getConfiguration().getConfigurations(); }
@Override public Collection<IdentityConfiguration> getConfigurations() { return getConfiguration().getConfigurations(); }
@Override public IdentityContext getIdentityContext() { return createIdentityContext(null, getConfiguration().getEventBridge(), getConfiguration().getIdGenerator()); } }
@Override public IdentityContext getIdentityContext() { return createIdentityContext(null, getConfiguration().getEventBridge(), getConfiguration().getIdGenerator()); } }
private void checkPartitionManagementSupported() throws OperationNotSupportedException { if (!getConfiguration().supportsPartition()) { throw MESSAGES.partitionManagementNoSupported(Partition.class, IdentityOperation.create); } }
private void checkPartitionManagementSupported() throws OperationNotSupportedException { if (!getConfiguration().supportsPartition()) { throw MESSAGES.partitionManagementNoSupported(Partition.class, IdentityOperation.create); } }
private Partition getStoredPartition(final Partition partition) { Partition storedPartition; if (getConfiguration().supportsPartition()) { storedPartition = getPartition(partition.getClass(), partition.getName()); } else { storedPartition = createDefaultPartition(); } if (storedPartition == null) { throw MESSAGES.partitionNotFoundWithName(partition.getClass(), partition.getName()); } return storedPartition; }
private Partition getStoredPartition(final Partition partition) { Partition storedPartition; if (getConfiguration().supportsPartition()) { storedPartition = getPartition(partition.getClass(), partition.getName()); } else { storedPartition = createDefaultPartition(); } if (storedPartition == null) { throw MESSAGES.partitionNotFoundWithName(partition.getClass(), partition.getName()); } return storedPartition; }
public ContextualIdentityManager(Partition partition, DefaultPartitionManager partitionManager) { super(partitionManager.getConfiguration(), partition); this.partitionManager = partitionManager; IdentityContext identityContext = getIdentityContext(); if (getStoreSelector().getStoreForPermissionOperation(identityContext) != null) { this.permissionManager = this.partitionManager.createPermissionManager(partition); } else { this.permissionManager = null; } this.relationshipManager = this.partitionManager.createRelationshipManager(); }
public ContextualIdentityManager(Partition partition, DefaultPartitionManager partitionManager) { super(partitionManager.getConfiguration(), partition); this.partitionManager = partitionManager; IdentityContext identityContext = getIdentityContext(); if (getStoreSelector().getStoreForPermissionOperation(identityContext) != null) { this.permissionManager = this.partitionManager.createPermissionManager(partition); } else { this.permissionManager = null; } this.relationshipManager = this.partitionManager.createRelationshipManager(); }
@Override public <T extends Partition> List<T> getPartitions(Class<T> partitionClass) { if (partitionClass == null) { throw MESSAGES.nullArgument("Partition class"); } List<T> partitions = new ArrayList<T>(); if (!getConfiguration().supportsPartition()) { partitions.add((T) createDefaultPartition()); } else { try { IdentityContext identityContext = getIdentityContext(); partitions.addAll(getStoreSelector().getStoreForPartitionOperation(identityContext, partitionClass).<T>get(identityContext, partitionClass)); for (T partition : partitions) { loadAttributes(identityContext, partition); } } catch (Exception e) { throw MESSAGES.partitionGetFailed(partitionClass, "not specified", e); } } return partitions; }
@Override public IdentityManager createIdentityManager(Partition partition) throws IdentityManagementException { if (partition == null) { if (!getConfiguration().supportsPartition()) { return createIdentityManager(); } throw MESSAGES.nullArgument("Partition"); } Partition storedPartition = getStoredPartition(partition); try { return new ContextualIdentityManager(storedPartition, this); } catch (Exception e) { throw MESSAGES.partitionCouldNotCreateIdentityManager(storedPartition, e); } }
@Override public IdentityManager createIdentityManager(Partition partition) throws IdentityManagementException { if (partition == null) { if (!getConfiguration().supportsPartition()) { return createIdentityManager(); } throw MESSAGES.nullArgument("Partition"); } Partition storedPartition = getStoredPartition(partition); try { return new ContextualIdentityManager(storedPartition, this); } catch (Exception e) { throw MESSAGES.partitionCouldNotCreateIdentityManager(storedPartition, e); } }
public ContextualPermissionManager(Partition partition, DefaultPartitionManager defaultPartitionManager) { this.identityContext = new DefaultIdentityContext(partition, defaultPartitionManager.getEventBridge(), defaultPartitionManager.getIdGenerator(), defaultPartitionManager.getConfiguration().getPermissionHandlerPolicy()); this.storeSelector = defaultPartitionManager.getStoreSelector(); this.partitionManager = defaultPartitionManager; if (this.storeSelector.getStoreForPermissionOperation(identityContext) == null) { throw IDMInternalMessages.MESSAGES.permissionUnsupportedOperation(); } }
public ContextualPermissionManager(Partition partition, DefaultPartitionManager defaultPartitionManager) { this.identityContext = new DefaultIdentityContext(partition, defaultPartitionManager.getEventBridge(), defaultPartitionManager.getIdGenerator(), defaultPartitionManager.getConfiguration().getPermissionHandlerPolicy()); this.storeSelector = defaultPartitionManager.getStoreSelector(); this.partitionManager = defaultPartitionManager; if (this.storeSelector.getStoreForPermissionOperation(identityContext) == null) { throw IDMInternalMessages.MESSAGES.permissionUnsupportedOperation(); } }
@Override public void add(Partition partition, String configurationName) throws IdentityManagementException { checkPartitionManagementSupported(); if (partition == null) { throw MESSAGES.nullArgument("Partition"); } if (isNullOrEmpty(configurationName)) { configurationName = getConfiguration().getDefaultConfigurationName(); } if (getConfiguration().getConfigurationByName(configurationName) != null) { checkUniqueness(partition); try { IdentityContext identityContext = getIdentityContext(); getStoreSelector().getStoreForPartitionOperation(identityContext, partition.getClass()).add(identityContext, partition, configurationName); addAttributes(identityContext, partition); fireEvent(new PartitionCreatedEvent(partition, this)); } catch (Exception e) { throw MESSAGES.partitionAddFailed(partition, configurationName, e); } } }