((IdentityConfigurationMetaDataImpl) metadata).setRealms(realms);
if (stores.size() > 0) {
List<IdentityRepositoryConfigurationMetaData> repositories = new ArrayList<IdentityRepositoryConfigurationMetaData>();
IdentityRepositoryConfigurationMetaDataImpl repository = new IdentityRepositoryConfigurationMetaDataImpl();
repository.setClassName(WrapperIdentityStoreRepository.class.getName());
repository.setDefaultAttributeStoreId(defaultAttributeStoreId != null ? defaultAttributeStoreId : defaultStoreId);
repository.setDefaultIdentityStoreId(defaultIdentityStoreId != null ? defaultIdentityStoreId : defaultStoreId);
List<IdentityStoreMappingMetaData> mappings = new ArrayList<IdentityStoreMappingMetaData>();
IdentityStoreMappingMetaDataImpl mapping = new IdentityStoreMappingMetaDataImpl();
List<String> identityObjectTypes = new ArrayList<String>();
identityObjectTypes.add("USER");
identityObjectTypes.add("GROUP");
mapping.setIdentityObjectTypeMappings(identityObjectTypes);
mapping.setIdentityStoreId(defaultIdentityStoreId != null ? defaultIdentityStoreId : defaultStoreId);
mappings.add(mapping);
repository.setIdentityStoreToIdentityObjectTypeMappings(mappings);
repositories.add(repository);
((IdentityConfigurationMetaDataImpl) metadata).setRepositories(repositories);
configured = true;