@Override public <T extends PartitionStore<?>> T getStoreForPartitionOperation(IdentityContext context, Class<? extends Partition> partitionClass) { IdentityConfiguration partitionManagementConfig = this.configuration.getPartitionManagementConfig(); Map<IdentityStoreConfiguration, IdentityStore<?>> configStores = stores.get(partitionManagementConfig); for (IdentityStoreConfiguration cfg : configStores.keySet()) { if (cfg.supportsType(partitionClass, create)) { T store = getIdentityStoreAndInitializeContext(context, partitionManagementConfig, cfg); if (!PartitionStore.class.isInstance(store)) { throw MESSAGES.storeUnexpectedType(store.getClass(), PartitionStore.class); } return store; } } throw MESSAGES.storeNotFound(PartitionStore.class, partitionClass); }
@Override public <T extends PartitionStore<?>> T getStoreForPartitionOperation(IdentityContext context, Class<? extends Partition> partitionClass) { IdentityConfiguration partitionManagementConfig = this.configuration.getPartitionManagementConfig(); Map<IdentityStoreConfiguration, IdentityStore<?>> configStores = stores.get(partitionManagementConfig); for (IdentityStoreConfiguration cfg : configStores.keySet()) { if (cfg.supportsType(partitionClass, create)) { T store = getIdentityStoreAndInitializeContext(context, partitionManagementConfig, cfg); if (!PartitionStore.class.isInstance(store)) { throw MESSAGES.storeUnexpectedType(store.getClass(), PartitionStore.class); } return store; } } throw MESSAGES.storeNotFound(PartitionStore.class, partitionClass); }
IdentityConfiguration getConfigurationForPartition(IdentityContext identityContext, Partition partition) { IdentityConfiguration partitionManagementConfig = this.configuration.getPartitionManagementConfig(); if (partitionManagementConfig == null) { Collection<IdentityConfiguration> configurations = this.configuration.getConfigurations(); if (configurations.size() == 1) { return configurations.iterator().next(); } } if (!this.partitionConfigurations.containsKey(partition)) { PartitionStore<?> store = getStoreForPartitionOperation(identityContext, partition.getClass()); partitionConfigurations.put(partition, this.configuration.getConfigurationByName(store.getConfigurationName(identityContext, partition))); } IdentityConfiguration identityConfiguration = partitionConfigurations.get(partition); if (identityConfiguration == null) { throw MESSAGES.partitionReferencesInvalidConfiguration(partition); } return identityConfiguration; }
IdentityConfiguration getConfigurationForPartition(IdentityContext identityContext, Partition partition) { IdentityConfiguration partitionManagementConfig = this.configuration.getPartitionManagementConfig(); if (partitionManagementConfig == null) { Collection<IdentityConfiguration> configurations = this.configuration.getConfigurations(); if (configurations.size() == 1) { return configurations.iterator().next(); } } if (!this.partitionConfigurations.containsKey(partition)) { PartitionStore<?> store = getStoreForPartitionOperation(identityContext, partition.getClass()); partitionConfigurations.put(partition, this.configuration.getConfigurationByName(store.getConfigurationName(identityContext, partition))); } IdentityConfiguration identityConfiguration = partitionConfigurations.get(partition); if (identityConfiguration == null) { throw MESSAGES.partitionReferencesInvalidConfiguration(partition); } return identityConfiguration; }