public <T extends IdentityStore<?>> T lookupStore(IdentityContext context, IdentityConfiguration configuration, Class<? extends AttributedType> type, IdentityOperation operation) { for (IdentityStoreConfiguration storeConfig : configuration.getStoreConfiguration()) { if (storeConfig.supportsType(type, operation)) { return getIdentityStoreAndInitializeContext(context, configuration, storeConfig); } } return null; }
public <T extends IdentityStore<?>> T lookupStore(IdentityContext context, IdentityConfiguration configuration, Class<? extends AttributedType> type, IdentityOperation operation) { for (IdentityStoreConfiguration storeConfig : configuration.getStoreConfiguration()) { if (storeConfig.supportsType(type, operation)) { return getIdentityStoreAndInitializeContext(context, configuration, storeConfig); } } return null; }
@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); }
private boolean isPartitionSupported(final PartitionManager partitionManager) { for (IdentityConfiguration configuration : partitionManager.getConfigurations()) { if (configuration.supportsPartition()) { for (IdentityStoreConfiguration storeConfig : configuration.getStoreConfiguration()) { if (storeConfig.supportsType(Realm.class, IdentityStoreConfiguration.IdentityOperation.create)) { return true; } } } } return false; }
private boolean isPartitionSupported(final PartitionManager partitionManager) { for (IdentityConfiguration configuration : partitionManager.getConfigurations()) { if (configuration.supportsPartition()) { for (IdentityStoreConfiguration storeConfig : configuration.getStoreConfiguration()) { if (storeConfig.supportsType(Realm.class, IdentityStoreConfiguration.IdentityOperation.create)) { return true; } } } } return false; }
private boolean isPartitionSupported(final PartitionManager partitionManager) { for (IdentityConfiguration configuration : partitionManager.getConfigurations()) { if (configuration.supportsPartition()) { for (IdentityStoreConfiguration storeConfig : configuration.getStoreConfiguration()) { if (storeConfig.supportsType(Realm.class, IdentityStoreConfiguration.IdentityOperation.create)) { return true; } } } } return false; }
@Override public Set<IdentityStore<?>> getStoresForIdentityQuery(final IdentityContext context, final Class<? extends IdentityType> identityType) { IdentityConfiguration identityConfiguration = getConfigurationForPartition(context, context.getPartition()); Map<Class<? extends IdentityType>, Set<IdentityStoreConfiguration>> cachedStoresForType = this.identityQueryStoresCache.get(context.getPartition().getName()); if (cachedStoresForType != null) { Set<IdentityStoreConfiguration> storeConfigs = cachedStoresForType.get(identityType); if (storeConfigs != null) { Set<IdentityStore<?>> identityStores = new HashSet<IdentityStore<?>>(); for (IdentityStoreConfiguration storeConfig : storeConfigs) { identityStores.add(getIdentityStoreAndInitializeContext(context, identityConfiguration, storeConfig)); } return identityStores; } } Set<IdentityStore<?>> identityStores = new HashSet<IdentityStore<?>>(); Set<IdentityStoreConfiguration> identityStoresConfig = new HashSet<IdentityStoreConfiguration>(); cachedStoresForType = new HashMap<Class<? extends IdentityType>, Set<IdentityStoreConfiguration>>(); cachedStoresForType.put(identityType, identityStoresConfig); for (IdentityStoreConfiguration storeConfig : identityConfiguration.getStoreConfiguration()) { if (storeConfig.supportsType(identityType, read)) { identityStores.add(getIdentityStoreAndInitializeContext(context, identityConfiguration, storeConfig)); identityStoresConfig.add(storeConfig); } } if (identityStores.isEmpty()) { throw MESSAGES.attributedTypeUnsupportedOperation(identityType, read, identityType, read); } this.identityQueryStoresCache.put(context.getPartition().getName(), cachedStoresForType); return identityStores; }
@Override public Set<IdentityStore<?>> getStoresForIdentityQuery(final IdentityContext context, final Class<? extends IdentityType> identityType) { IdentityConfiguration identityConfiguration = getConfigurationForPartition(context, context.getPartition()); Map<Class<? extends IdentityType>, Set<IdentityStoreConfiguration>> cachedStoresForType = this.identityQueryStoresCache.get(context.getPartition().getName()); if (cachedStoresForType != null) { Set<IdentityStoreConfiguration> storeConfigs = cachedStoresForType.get(identityType); if (storeConfigs != null) { Set<IdentityStore<?>> identityStores = new HashSet<IdentityStore<?>>(); for (IdentityStoreConfiguration storeConfig : storeConfigs) { identityStores.add(getIdentityStoreAndInitializeContext(context, identityConfiguration, storeConfig)); } return identityStores; } } Set<IdentityStore<?>> identityStores = new HashSet<IdentityStore<?>>(); Set<IdentityStoreConfiguration> identityStoresConfig = new HashSet<IdentityStoreConfiguration>(); cachedStoresForType = new HashMap<Class<? extends IdentityType>, Set<IdentityStoreConfiguration>>(); cachedStoresForType.put(identityType, identityStoresConfig); for (IdentityStoreConfiguration storeConfig : identityConfiguration.getStoreConfiguration()) { if (storeConfig.supportsType(identityType, read)) { identityStores.add(getIdentityStoreAndInitializeContext(context, identityConfiguration, storeConfig)); identityStoresConfig.add(storeConfig); } } if (identityStores.isEmpty()) { throw MESSAGES.attributedTypeUnsupportedOperation(identityType, read, identityType, read); } this.identityQueryStoresCache.put(context.getPartition().getName(), cachedStoresForType); return identityStores; }
config.getRelationshipPolicy().isSelfRelationshipSupported(relationshipClass)) { for (IdentityStoreConfiguration storeConfig : config.getStoreConfiguration()) { if (storeConfig.supportsType(relationshipClass, create) || Relationship.class.equals(relationshipClass)) { identityStores.add(getIdentityStoreAndInitializeContext(context, config, storeConfig)); if (storeConfig.supportsType(relationshipClass, create) || Relationship.class.equals(relationshipClass)) { identityStores.add(getIdentityStoreAndInitializeContext(context, config, storeConfig));
config.getRelationshipPolicy().isSelfRelationshipSupported(relationshipClass)) { for (IdentityStoreConfiguration storeConfig : config.getStoreConfiguration()) { if (storeConfig.supportsType(relationshipClass, create) || Relationship.class.equals(relationshipClass)) { identityStores.add(getIdentityStoreAndInitializeContext(context, config, storeConfig)); if (storeConfig.supportsType(relationshipClass, create) || Relationship.class.equals(relationshipClass)) { identityStores.add(getIdentityStoreAndInitializeContext(context, config, storeConfig));
if (storeConfig.supportsType(relationshipClass, operation)) { store = getIdentityStoreAndInitializeContext(context, config, storeConfig); if (storeConfig.supportsType(relationshipClass, operation)) { store = getIdentityStoreAndInitializeContext(context, config, storeConfig); if (storeConfig.supportsType(relationshipClass, operation)) { store = getIdentityStoreAndInitializeContext(context, cfg, storeConfig);
if (storeConfig.supportsType(relationshipClass, operation)) { store = getIdentityStoreAndInitializeContext(context, config, storeConfig); if (storeConfig.supportsType(relationshipClass, operation)) { store = getIdentityStoreAndInitializeContext(context, config, storeConfig); if (storeConfig.supportsType(relationshipClass, operation)) { store = getIdentityStoreAndInitializeContext(context, cfg, storeConfig);