Author: bdaw
Date: 2008-11-06 18:36:08 -0500 (Thu, 06 Nov 2008)
New Revision: 120
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributeType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributesType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ExternalConfigType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/GroupTypeMappingType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypeType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypesType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreConfigurationType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingsType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoresType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityTypeMappingsType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/JbossIdentityType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ObjectFactory.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionsType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmConfigurationType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmsType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipsType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoriesType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryConfigurationType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/StoresType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedIdentityObjectTypesType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedRelationshipTypesType.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/package-info.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityConfigurationMetaDataImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityObjectTypeMetaDataImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityRepositoryConfigurationMetaDataImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityStoreConfigurationMetaDataImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityStoreMappingMetaDataImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/RealmConfigurationMetaDataImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/RelationshipMetaDataImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/RepositoryIdentityStoreSessionImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/SimpleIdentityStoreInvocationContext.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreSessionImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreSessionImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityStoreConfiguration.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/configuration/
trunk/identity-impl/src/test/java/org/jboss/identity/impl/configuration/ConfigurationTestCase.java
trunk/identity-impl/src/test/resources/identity-config.xml
trunk/identity-impl/src/test/resources/identity-config.xsd
trunk/identity-impl/src/test/resources/organization-test-config.xml
trunk/identity-impl/src/test/resources/test-config.xml
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaDataImpl.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityConfigurationMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityObjectTypeMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityRepositoryConfigurationMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityStoreConfigurationMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityStoreMappingMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/RealmConfigurationMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/RelationshipMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/exception/IdentityConfigurationException.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreSession.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreSessionFactory.java
Removed:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/PropertyGroup.java
Modified:
trunk/identity-impl/pom.xml
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionContext.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionFactoryImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleTransactionImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/AbstractIdentityStoreRepository.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/WrapperIdentityStoreRepository.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreInvocationContext.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStore.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreInvocationContext.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/HibernateTestSupport.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/APITestCase.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/OrganizationTest.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreTestCase.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreTestCase.java
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityStoreInvocationContext.java
trunk/identity-impl/src/test/resources/META-INF/persistence.xml
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/ConfigurationService.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/repository/IdentityStoreRepository.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreInvocationContext.java
trunk/parent/pom.xml
Log:
just some code backup
Modified: trunk/identity-impl/pom.xml
===================================================================
--- trunk/identity-impl/pom.xml 2008-11-04 03:45:19 UTC (rev 119)
+++ trunk/identity-impl/pom.xml 2008-11-06 23:36:08 UTC (rev 120)
@@ -80,5 +80,20 @@
<version>3.2.76</version>
<scope>test</scope>
</dependency>
+ <!--<dependency>-->
+ <!--<groupId>sun-jaxb</groupId>-->
+ <!--<artifactId>jaxb-impl</artifactId>-->
+ <!--<version>2.1.4</version>-->
+ <!--</dependency>-->
+ <!--<dependency>-->
+ <!--<groupId>sun-jaxb</groupId>-->
+ <!--<artifactId>jaxb-api</artifactId>-->
+ <!--<version>2.1.4</version>-->
+ <!--</dependency>-->
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.8</version>
+ </dependency>
</dependencies>
</project>
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionContext.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionContext.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionContext.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -37,5 +37,5 @@
IdentityObjectTypeMapper getIdentityObjectTypeMapper();
IdentityStoreInvocationContext resolveStoreInvocationContext();
-
+
}
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionFactoryImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionFactoryImpl.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionFactoryImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -24,8 +24,19 @@
import org.jboss.identity.api.IdentitySessionFactory;
import org.jboss.identity.api.IdentitySession;
+import org.jboss.identity.spi.configuration.metadata.IdentityConfigurationMetaData;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
+import
org.jboss.identity.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
+import org.jboss.identity.spi.configuration.metadata.RealmConfigurationMetaData;
+import org.jboss.identity.spi.store.IdentityStore;
+import org.jboss.identity.spi.store.AttributeStore;
+import org.jboss.identity.spi.repository.IdentityStoreRepository;
+import org.jboss.identity.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
import java.util.Map;
+import java.util.HashMap;
+import java.io.File;
+import java.lang.reflect.Constructor;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
@@ -34,13 +45,95 @@
public class IdentitySessionFactoryImpl implements IdentitySessionFactory
{
- private Map<String, IdentitySession> realmMap;
+ private final Map<String, IdentitySession> realmMap;
public IdentitySessionFactoryImpl(Map<String, IdentitySession> realmMap)
{
this.realmMap = realmMap;
}
+ public IdentitySessionFactoryImpl(IdentityConfigurationMetaData configMD) throws
Exception
+ {
+ realmMap = createSessionMap(configMD);
+ }
+
+ public IdentitySessionFactoryImpl(File configFile) throws Exception
+ {
+ IdentityConfigurationMetaData configMD =
JAXB2IdentityConfiguration.createConfigurationMetaData(configFile);
+
+ realmMap = createSessionMap(configMD);
+
+ }
+
+ private Map<String, IdentitySession>
createSessionMap(IdentityConfigurationMetaData configMD) throws Exception
+ {
+ //TODO: some validation, sanity checks and error reporting
+
+ // IdentityStore
+
+ Map<String, IdentityStore> bootstrappedIdentityStores = new
HashMap<String, IdentityStore>();
+ Map<String, AttributeStore> bootstrappedAttributeStores = new
HashMap<String, AttributeStore>();
+
+ for (IdentityStoreConfigurationMetaData metaData : configMD.getIdentityStores())
+ {
+ Class storeClass = Class.forName(metaData.getClassName());
+ Class partypes[] = new Class[1];
+ partypes[0] = String.class;
+
+ Constructor ct = storeClass.getConstructor(partypes);
+ Object argList[] = new Object[1];
+ argList[0] = metaData.getId();
+
+ IdentityStore store = (IdentityStore)ct.newInstance(argList);
+
+ store.bootstrap(metaData);
+
+ bootstrappedIdentityStores.put(store.getId(), store);
+ bootstrappedAttributeStores.put(store.getId(), store);
+ }
+
+ // IdentityRepository
+
+ Map<String, IdentityStoreRepository> bootstrappedRepositories = new
HashMap<String, IdentityStoreRepository>();
+
+ for (IdentityRepositoryConfigurationMetaData metaData :
configMD.getRepositories())
+ {
+ Class repoClass = Class.forName(metaData.getClassName());
+ Class partypes[] = new Class[1];
+ partypes[0] = String.class;
+
+ Constructor ct = repoClass.getConstructor(partypes);
+ Object argList[] = new Object[1];
+ argList[0] = metaData.getId();
+
+ IdentityStoreRepository repo =
(IdentityStoreRepository)ct.newInstance(argList);
+
+ repo.bootstrap(metaData, bootstrappedIdentityStores,
bootstrappedAttributeStores);
+
+ bootstrappedRepositories.put(repo.getId(), repo);
+ }
+
+ // Realms
+
+ Map<String, IdentitySession> sessionMap = new HashMap<String,
IdentitySession>();
+
+ for (RealmConfigurationMetaData metaData : configMD.getRealms())
+ {
+ String realmName = metaData.getId();
+
+ IdentityStoreRepository repo =
bootstrappedRepositories.get(metaData.getIdentityRepositoryIdRef());
+
+ //TODO: for now we just use direct type mapper and ignore group type mappings
config
+ IdentityObjectTypeMapper mapper = new
DirectIdentityObjectTypeMapperImpl(metaData.getIdentityMapping());
+
+ IdentitySession session = new IdentitySessionImpl(realmName, repo, mapper);
+
+ sessionMap.put(realmName, session);
+ }
+
+ return sessionMap;
+ }
+
public void close()
{
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionImpl.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/IdentitySessionImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -29,6 +29,10 @@
import org.jboss.identity.api.AttributesManager;
import org.jboss.identity.api.RoleManager;
import org.jboss.identity.exception.IdentityException;
+import org.jboss.identity.spi.store.IdentityStoreSession;
+import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
+import org.jboss.identity.spi.repository.IdentityStoreRepository;
+import org.jboss.identity.impl.store.SimpleIdentityStoreInvocationContext;
import java.util.Set;
@@ -50,27 +54,41 @@
private final RoleManager roleManager;
- private final Set<SessionWrapper> sessionWrappers;
-
public IdentitySessionContext getSessionContext()
{
return sessionContext;
}
- public IdentitySessionImpl(String realmName, IdentitySessionContext sessionContext,
- Set<SessionWrapper> sessionWrappers)
+ public IdentitySessionImpl(String realmName,
+ IdentityStoreRepository repository,
+ IdentityObjectTypeMapper typeMapper) throws
IdentityException
{
this.realmName = realmName;
- this.sessionContext = sessionContext;
- this.sessionWrappers = sessionWrappers;
+
+ IdentityStoreSession storeSession = repository.createIdentityStoreSession();
+ final IdentityStoreInvocationContext invocationCtx = new
SimpleIdentityStoreInvocationContext(storeSession, realmName);
+
+ IdentityStoreInvocationContextResolver resolver = new
IdentityStoreInvocationContextResolver()
+ {
+ public IdentityStoreInvocationContext resolveInvocationContext()
+ {
+ return invocationCtx;
+ }
+ };
+
+ sessionContext = new IdentitySessionContextImpl(repository, typeMapper, resolver);
+
this.persistenceManager = new PersistenceManagerImpl(this);
this.relationshipManager = new RelationshipManagerImpl(this);
this.profileManager = new AttributesManagerImpl(this);
this.roleManager = new RoleManagerImpl(this);
-
}
+
+
+
+
public String getRealmName()
{
return realmName;
@@ -78,50 +96,33 @@
public void close() throws IdentityException
{
- for (SessionWrapper sessionWrapper : sessionWrappers)
- {
- sessionWrapper.close();
- }
+ sessionContext.resolveStoreInvocationContext().getIdentityStoreSession().close();
}
public void save() throws IdentityException
{
- for (SessionWrapper sessionWrapper : sessionWrappers)
- {
- sessionWrapper.save();
- }
+ sessionContext.resolveStoreInvocationContext().getIdentityStoreSession().save();
}
public void clear() throws IdentityException
{
- for (SessionWrapper sessionWrapper : sessionWrappers)
- {
- sessionWrapper.clear();
- }
+ sessionContext.resolveStoreInvocationContext().getIdentityStoreSession().clear();
}
public boolean isOpen()
{
- for (SessionWrapper sessionWrapper : sessionWrappers)
- {
- if (sessionWrapper.isOpen())
- {
- return true;
- }
- }
-
- return false;
+ return
sessionContext.resolveStoreInvocationContext().getIdentityStoreSession().isOpen();
}
public Transaction beginTransaction()
{
- return new SimpleTransactionImpl(sessionWrappers);
+ return new
SimpleTransactionImpl(sessionContext.resolveStoreInvocationContext().getIdentityStoreSession());
}
public Transaction getTransaction()
{
- return new SimpleTransactionImpl(sessionWrappers);
+ return new
SimpleTransactionImpl(sessionContext.resolveStoreInvocationContext().getIdentityStoreSession());
}
public PersistenceManager getPersistenceManager()
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleTransactionImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleTransactionImpl.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/api/SimpleTransactionImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -23,57 +23,43 @@
package org.jboss.identity.impl.api;
import org.jboss.identity.api.Transaction;
+import org.jboss.identity.spi.store.IdentityStoreSession;
-import java.util.Set;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
public class SimpleTransactionImpl implements Transaction
{
- private final Set<SessionWrapper> sessionWrappers;
+ private final IdentityStoreSession sessionWrapper;
- public SimpleTransactionImpl(Set<SessionWrapper> sessionWrappers)
+ public SimpleTransactionImpl(IdentityStoreSession sessionWrapper)
{
- this.sessionWrappers = sessionWrappers;
+ this.sessionWrapper = sessionWrapper;
}
public void start()
{
- for (SessionWrapper sessionWrapper : sessionWrappers)
- {
- sessionWrapper.startTransaction();
- }
+ sessionWrapper.startTransaction();
}
public void commit()
{
- for (SessionWrapper sessionWrapper : sessionWrappers)
- {
- sessionWrapper.commitTransaction();
- }
+
+ sessionWrapper.commitTransaction();
+
}
public void rollback()
{
- for (SessionWrapper sessionWrapper : sessionWrappers)
- {
- sessionWrapper.rollbackTransaction();
- }
+
+ sessionWrapper.rollbackTransaction();
+
}
public boolean isActive()
{
- for (SessionWrapper sessionWrapper : sessionWrappers)
- {
- if (sessionWrapper.isTransactionActive())
- {
- return true;
- }
- }
-
- return false;
+ return sessionWrapper.isTransactionActive();
}
}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,274 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.configuration.jaxb2;
+
+import org.jboss.identity.impl.configuration.metadata.IdentityConfigurationMetaDataImpl;
+import org.jboss.identity.impl.configuration.metadata.IdentityObjectTypeMetaDataImpl;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
+import
org.jboss.identity.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
+import org.jboss.identity.spi.configuration.metadata.RealmConfigurationMetaData;
+import org.jboss.identity.impl.configuration.metadata.RealmConfigurationMetaDataImpl;
+import
org.jboss.identity.impl.configuration.metadata.IdentityRepositoryConfigurationMetaDataImpl;
+import
org.jboss.identity.impl.configuration.metadata.IdentityStoreConfigurationMetaDataImpl;
+import org.jboss.identity.impl.configuration.metadata.IdentityStoreMappingMetaDataImpl;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreMappingMetaData;
+import org.jboss.identity.spi.configuration.metadata.IdentityConfigurationMetaData;
+import org.jboss.identity.spi.exception.IdentityConfigurationException;
+import org.jboss.identity.spi.attribute.AttributeMetaData;
+import org.jboss.identity.spi.attribute.AttributeMetaDataImpl;
+import org.jboss.identity.impl.configuration.jaxb2.generated.JbossIdentityType;
+import org.jboss.identity.impl.configuration.jaxb2.generated.IdentityStoreType;
+import org.jboss.identity.impl.configuration.jaxb2.generated.RepositoryType;
+import org.jboss.identity.impl.configuration.jaxb2.generated.RealmType;
+import org.jboss.identity.impl.configuration.jaxb2.generated.GroupTypeMappingType;
+import org.jboss.identity.impl.configuration.jaxb2.generated.OptionType;
+import org.jboss.identity.impl.configuration.jaxb2.generated.OptionsType;
+import org.jboss.identity.impl.configuration.jaxb2.generated.IdentityStoreMappingType;
+import org.jboss.identity.impl.configuration.jaxb2.generated.IdentityObjectTypeType;
+import org.jboss.identity.impl.configuration.jaxb2.generated.AttributeType;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.LinkedList;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public abstract class JAXB2IdentityConfiguration
+{
+
+ //TODO: check if configuration is consistent
+
+
+ public static IdentityConfigurationMetaData createConfigurationMetaData(File
xmlConfig) throws IdentityConfigurationException
+ {
+
+ if (xmlConfig == null || !xmlConfig.exists())
+ {
+ throw new IllegalArgumentException("File does not exist");
+ }
+
+ JAXBElement<JbossIdentityType> jiElement = null;
+
+ Object o = null;
+ try
+ {
+ JAXBContext jaxbContext =
JAXBContext.newInstance("org.jboss.identity.impl.configuration.jaxb2.generated");
+ Unmarshaller unMarshaller = jaxbContext.createUnmarshaller();
+
+ jiElement =
(JAXBElement<JbossIdentityType>)unMarshaller.unmarshal(xmlConfig);
+ }
+ catch (JAXBException e)
+ {
+ throw new IdentityConfigurationException("Cannot unmarshal xml
configuration: ", e);
+ }
+
+ JbossIdentityType identityConfig = jiElement.getValue();
+
+ IdentityConfigurationMetaDataImpl configurationMD = new
IdentityConfigurationMetaDataImpl();
+
+ for (IdentityStoreType identityStoreType :
identityConfig.getStores().getIdentityStores().getIdentityStore())
+ {
+
configurationMD.getIdentityStores().add(createIdentityStoreConfigurationMetaData(identityStoreType));
+ }
+
+ for (RepositoryType repositoryType :
identityConfig.getRepositories().getRepository())
+ {
+
configurationMD.getRepositories().add(createIdentityRepositoryConfigurationMetaData(repositoryType));
+ }
+
+ for (RealmType realmType : identityConfig.getRealms().getRealm())
+ {
+ configurationMD.getRealms().add(createRealmConfigurationMetaData(realmType));
+ }
+
+ return configurationMD;
+
+ }
+
+ private static RealmConfigurationMetaData createRealmConfigurationMetaData(RealmType
realmType)
+ {
+ RealmConfigurationMetaDataImpl realmMD = new RealmConfigurationMetaDataImpl();
+
+ realmMD.setId(realmType.getId());
+ if (realmType.getRealmConfiguration().getIdentityTypeMappings() != null)
+ {
+
realmMD.setIdentityMapping(realmType.getRealmConfiguration().getIdentityTypeMappings().getIdentityMapping());
+ }
+ realmMD.setIdentityRepositoryIdRef(realmType.getRepositoryIdRef());
+
+ Map<String, String> groupMappings = new HashMap<String, String>();
+
+ if (realmType.getRealmConfiguration().getIdentityTypeMappings() != null)
+ {
+ for (GroupTypeMappingType groupTypeMappingType :
realmType.getRealmConfiguration().getIdentityTypeMappings().getGroupTypeMapping())
+ {
+ groupMappings.put(groupTypeMappingType.getGroupTypeName(),
groupTypeMappingType.getIdentityObjectTypeName());
+ }
+ }
+
+ realmMD.setGroupTypeMappings(groupMappings);
+
+ realmMD.setOptions(createOptions(realmType.getRealmConfiguration().getOptions()));
+
+
+ return realmMD;
+ }
+
+
+ private static IdentityRepositoryConfigurationMetaData
createIdentityRepositoryConfigurationMetaData(RepositoryType repositoryType)
+ {
+ IdentityRepositoryConfigurationMetaDataImpl repoMD = new
IdentityRepositoryConfigurationMetaDataImpl();
+
+ repoMD.setId(repositoryType.getId());
+ repoMD.setClassName(repositoryType.getClazz());
+ if (repositoryType.getRepositoryConfiguration().getExternalConfig() != null)
+ {
+
repoMD.setExternalConfig(repositoryType.getRepositoryConfiguration().getExternalConfig().getValue());
+ }
+
repoMD.setDefaultAttributeStroeId(repositoryType.getRepositoryConfiguration().getDefaultAttributeStoreId());
+
repoMD.setDefaultIdentityStoreId(repositoryType.getRepositoryConfiguration().getDefaultIdentityStoreId());
+
+ List<IdentityStoreMappingMetaData> storeMappings = new
LinkedList<IdentityStoreMappingMetaData>();
+
+ for (IdentityStoreMappingType identityStoreMappingType :
repositoryType.getRepositoryConfiguration().getIdentityStoreMappings().getIdentityStoreMapping())
+ {
+ IdentityStoreMappingMetaDataImpl mapping = new
IdentityStoreMappingMetaDataImpl();
+
+ mapping.setIdentityStoreId(identityStoreMappingType.getIdentityStoreId());
+
mapping.setIdentityObjectTypeMappings(identityStoreMappingType.getIdentityObjectTypes().getIdentityObjectType());
+ mapping.setOptions(createOptions(identityStoreMappingType.getOptions()));
+
+ storeMappings.add(mapping);
+ }
+
+ repoMD.setIdentityStoreToIdentityObjectTypeMappings(storeMappings);
+
+
repoMD.setOptions(createOptions(repositoryType.getRepositoryConfiguration().getOptions()));
+
+
+ return repoMD;
+ }
+
+ private static IdentityStoreConfigurationMetaData
createIdentityStoreConfigurationMetaData(IdentityStoreType identityStoreType)
+ {
+ IdentityStoreConfigurationMetaDataImpl storeMD = new
IdentityStoreConfigurationMetaDataImpl();
+
+ storeMD.setId(identityStoreType.getId());
+ storeMD.setClassName(identityStoreType.getClazz());
+
+ if (identityStoreType.getIdentityStoreConfiguration().getExternalConfig() != null)
+ {
+
storeMD.setExternalConfig(identityStoreType.getIdentityStoreConfiguration().getExternalConfig().getValue());
+ }
+
+
storeMD.setSupportedRelationshipTypes(identityStoreType.getIdentityStoreConfiguration().getSupportedRelationshipTypes().getRelationshipType());
+
+ for (IdentityObjectTypeType identityObjectTypeType :
identityStoreType.getIdentityStoreConfiguration().getSupportedIdentityObjectTypes().getIdentityObjectType())
+ {
+ IdentityObjectTypeMetaDataImpl identityObjectTypeMD = new
IdentityObjectTypeMetaDataImpl();
+
+ identityObjectTypeMD.setName(identityObjectTypeType.getName());
+
+ List<AttributeMetaData> attributes = new
LinkedList<AttributeMetaData>();
+
+ for (AttributeType attributeType :
identityObjectTypeType.getAttributes().getAttribute())
+ {
+ AttributeMetaDataImpl attributeMD = new AttributeMetaDataImpl();
+
+ attributeMD.setName(attributeType.getName());
+ attributeMD.setStoreMapping(attributeType.getMapping());
+
+ String readonly = attributeType.getIsReadOnly();
+ if (readonly != null && readonly.equalsIgnoreCase("true"))
+ {
+ attributeMD.setReadonly(true);
+ }
+
+ String multivalued = attributeType.getIsMultivalued();
+ if (multivalued != null &&
multivalued.equalsIgnoreCase("true"))
+ {
+ attributeMD.setMultivalued(true);
+ }
+
+ String required = attributeType.getIsRequired();
+ if (required != null && required.equalsIgnoreCase("true"))
+ {
+ attributeMD.setRequired(true);
+ }
+
+ attributes.add(attributeMD);
+ }
+
+ identityObjectTypeMD.setAttributes(attributes);
+
+
+ Map<String, List<String>> options = new HashMap<String,
List<String>>();
+
+ for (OptionType optionType : identityObjectTypeType.getOptions().getOption())
+ {
+ options.put(optionType.getName(), optionType.getValue());
+ }
+
+ identityObjectTypeMD.setOptions(options);
+
+ storeMD.getSupportedIdentityTypes().add(identityObjectTypeMD);
+ }
+
+
+
+ Map<String, List<String>> options = new HashMap<String,
List<String>>();
+
+ for (OptionType optionType :
identityStoreType.getIdentityStoreConfiguration().getOptions().getOption())
+ {
+ options.put(optionType.getName(), optionType.getValue());
+ }
+
+ storeMD.setOptions(options);
+
+ return storeMD;
+ }
+
+ private static Map<String, List<String>> createOptions(OptionsType
optionsType)
+ {
+ Map<String, List<String>> options = new HashMap<String,
List<String>>();
+
+ if (optionsType != null)
+ {
+ for (OptionType optionType : optionsType.getOption())
+ {
+ options.put(optionType.getName(), optionType.getValue());
+ }
+ }
+
+ return options;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributeType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributeType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributeType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,180 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for attributeType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="attributeType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="name"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="mapping"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="isRequired"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="isMultivalued"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="isReadOnly"
type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "attributeType", propOrder = {
+ "name",
+ "mapping",
+ "isRequired",
+ "isMultivalued",
+ "isReadOnly"
+})
+public class AttributeType {
+
+ @XmlElement(required = true)
+ protected String name;
+ @XmlElement(required = true)
+ protected String mapping;
+ @XmlElement(required = true)
+ protected String isRequired;
+ @XmlElement(required = true)
+ protected String isMultivalued;
+ protected String isReadOnly;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the mapping property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getMapping() {
+ return mapping;
+ }
+
+ /**
+ * Sets the value of the mapping property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setMapping(String value) {
+ this.mapping = value;
+ }
+
+ /**
+ * Gets the value of the isRequired property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIsRequired() {
+ return isRequired;
+ }
+
+ /**
+ * Sets the value of the isRequired property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIsRequired(String value) {
+ this.isRequired = value;
+ }
+
+ /**
+ * Gets the value of the isMultivalued property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIsMultivalued() {
+ return isMultivalued;
+ }
+
+ /**
+ * Sets the value of the isMultivalued property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIsMultivalued(String value) {
+ this.isMultivalued = value;
+ }
+
+ /**
+ * Gets the value of the isReadOnly property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIsReadOnly() {
+ return isReadOnly;
+ }
+
+ /**
+ * Sets the value of the isReadOnly property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIsReadOnly(String value) {
+ this.isReadOnly = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributesType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributesType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/AttributesType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,74 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for attributesType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="attributesType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="attribute"
type="{urn:jboss:identity:config:v0_1}attributeType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "attributesType", propOrder = {
+ "attribute"
+})
+public class AttributesType {
+
+ protected List<AttributeType> attribute;
+
+ /**
+ * Gets the value of the attribute property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the attribute
property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getAttribute().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link AttributeType }
+ *
+ *
+ */
+ public List<AttributeType> getAttribute() {
+ if (attribute == null) {
+ attribute = new ArrayList<AttributeType>();
+ }
+ return this.attribute;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ExternalConfigType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ExternalConfigType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ExternalConfigType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,94 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+
+/**
+ * <p>Java class for external-configType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="external-configType">
+ * <simpleContent>
+ * <extension
base="<http://www.w3.org/2001/XMLSchema>string">
+ * <attribute name="override"
type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </extension>
+ * </simpleContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "external-configType", propOrder = {
+ "value"
+})
+public class ExternalConfigType {
+
+ @XmlValue
+ protected String value;
+ @XmlAttribute
+ protected String override;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the override property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getOverride() {
+ return override;
+ }
+
+ /**
+ * Sets the value of the override property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setOverride(String value) {
+ this.override = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/GroupTypeMappingType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/GroupTypeMappingType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/GroupTypeMappingType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,97 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for group-type-mappingType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="group-type-mappingType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="group-type-name"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="identity-object-type-name"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "group-type-mappingType", propOrder = {
+ "groupTypeName",
+ "identityObjectTypeName"
+})
+public class GroupTypeMappingType {
+
+ @XmlElement(name = "group-type-name", required = true)
+ protected String groupTypeName;
+ @XmlElement(name = "identity-object-type-name", required = true)
+ protected String identityObjectTypeName;
+
+ /**
+ * Gets the value of the groupTypeName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getGroupTypeName() {
+ return groupTypeName;
+ }
+
+ /**
+ * Sets the value of the groupTypeName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setGroupTypeName(String value) {
+ this.groupTypeName = value;
+ }
+
+ /**
+ * Gets the value of the identityObjectTypeName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIdentityObjectTypeName() {
+ return identityObjectTypeName;
+ }
+
+ /**
+ * Sets the value of the identityObjectTypeName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIdentityObjectTypeName(String value) {
+ this.identityObjectTypeName = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypeType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypeType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypeType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,362 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for identity-object-typeType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="identity-object-typeType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="name"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="relationships">
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="relationship"
type="{urn:jboss:identity:config:v0_1}relationshipType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * <element name="attributes">
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="attribute"
type="{urn:jboss:identity:config:v0_1}attributeType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * <element name="options">
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="option"
type="{urn:jboss:identity:config:v0_1}optionType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "identity-object-typeType", propOrder = {
+ "name",
+ "relationships",
+ "attributes",
+ "options"
+})
+public class IdentityObjectTypeType {
+
+ @XmlElement(required = true)
+ protected String name;
+ @XmlElement(required = true)
+ protected IdentityObjectTypeType.Relationships relationships;
+ @XmlElement(required = true)
+ protected IdentityObjectTypeType.Attributes attributes;
+ @XmlElement(required = true)
+ protected IdentityObjectTypeType.Options options;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the relationships property.
+ *
+ * @return
+ * possible object is
+ * {@link IdentityObjectTypeType.Relationships }
+ *
+ */
+ public IdentityObjectTypeType.Relationships getRelationships() {
+ return relationships;
+ }
+
+ /**
+ * Sets the value of the relationships property.
+ *
+ * @param value
+ * allowed object is
+ * {@link IdentityObjectTypeType.Relationships }
+ *
+ */
+ public void setRelationships(IdentityObjectTypeType.Relationships value) {
+ this.relationships = value;
+ }
+
+ /**
+ * Gets the value of the attributes property.
+ *
+ * @return
+ * possible object is
+ * {@link IdentityObjectTypeType.Attributes }
+ *
+ */
+ public IdentityObjectTypeType.Attributes getAttributes() {
+ return attributes;
+ }
+
+ /**
+ * Sets the value of the attributes property.
+ *
+ * @param value
+ * allowed object is
+ * {@link IdentityObjectTypeType.Attributes }
+ *
+ */
+ public void setAttributes(IdentityObjectTypeType.Attributes value) {
+ this.attributes = value;
+ }
+
+ /**
+ * Gets the value of the options property.
+ *
+ * @return
+ * possible object is
+ * {@link IdentityObjectTypeType.Options }
+ *
+ */
+ public IdentityObjectTypeType.Options getOptions() {
+ return options;
+ }
+
+ /**
+ * Sets the value of the options property.
+ *
+ * @param value
+ * allowed object is
+ * {@link IdentityObjectTypeType.Options }
+ *
+ */
+ public void setOptions(IdentityObjectTypeType.Options value) {
+ this.options = value;
+ }
+
+
+ /**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained
within this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="attribute"
type="{urn:jboss:identity:config:v0_1}attributeType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "attribute"
+ })
+ public static class Attributes {
+
+ protected List<AttributeType> attribute;
+
+ /**
+ * Gets the value of the attribute property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the
attribute property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getAttribute().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link AttributeType }
+ *
+ *
+ */
+ public List<AttributeType> getAttribute() {
+ if (attribute == null) {
+ attribute = new ArrayList<AttributeType>();
+ }
+ return this.attribute;
+ }
+
+ }
+
+
+ /**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained
within this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="option"
type="{urn:jboss:identity:config:v0_1}optionType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "option"
+ })
+ public static class Options {
+
+ protected List<OptionType> option;
+
+ /**
+ * Gets the value of the option property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the option
property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getOption().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link OptionType }
+ *
+ *
+ */
+ public List<OptionType> getOption() {
+ if (option == null) {
+ option = new ArrayList<OptionType>();
+ }
+ return this.option;
+ }
+
+ }
+
+
+ /**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained
within this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="relationship"
type="{urn:jboss:identity:config:v0_1}relationshipType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "relationship"
+ })
+ public static class Relationships {
+
+ protected List<RelationshipType> relationship;
+
+ /**
+ * Gets the value of the relationship property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the
relationship property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getRelationship().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link RelationshipType }
+ *
+ *
+ */
+ public List<RelationshipType> getRelationship() {
+ if (relationship == null) {
+ relationship = new ArrayList<RelationshipType>();
+ }
+ return this.relationship;
+ }
+
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypesType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypesType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityObjectTypesType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for identity-object-typesType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="identity-object-typesType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="identity-object-type"
type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"
minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "identity-object-typesType", propOrder = {
+ "identityObjectType"
+})
+public class IdentityObjectTypesType {
+
+ @XmlElement(name = "identity-object-type")
+ protected List<String> identityObjectType;
+
+ /**
+ * Gets the value of the identityObjectType property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the
identityObjectType property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getIdentityObjectType().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link String }
+ *
+ *
+ */
+ public List<String> getIdentityObjectType() {
+ if (identityObjectType == null) {
+ identityObjectType = new ArrayList<String>();
+ }
+ return this.identityObjectType;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreConfigurationType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreConfigurationType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreConfigurationType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,224 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for identity-store-configurationType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="identity-store-configurationType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="external-config"
type="{urn:jboss:identity:config:v0_1}external-configType"/>
+ * <element name="supported-relationship-types"
type="{urn:jboss:identity:config:v0_1}supported-relationship-typesType"/>
+ * <element name="supported-identity-object-types"
type="{urn:jboss:identity:config:v0_1}supported-identity-object-typesType"/>
+ * <element name="options">
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="option"
type="{urn:jboss:identity:config:v0_1}optionType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </element>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "identity-store-configurationType", propOrder = {
+ "externalConfig",
+ "supportedRelationshipTypes",
+ "supportedIdentityObjectTypes",
+ "options"
+})
+public class IdentityStoreConfigurationType {
+
+ @XmlElement(name = "external-config", required = true)
+ protected ExternalConfigType externalConfig;
+ @XmlElement(name = "supported-relationship-types", required = true)
+ protected SupportedRelationshipTypesType supportedRelationshipTypes;
+ @XmlElement(name = "supported-identity-object-types", required = true)
+ protected SupportedIdentityObjectTypesType supportedIdentityObjectTypes;
+ @XmlElement(required = true)
+ protected IdentityStoreConfigurationType.Options options;
+
+ /**
+ * Gets the value of the externalConfig property.
+ *
+ * @return
+ * possible object is
+ * {@link ExternalConfigType }
+ *
+ */
+ public ExternalConfigType getExternalConfig() {
+ return externalConfig;
+ }
+
+ /**
+ * Sets the value of the externalConfig property.
+ *
+ * @param value
+ * allowed object is
+ * {@link ExternalConfigType }
+ *
+ */
+ public void setExternalConfig(ExternalConfigType value) {
+ this.externalConfig = value;
+ }
+
+ /**
+ * Gets the value of the supportedRelationshipTypes property.
+ *
+ * @return
+ * possible object is
+ * {@link SupportedRelationshipTypesType }
+ *
+ */
+ public SupportedRelationshipTypesType getSupportedRelationshipTypes() {
+ return supportedRelationshipTypes;
+ }
+
+ /**
+ * Sets the value of the supportedRelationshipTypes property.
+ *
+ * @param value
+ * allowed object is
+ * {@link SupportedRelationshipTypesType }
+ *
+ */
+ public void setSupportedRelationshipTypes(SupportedRelationshipTypesType value) {
+ this.supportedRelationshipTypes = value;
+ }
+
+ /**
+ * Gets the value of the supportedIdentityObjectTypes property.
+ *
+ * @return
+ * possible object is
+ * {@link SupportedIdentityObjectTypesType }
+ *
+ */
+ public SupportedIdentityObjectTypesType getSupportedIdentityObjectTypes() {
+ return supportedIdentityObjectTypes;
+ }
+
+ /**
+ * Sets the value of the supportedIdentityObjectTypes property.
+ *
+ * @param value
+ * allowed object is
+ * {@link SupportedIdentityObjectTypesType }
+ *
+ */
+ public void setSupportedIdentityObjectTypes(SupportedIdentityObjectTypesType value)
{
+ this.supportedIdentityObjectTypes = value;
+ }
+
+ /**
+ * Gets the value of the options property.
+ *
+ * @return
+ * possible object is
+ * {@link IdentityStoreConfigurationType.Options }
+ *
+ */
+ public IdentityStoreConfigurationType.Options getOptions() {
+ return options;
+ }
+
+ /**
+ * Sets the value of the options property.
+ *
+ * @param value
+ * allowed object is
+ * {@link IdentityStoreConfigurationType.Options }
+ *
+ */
+ public void setOptions(IdentityStoreConfigurationType.Options value) {
+ this.options = value;
+ }
+
+
+ /**
+ * <p>Java class for anonymous complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained
within this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="option"
type="{urn:jboss:identity:config:v0_1}optionType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "option"
+ })
+ public static class Options {
+
+ protected List<OptionType> option;
+
+ /**
+ * Gets the value of the option property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the option
property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getOption().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link OptionType }
+ *
+ *
+ */
+ public List<OptionType> getOption() {
+ if (option == null) {
+ option = new ArrayList<OptionType>();
+ }
+ return this.option;
+ }
+
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for identity-store-mappingType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="identity-store-mappingType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="identity-store-id"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="identity-object-types"
type="{urn:jboss:identity:config:v0_1}identity-object-typesType"/>
+ * <element name="options"
type="{urn:jboss:identity:config:v0_1}optionsType"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "identity-store-mappingType", propOrder = {
+ "identityStoreId",
+ "identityObjectTypes",
+ "options"
+})
+public class IdentityStoreMappingType {
+
+ @XmlElement(name = "identity-store-id", required = true)
+ protected String identityStoreId;
+ @XmlElement(name = "identity-object-types", required = true)
+ protected IdentityObjectTypesType identityObjectTypes;
+ @XmlElement(required = true)
+ protected OptionsType options;
+
+ /**
+ * Gets the value of the identityStoreId property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIdentityStoreId() {
+ return identityStoreId;
+ }
+
+ /**
+ * Sets the value of the identityStoreId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIdentityStoreId(String value) {
+ this.identityStoreId = value;
+ }
+
+ /**
+ * Gets the value of the identityObjectTypes property.
+ *
+ * @return
+ * possible object is
+ * {@link IdentityObjectTypesType }
+ *
+ */
+ public IdentityObjectTypesType getIdentityObjectTypes() {
+ return identityObjectTypes;
+ }
+
+ /**
+ * Sets the value of the identityObjectTypes property.
+ *
+ * @param value
+ * allowed object is
+ * {@link IdentityObjectTypesType }
+ *
+ */
+ public void setIdentityObjectTypes(IdentityObjectTypesType value) {
+ this.identityObjectTypes = value;
+ }
+
+ /**
+ * Gets the value of the options property.
+ *
+ * @return
+ * possible object is
+ * {@link OptionsType }
+ *
+ */
+ public OptionsType getOptions() {
+ return options;
+ }
+
+ /**
+ * Sets the value of the options property.
+ *
+ * @param value
+ * allowed object is
+ * {@link OptionsType }
+ *
+ */
+ public void setOptions(OptionsType value) {
+ this.options = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingsType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingsType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreMappingsType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for identity-store-mappingsType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="identity-store-mappingsType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="identity-store-mapping"
type="{urn:jboss:identity:config:v0_1}identity-store-mappingType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "identity-store-mappingsType", propOrder = {
+ "identityStoreMapping"
+})
+public class IdentityStoreMappingsType {
+
+ @XmlElement(name = "identity-store-mapping")
+ protected List<IdentityStoreMappingType> identityStoreMapping;
+
+ /**
+ * Gets the value of the identityStoreMapping property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the
identityStoreMapping property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getIdentityStoreMapping().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link IdentityStoreMappingType }
+ *
+ *
+ */
+ public List<IdentityStoreMappingType> getIdentityStoreMapping() {
+ if (identityStoreMapping == null) {
+ identityStoreMapping = new ArrayList<IdentityStoreMappingType>();
+ }
+ return this.identityStoreMapping;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoreType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for identity-storeType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="identity-storeType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="id"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="class"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="identity-store-configuration"
type="{urn:jboss:identity:config:v0_1}identity-store-configurationType"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "identity-storeType", propOrder = {
+ "id",
+ "clazz",
+ "identityStoreConfiguration"
+})
+public class IdentityStoreType {
+
+ @XmlElement(required = true)
+ protected String id;
+ @XmlElement(name = "class", required = true)
+ protected String clazz;
+ @XmlElement(name = "identity-store-configuration", required = true)
+ protected IdentityStoreConfigurationType identityStoreConfiguration;
+
+ /**
+ * Gets the value of the id property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Sets the value of the id property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setId(String value) {
+ this.id = value;
+ }
+
+ /**
+ * Gets the value of the clazz property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getClazz() {
+ return clazz;
+ }
+
+ /**
+ * Sets the value of the clazz property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setClazz(String value) {
+ this.clazz = value;
+ }
+
+ /**
+ * Gets the value of the identityStoreConfiguration property.
+ *
+ * @return
+ * possible object is
+ * {@link IdentityStoreConfigurationType }
+ *
+ */
+ public IdentityStoreConfigurationType getIdentityStoreConfiguration() {
+ return identityStoreConfiguration;
+ }
+
+ /**
+ * Sets the value of the identityStoreConfiguration property.
+ *
+ * @param value
+ * allowed object is
+ * {@link IdentityStoreConfigurationType }
+ *
+ */
+ public void setIdentityStoreConfiguration(IdentityStoreConfigurationType value) {
+ this.identityStoreConfiguration = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoresType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoresType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityStoresType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for identity-storesType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="identity-storesType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="identity-store"
type="{urn:jboss:identity:config:v0_1}identity-storeType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "identity-storesType", propOrder = {
+ "identityStore"
+})
+public class IdentityStoresType {
+
+ @XmlElement(name = "identity-store")
+ protected List<IdentityStoreType> identityStore;
+
+ /**
+ * Gets the value of the identityStore property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the
identityStore property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getIdentityStore().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link IdentityStoreType }
+ *
+ *
+ */
+ public List<IdentityStoreType> getIdentityStore() {
+ if (identityStore == null) {
+ identityStore = new ArrayList<IdentityStoreType>();
+ }
+ return this.identityStore;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityTypeMappingsType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityTypeMappingsType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/IdentityTypeMappingsType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,104 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for identity-type-mappingsType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="identity-type-mappingsType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="identity-mapping"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="group-type-mapping"
type="{urn:jboss:identity:config:v0_1}group-type-mappingType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "identity-type-mappingsType", propOrder = {
+ "identityMapping",
+ "groupTypeMapping"
+})
+public class IdentityTypeMappingsType {
+
+ @XmlElement(name = "identity-mapping", required = true)
+ protected String identityMapping;
+ @XmlElement(name = "group-type-mapping")
+ protected List<GroupTypeMappingType> groupTypeMapping;
+
+ /**
+ * Gets the value of the identityMapping property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIdentityMapping() {
+ return identityMapping;
+ }
+
+ /**
+ * Sets the value of the identityMapping property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIdentityMapping(String value) {
+ this.identityMapping = value;
+ }
+
+ /**
+ * Gets the value of the groupTypeMapping property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the
groupTypeMapping property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getGroupTypeMapping().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link GroupTypeMappingType }
+ *
+ *
+ */
+ public List<GroupTypeMappingType> getGroupTypeMapping() {
+ if (groupTypeMapping == null) {
+ groupTypeMapping = new ArrayList<GroupTypeMappingType>();
+ }
+ return this.groupTypeMapping;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/JbossIdentityType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/JbossIdentityType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/JbossIdentityType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for jboss-identityType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="jboss-identityType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="realms"
type="{urn:jboss:identity:config:v0_1}realmsType"/>
+ * <element name="repositories"
type="{urn:jboss:identity:config:v0_1}repositoriesType"/>
+ * <element name="stores"
type="{urn:jboss:identity:config:v0_1}storesType"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "jboss-identityType", propOrder = {
+ "realms",
+ "repositories",
+ "stores"
+})
+public class JbossIdentityType {
+
+ @XmlElement(required = true)
+ protected RealmsType realms;
+ @XmlElement(required = true)
+ protected RepositoriesType repositories;
+ @XmlElement(required = true)
+ protected StoresType stores;
+
+ /**
+ * Gets the value of the realms property.
+ *
+ * @return
+ * possible object is
+ * {@link RealmsType }
+ *
+ */
+ public RealmsType getRealms() {
+ return realms;
+ }
+
+ /**
+ * Sets the value of the realms property.
+ *
+ * @param value
+ * allowed object is
+ * {@link RealmsType }
+ *
+ */
+ public void setRealms(RealmsType value) {
+ this.realms = value;
+ }
+
+ /**
+ * Gets the value of the repositories property.
+ *
+ * @return
+ * possible object is
+ * {@link RepositoriesType }
+ *
+ */
+ public RepositoriesType getRepositories() {
+ return repositories;
+ }
+
+ /**
+ * Sets the value of the repositories property.
+ *
+ * @param value
+ * allowed object is
+ * {@link RepositoriesType }
+ *
+ */
+ public void setRepositories(RepositoriesType value) {
+ this.repositories = value;
+ }
+
+ /**
+ * Gets the value of the stores property.
+ *
+ * @return
+ * possible object is
+ * {@link StoresType }
+ *
+ */
+ public StoresType getStores() {
+ return stores;
+ }
+
+ /**
+ * Sets the value of the stores property.
+ *
+ * @param value
+ * allowed object is
+ * {@link StoresType }
+ *
+ */
+ public void setStores(StoresType value) {
+ this.stores = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ObjectFactory.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ObjectFactory.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/ObjectFactory.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,292 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.identity.impl.configuration.jaxb2.generated package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _JbossIdentity_QNAME = new
QName("urn:jboss:identity:config:v0_1", "jboss-identity");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema
derived classes for package: org.jboss.identity.impl.configuration.jaxb2.generated
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link IdentityStoreMappingType }
+ *
+ */
+ public IdentityStoreMappingType createIdentityStoreMappingType() {
+ return new IdentityStoreMappingType();
+ }
+
+ /**
+ * Create an instance of {@link IdentityStoreType }
+ *
+ */
+ public IdentityStoreType createIdentityStoreType() {
+ return new IdentityStoreType();
+ }
+
+ /**
+ * Create an instance of {@link IdentityTypeMappingsType }
+ *
+ */
+ public IdentityTypeMappingsType createIdentityTypeMappingsType() {
+ return new IdentityTypeMappingsType();
+ }
+
+ /**
+ * Create an instance of {@link OptionType }
+ *
+ */
+ public OptionType createOptionType() {
+ return new OptionType();
+ }
+
+ /**
+ * Create an instance of {@link AttributeType }
+ *
+ */
+ public AttributeType createAttributeType() {
+ return new AttributeType();
+ }
+
+ /**
+ * Create an instance of {@link RepositoryType }
+ *
+ */
+ public RepositoryType createRepositoryType() {
+ return new RepositoryType();
+ }
+
+ /**
+ * Create an instance of {@link IdentityObjectTypeType.Options }
+ *
+ */
+ public IdentityObjectTypeType.Options createIdentityObjectTypeTypeOptions() {
+ return new IdentityObjectTypeType.Options();
+ }
+
+ /**
+ * Create an instance of {@link IdentityObjectTypesType }
+ *
+ */
+ public IdentityObjectTypesType createIdentityObjectTypesType() {
+ return new IdentityObjectTypesType();
+ }
+
+ /**
+ * Create an instance of {@link StoresType }
+ *
+ */
+ public StoresType createStoresType() {
+ return new StoresType();
+ }
+
+ /**
+ * Create an instance of {@link RealmConfigurationType }
+ *
+ */
+ public RealmConfigurationType createRealmConfigurationType() {
+ return new RealmConfigurationType();
+ }
+
+ /**
+ * Create an instance of {@link OptionsType }
+ *
+ */
+ public OptionsType createOptionsType() {
+ return new OptionsType();
+ }
+
+ /**
+ * Create an instance of {@link RealmType }
+ *
+ */
+ public RealmType createRealmType() {
+ return new RealmType();
+ }
+
+ /**
+ * Create an instance of {@link RelationshipType }
+ *
+ */
+ public RelationshipType createRelationshipType() {
+ return new RelationshipType();
+ }
+
+ /**
+ * Create an instance of {@link IdentityStoreConfigurationType }
+ *
+ */
+ public IdentityStoreConfigurationType createIdentityStoreConfigurationType() {
+ return new IdentityStoreConfigurationType();
+ }
+
+ /**
+ * Create an instance of {@link IdentityObjectTypeType.Relationships }
+ *
+ */
+ public IdentityObjectTypeType.Relationships
createIdentityObjectTypeTypeRelationships() {
+ return new IdentityObjectTypeType.Relationships();
+ }
+
+ /**
+ * Create an instance of {@link AttributesType }
+ *
+ */
+ public AttributesType createAttributesType() {
+ return new AttributesType();
+ }
+
+ /**
+ * Create an instance of {@link IdentityObjectTypeType }
+ *
+ */
+ public IdentityObjectTypeType createIdentityObjectTypeType() {
+ return new IdentityObjectTypeType();
+ }
+
+ /**
+ * Create an instance of {@link RealmsType }
+ *
+ */
+ public RealmsType createRealmsType() {
+ return new RealmsType();
+ }
+
+ /**
+ * Create an instance of {@link SupportedIdentityObjectTypesType }
+ *
+ */
+ public SupportedIdentityObjectTypesType createSupportedIdentityObjectTypesType() {
+ return new SupportedIdentityObjectTypesType();
+ }
+
+ /**
+ * Create an instance of {@link IdentityStoresType }
+ *
+ */
+ public IdentityStoresType createIdentityStoresType() {
+ return new IdentityStoresType();
+ }
+
+ /**
+ * Create an instance of {@link SupportedRelationshipTypesType }
+ *
+ */
+ public SupportedRelationshipTypesType createSupportedRelationshipTypesType() {
+ return new SupportedRelationshipTypesType();
+ }
+
+ /**
+ * Create an instance of {@link GroupTypeMappingType }
+ *
+ */
+ public GroupTypeMappingType createGroupTypeMappingType() {
+ return new GroupTypeMappingType();
+ }
+
+ /**
+ * Create an instance of {@link JbossIdentityType }
+ *
+ */
+ public JbossIdentityType createJbossIdentityType() {
+ return new JbossIdentityType();
+ }
+
+ /**
+ * Create an instance of {@link IdentityObjectTypeType.Attributes }
+ *
+ */
+ public IdentityObjectTypeType.Attributes createIdentityObjectTypeTypeAttributes() {
+ return new IdentityObjectTypeType.Attributes();
+ }
+
+ /**
+ * Create an instance of {@link RelationshipsType }
+ *
+ */
+ public RelationshipsType createRelationshipsType() {
+ return new RelationshipsType();
+ }
+
+ /**
+ * Create an instance of {@link RepositoriesType }
+ *
+ */
+ public RepositoriesType createRepositoriesType() {
+ return new RepositoriesType();
+ }
+
+ /**
+ * Create an instance of {@link IdentityStoreMappingsType }
+ *
+ */
+ public IdentityStoreMappingsType createIdentityStoreMappingsType() {
+ return new IdentityStoreMappingsType();
+ }
+
+ /**
+ * Create an instance of {@link RepositoryConfigurationType }
+ *
+ */
+ public RepositoryConfigurationType createRepositoryConfigurationType() {
+ return new RepositoryConfigurationType();
+ }
+
+ /**
+ * Create an instance of {@link IdentityStoreConfigurationType.Options }
+ *
+ */
+ public IdentityStoreConfigurationType.Options
createIdentityStoreConfigurationTypeOptions() {
+ return new IdentityStoreConfigurationType.Options();
+ }
+
+ /**
+ * Create an instance of {@link ExternalConfigType }
+ *
+ */
+ public ExternalConfigType createExternalConfigType() {
+ return new ExternalConfigType();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link JbossIdentityType
}{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:jboss:identity:config:v0_1", name =
"jboss-identity")
+ public JAXBElement<JbossIdentityType> createJbossIdentity(JbossIdentityType
value) {
+ return new JAXBElement<JbossIdentityType>(_JbossIdentity_QNAME,
JbossIdentityType.class, null, value);
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,103 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for optionType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="optionType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="name"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="value"
type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"
minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "optionType", propOrder = {
+ "name",
+ "value"
+})
+public class OptionType {
+
+ @XmlElement(required = true)
+ protected String name;
+ protected List<String> value;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the value property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the value
property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getValue().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link String }
+ *
+ *
+ */
+ public List<String> getValue() {
+ if (value == null) {
+ value = new ArrayList<String>();
+ }
+ return this.value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionsType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionsType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/OptionsType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,74 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for optionsType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="optionsType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="option"
type="{urn:jboss:identity:config:v0_1}optionType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "optionsType", propOrder = {
+ "option"
+})
+public class OptionsType {
+
+ protected List<OptionType> option;
+
+ /**
+ * Gets the value of the option property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the option
property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getOption().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link OptionType }
+ *
+ *
+ */
+ public List<OptionType> getOption() {
+ if (option == null) {
+ option = new ArrayList<OptionType>();
+ }
+ return this.option;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmConfigurationType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmConfigurationType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmConfigurationType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,96 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for realm-configurationType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="realm-configurationType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="identity-type-mappings"
type="{urn:jboss:identity:config:v0_1}identity-type-mappingsType"
minOccurs="0"/>
+ * <element name="options"
type="{urn:jboss:identity:config:v0_1}optionsType" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "realm-configurationType", propOrder = {
+ "identityTypeMappings",
+ "options"
+})
+public class RealmConfigurationType {
+
+ @XmlElement(name = "identity-type-mappings")
+ protected IdentityTypeMappingsType identityTypeMappings;
+ protected OptionsType options;
+
+ /**
+ * Gets the value of the identityTypeMappings property.
+ *
+ * @return
+ * possible object is
+ * {@link IdentityTypeMappingsType }
+ *
+ */
+ public IdentityTypeMappingsType getIdentityTypeMappings() {
+ return identityTypeMappings;
+ }
+
+ /**
+ * Sets the value of the identityTypeMappings property.
+ *
+ * @param value
+ * allowed object is
+ * {@link IdentityTypeMappingsType }
+ *
+ */
+ public void setIdentityTypeMappings(IdentityTypeMappingsType value) {
+ this.identityTypeMappings = value;
+ }
+
+ /**
+ * Gets the value of the options property.
+ *
+ * @return
+ * possible object is
+ * {@link OptionsType }
+ *
+ */
+ public OptionsType getOptions() {
+ return options;
+ }
+
+ /**
+ * Sets the value of the options property.
+ *
+ * @param value
+ * allowed object is
+ * {@link OptionsType }
+ *
+ */
+ public void setOptions(OptionsType value) {
+ this.options = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for realmType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="realmType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="id"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="repository-id-ref"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="realm-configuration"
type="{urn:jboss:identity:config:v0_1}realm-configurationType"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "realmType", propOrder = {
+ "id",
+ "repositoryIdRef",
+ "realmConfiguration"
+})
+public class RealmType {
+
+ @XmlElement(required = true)
+ protected String id;
+ @XmlElement(name = "repository-id-ref", required = true)
+ protected String repositoryIdRef;
+ @XmlElement(name = "realm-configuration", required = true)
+ protected RealmConfigurationType realmConfiguration;
+
+ /**
+ * Gets the value of the id property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Sets the value of the id property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setId(String value) {
+ this.id = value;
+ }
+
+ /**
+ * Gets the value of the repositoryIdRef property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRepositoryIdRef() {
+ return repositoryIdRef;
+ }
+
+ /**
+ * Sets the value of the repositoryIdRef property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRepositoryIdRef(String value) {
+ this.repositoryIdRef = value;
+ }
+
+ /**
+ * Gets the value of the realmConfiguration property.
+ *
+ * @return
+ * possible object is
+ * {@link RealmConfigurationType }
+ *
+ */
+ public RealmConfigurationType getRealmConfiguration() {
+ return realmConfiguration;
+ }
+
+ /**
+ * Sets the value of the realmConfiguration property.
+ *
+ * @param value
+ * allowed object is
+ * {@link RealmConfigurationType }
+ *
+ */
+ public void setRealmConfiguration(RealmConfigurationType value) {
+ this.realmConfiguration = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmsType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmsType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RealmsType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,74 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for realmsType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="realmsType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="realm"
type="{urn:jboss:identity:config:v0_1}realmType" maxOccurs="unbounded"
minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "realmsType", propOrder = {
+ "realm"
+})
+public class RealmsType {
+
+ protected List<RealmType> realm;
+
+ /**
+ * Gets the value of the realm property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the realm
property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getRealm().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link RealmType }
+ *
+ *
+ */
+ public List<RealmType> getRealm() {
+ if (realm == null) {
+ realm = new ArrayList<RealmType>();
+ }
+ return this.realm;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,97 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for relationshipType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="relationshipType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="relationship-type-ref"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="identity-object-type-ref"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "relationshipType", propOrder = {
+ "relationshipTypeRef",
+ "identityObjectTypeRef"
+})
+public class RelationshipType {
+
+ @XmlElement(name = "relationship-type-ref", required = true)
+ protected String relationshipTypeRef;
+ @XmlElement(name = "identity-object-type-ref", required = true)
+ protected String identityObjectTypeRef;
+
+ /**
+ * Gets the value of the relationshipTypeRef property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRelationshipTypeRef() {
+ return relationshipTypeRef;
+ }
+
+ /**
+ * Sets the value of the relationshipTypeRef property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRelationshipTypeRef(String value) {
+ this.relationshipTypeRef = value;
+ }
+
+ /**
+ * Gets the value of the identityObjectTypeRef property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIdentityObjectTypeRef() {
+ return identityObjectTypeRef;
+ }
+
+ /**
+ * Sets the value of the identityObjectTypeRef property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIdentityObjectTypeRef(String value) {
+ this.identityObjectTypeRef = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipsType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipsType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RelationshipsType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,74 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for relationshipsType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="relationshipsType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="relationship"
type="{urn:jboss:identity:config:v0_1}relationshipType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "relationshipsType", propOrder = {
+ "relationship"
+})
+public class RelationshipsType {
+
+ protected List<RelationshipType> relationship;
+
+ /**
+ * Gets the value of the relationship property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the
relationship property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getRelationship().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link RelationshipType }
+ *
+ *
+ */
+ public List<RelationshipType> getRelationship() {
+ if (relationship == null) {
+ relationship = new ArrayList<RelationshipType>();
+ }
+ return this.relationship;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoriesType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoriesType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoriesType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,74 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for repositoriesType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="repositoriesType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="repository"
type="{urn:jboss:identity:config:v0_1}repositoryType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "repositoriesType", propOrder = {
+ "repository"
+})
+public class RepositoriesType {
+
+ protected List<RepositoryType> repository;
+
+ /**
+ * Gets the value of the repository property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the repository
property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getRepository().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link RepositoryType }
+ *
+ *
+ */
+ public List<RepositoryType> getRepository() {
+ if (repository == null) {
+ repository = new ArrayList<RepositoryType>();
+ }
+ return this.repository;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryConfigurationType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryConfigurationType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryConfigurationType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,180 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for repository-configurationType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="repository-configurationType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="external-config"
type="{urn:jboss:identity:config:v0_1}external-configType"
minOccurs="0"/>
+ * <element name="default-identity-store-id"
type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="default-attribute-store-id"
type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="identity-store-mappings"
type="{urn:jboss:identity:config:v0_1}identity-store-mappingsType"
minOccurs="0"/>
+ * <element name="options"
type="{urn:jboss:identity:config:v0_1}optionsType" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "repository-configurationType", propOrder = {
+ "externalConfig",
+ "defaultIdentityStoreId",
+ "defaultAttributeStoreId",
+ "identityStoreMappings",
+ "options"
+})
+public class RepositoryConfigurationType {
+
+ @XmlElement(name = "external-config")
+ protected ExternalConfigType externalConfig;
+ @XmlElement(name = "default-identity-store-id")
+ protected String defaultIdentityStoreId;
+ @XmlElement(name = "default-attribute-store-id")
+ protected String defaultAttributeStoreId;
+ @XmlElement(name = "identity-store-mappings")
+ protected IdentityStoreMappingsType identityStoreMappings;
+ protected OptionsType options;
+
+ /**
+ * Gets the value of the externalConfig property.
+ *
+ * @return
+ * possible object is
+ * {@link ExternalConfigType }
+ *
+ */
+ public ExternalConfigType getExternalConfig() {
+ return externalConfig;
+ }
+
+ /**
+ * Sets the value of the externalConfig property.
+ *
+ * @param value
+ * allowed object is
+ * {@link ExternalConfigType }
+ *
+ */
+ public void setExternalConfig(ExternalConfigType value) {
+ this.externalConfig = value;
+ }
+
+ /**
+ * Gets the value of the defaultIdentityStoreId property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDefaultIdentityStoreId() {
+ return defaultIdentityStoreId;
+ }
+
+ /**
+ * Sets the value of the defaultIdentityStoreId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDefaultIdentityStoreId(String value) {
+ this.defaultIdentityStoreId = value;
+ }
+
+ /**
+ * Gets the value of the defaultAttributeStoreId property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDefaultAttributeStoreId() {
+ return defaultAttributeStoreId;
+ }
+
+ /**
+ * Sets the value of the defaultAttributeStoreId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDefaultAttributeStoreId(String value) {
+ this.defaultAttributeStoreId = value;
+ }
+
+ /**
+ * Gets the value of the identityStoreMappings property.
+ *
+ * @return
+ * possible object is
+ * {@link IdentityStoreMappingsType }
+ *
+ */
+ public IdentityStoreMappingsType getIdentityStoreMappings() {
+ return identityStoreMappings;
+ }
+
+ /**
+ * Sets the value of the identityStoreMappings property.
+ *
+ * @param value
+ * allowed object is
+ * {@link IdentityStoreMappingsType }
+ *
+ */
+ public void setIdentityStoreMappings(IdentityStoreMappingsType value) {
+ this.identityStoreMappings = value;
+ }
+
+ /**
+ * Gets the value of the options property.
+ *
+ * @return
+ * possible object is
+ * {@link OptionsType }
+ *
+ */
+ public OptionsType getOptions() {
+ return options;
+ }
+
+ /**
+ * Sets the value of the options property.
+ *
+ * @param value
+ * allowed object is
+ * {@link OptionsType }
+ *
+ */
+ public void setOptions(OptionsType value) {
+ this.options = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/RepositoryType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for repositoryType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="repositoryType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="id"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="class"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="repository-configuration"
type="{urn:jboss:identity:config:v0_1}repository-configurationType"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "repositoryType", propOrder = {
+ "id",
+ "clazz",
+ "repositoryConfiguration"
+})
+public class RepositoryType {
+
+ @XmlElement(required = true)
+ protected String id;
+ @XmlElement(name = "class", required = true)
+ protected String clazz;
+ @XmlElement(name = "repository-configuration", required = true)
+ protected RepositoryConfigurationType repositoryConfiguration;
+
+ /**
+ * Gets the value of the id property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Sets the value of the id property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setId(String value) {
+ this.id = value;
+ }
+
+ /**
+ * Gets the value of the clazz property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getClazz() {
+ return clazz;
+ }
+
+ /**
+ * Sets the value of the clazz property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setClazz(String value) {
+ this.clazz = value;
+ }
+
+ /**
+ * Gets the value of the repositoryConfiguration property.
+ *
+ * @return
+ * possible object is
+ * {@link RepositoryConfigurationType }
+ *
+ */
+ public RepositoryConfigurationType getRepositoryConfiguration() {
+ return repositoryConfiguration;
+ }
+
+ /**
+ * Sets the value of the repositoryConfiguration property.
+ *
+ * @param value
+ * allowed object is
+ * {@link RepositoryConfigurationType }
+ *
+ */
+ public void setRepositoryConfiguration(RepositoryConfigurationType value) {
+ this.repositoryConfiguration = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/StoresType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/StoresType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/StoresType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,97 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for storesType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="storesType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="attribute-stores"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="identity-stores"
type="{urn:jboss:identity:config:v0_1}identity-storesType"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "storesType", propOrder = {
+ "attributeStores",
+ "identityStores"
+})
+public class StoresType {
+
+ @XmlElement(name = "attribute-stores", required = true)
+ protected String attributeStores;
+ @XmlElement(name = "identity-stores", required = true)
+ protected IdentityStoresType identityStores;
+
+ /**
+ * Gets the value of the attributeStores property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAttributeStores() {
+ return attributeStores;
+ }
+
+ /**
+ * Sets the value of the attributeStores property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setAttributeStores(String value) {
+ this.attributeStores = value;
+ }
+
+ /**
+ * Gets the value of the identityStores property.
+ *
+ * @return
+ * possible object is
+ * {@link IdentityStoresType }
+ *
+ */
+ public IdentityStoresType getIdentityStores() {
+ return identityStores;
+ }
+
+ /**
+ * Sets the value of the identityStores property.
+ *
+ * @param value
+ * allowed object is
+ * {@link IdentityStoresType }
+ *
+ */
+ public void setIdentityStores(IdentityStoresType value) {
+ this.identityStores = value;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedIdentityObjectTypesType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedIdentityObjectTypesType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedIdentityObjectTypesType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for supported-identity-object-typesType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="supported-identity-object-typesType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="identity-object-type"
type="{urn:jboss:identity:config:v0_1}identity-object-typeType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "supported-identity-object-typesType", propOrder = {
+ "identityObjectType"
+})
+public class SupportedIdentityObjectTypesType {
+
+ @XmlElement(name = "identity-object-type")
+ protected List<IdentityObjectTypeType> identityObjectType;
+
+ /**
+ * Gets the value of the identityObjectType property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the
identityObjectType property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getIdentityObjectType().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link IdentityObjectTypeType }
+ *
+ *
+ */
+ public List<IdentityObjectTypeType> getIdentityObjectType() {
+ if (identityObjectType == null) {
+ identityObjectType = new ArrayList<IdentityObjectTypeType>();
+ }
+ return this.identityObjectType;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedRelationshipTypesType.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedRelationshipTypesType.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/SupportedRelationshipTypesType.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+
+package org.jboss.identity.impl.configuration.jaxb2.generated;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for supported-relationship-typesType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="supported-relationship-typesType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="relationship-type"
type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"
minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "supported-relationship-typesType", propOrder = {
+ "relationshipType"
+})
+public class SupportedRelationshipTypesType {
+
+ @XmlElement(name = "relationship-type")
+ protected List<String> relationshipType;
+
+ /**
+ * Gets the value of the relationshipType property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the
relationshipType property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getRelationshipType().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link String }
+ *
+ *
+ */
+ public List<String> getRelationshipType() {
+ if (relationshipType == null) {
+ relationshipType = new ArrayList<String>();
+ }
+ return this.relationshipType;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/package-info.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/package-info.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/jaxb2/generated/package-info.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2008.11.06 at 01:23:39 PM CET
+//
+
+(a)javax.xml.bind.annotation.XmlSchema(namespace =
"urn:jboss:identity:config:v0_1", elementFormDefault =
javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.jboss.identity.impl.configuration.jaxb2.generated;
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityConfigurationMetaDataImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityConfigurationMetaDataImpl.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityConfigurationMetaDataImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,115 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.configuration.metadata;
+
+import org.jboss.identity.spi.configuration.metadata.IdentityConfigurationMetaData;
+import
org.jboss.identity.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
+import org.jboss.identity.spi.configuration.metadata.RealmConfigurationMetaData;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
+
+import java.util.List;
+import java.util.Map;
+import java.util.LinkedList;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentityConfigurationMetaDataImpl implements IdentityConfigurationMetaData
+{
+
+ private List<RealmConfigurationMetaData> realms = new
LinkedList<RealmConfigurationMetaData>();
+
+ private List<IdentityRepositoryConfigurationMetaData> repositories = new
LinkedList<IdentityRepositoryConfigurationMetaData>();
+
+ private List<IdentityStoreConfigurationMetaData> identityStores = new
LinkedList<IdentityStoreConfigurationMetaData>();
+
+ private Map<String, List<String>> options = new HashMap<String,
List<String>>();
+
+ public IdentityConfigurationMetaDataImpl()
+ {
+ }
+
+ public List<RealmConfigurationMetaData> getRealms()
+ {
+ return realms;
+ }
+
+ public void setRealms(List<RealmConfigurationMetaData> realms)
+ {
+ this.realms = realms;
+ }
+
+ public List<IdentityRepositoryConfigurationMetaData> getRepositories()
+ {
+ return repositories;
+ }
+
+ public void setRepositories(List<IdentityRepositoryConfigurationMetaData>
repositories)
+ {
+ this.repositories = repositories;
+ }
+
+ public List<IdentityStoreConfigurationMetaData> getIdentityStores()
+ {
+ return identityStores;
+ }
+
+ public void setIdentityStores(List<IdentityStoreConfigurationMetaData>
identityStores)
+ {
+ this.identityStores = identityStores;
+ }
+
+ public Map<String, List<String>> getOptions()
+ {
+ return options;
+ }
+
+ public void setOptions(Map<String, List<String>> options)
+ {
+ this.options = options;
+ }
+
+ List<String> getOption(String optionName)
+ {
+ if (options != null )
+ {
+ return options.get(optionName);
+ }
+
+ return null;
+ }
+
+ String getOptionSingleValue(String optionName)
+ {
+ List<String> values = getOption(optionName);
+
+ if (values != null && values.size() > 0)
+ {
+ return values.get(0);
+ }
+
+ return null;
+ }
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityObjectTypeMetaDataImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityObjectTypeMetaDataImpl.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityObjectTypeMetaDataImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,112 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.configuration.metadata;
+
+import org.jboss.identity.spi.attribute.AttributeMetaData;
+import org.jboss.identity.spi.configuration.metadata.IdentityObjectTypeMetaData;
+import org.jboss.identity.spi.configuration.metadata.RelationshipMetaData;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentityObjectTypeMetaDataImpl implements IdentityObjectTypeMetaData
+{
+
+ private String name;
+
+ private List<RelationshipMetaData> relationships;
+
+ private List<AttributeMetaData> attributes;
+
+ private Map<String, List<String>> options;
+
+ public IdentityObjectTypeMetaDataImpl()
+ {
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public List<RelationshipMetaData> getRelationships()
+ {
+ return relationships;
+ }
+
+ public void setRelationships(List<RelationshipMetaData> relationships)
+ {
+ this.relationships = relationships;
+ }
+
+ public List<AttributeMetaData> getAttributes()
+ {
+ return attributes;
+ }
+
+ public void setAttributes(List<AttributeMetaData> attributes)
+ {
+ this.attributes = attributes;
+ }
+
+ public Map<String, List<String>> getOptions()
+ {
+ return options;
+ }
+
+ public void setOptions(Map<String, List<String>> options)
+ {
+ this.options = options;
+ }
+
+ public List<String> getOption(String optionName)
+ {
+ if (options != null )
+ {
+ return options.get(optionName);
+ }
+
+ return null;
+ }
+
+ public String getOptionSingleValue(String optionName)
+ {
+ List<String> values = getOption(optionName);
+
+ if (values != null && values.size() > 0)
+ {
+ return values.get(0);
+ }
+
+ return null;
+ }
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityRepositoryConfigurationMetaDataImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityRepositoryConfigurationMetaDataImpl.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityRepositoryConfigurationMetaDataImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,149 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.configuration.metadata;
+
+import
org.jboss.identity.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreMappingMetaData;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentityRepositoryConfigurationMetaDataImpl implements
IdentityRepositoryConfigurationMetaData
+{
+
+ private String id;
+
+ private String className;
+
+ private String externalConfig;
+
+ private String defaultIdentityStoreId;
+
+ private String defaultAttributeStroeId;
+
+ private List<IdentityStoreMappingMetaData>
identityStoreToIdentityObjectTypeMappings;
+
+ private Map<String, List<String>> options;
+
+
+ public IdentityRepositoryConfigurationMetaDataImpl()
+ {
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+ public void setClassName(String className)
+ {
+ this.className = className;
+ }
+
+ public String getExternalConfig()
+ {
+ return externalConfig;
+ }
+
+ public void setExternalConfig(String externalConfig)
+ {
+ this.externalConfig = externalConfig;
+ }
+
+ public String getDefaultIdentityStoreId()
+ {
+ return defaultIdentityStoreId;
+ }
+
+ public void setDefaultIdentityStoreId(String defaultIdentityStoreId)
+ {
+ this.defaultIdentityStoreId = defaultIdentityStoreId;
+ }
+
+ public String getDefaultAttributeStroeId()
+ {
+ return defaultAttributeStroeId;
+ }
+
+ public void setDefaultAttributeStroeId(String defaultAttributeStroeId)
+ {
+ this.defaultAttributeStroeId = defaultAttributeStroeId;
+ }
+
+ public List<IdentityStoreMappingMetaData>
getIdentityStoreToIdentityObjectTypeMappings()
+ {
+ return identityStoreToIdentityObjectTypeMappings;
+ }
+
+ public void
setIdentityStoreToIdentityObjectTypeMappings(List<IdentityStoreMappingMetaData>
identityStoreToIdentityObjectTypeMappings)
+ {
+ this.identityStoreToIdentityObjectTypeMappings =
identityStoreToIdentityObjectTypeMappings;
+ }
+
+ public Map<String, List<String>> getOptions()
+ {
+ return options;
+ }
+
+ public void setOptions(Map<String, List<String>> options)
+ {
+ this.options = options;
+ }
+
+ public List<String> getOption(String optionName)
+ {
+ if (options != null )
+ {
+ return options.get(optionName);
+ }
+
+ return null;
+ }
+
+ public String getOptionSingleValue(String optionName)
+ {
+ List<String> values = getOption(optionName);
+
+ if (values != null && values.size() > 0)
+ {
+ return values.get(0);
+ }
+
+ return null;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityStoreConfigurationMetaDataImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityStoreConfigurationMetaDataImpl.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityStoreConfigurationMetaDataImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,139 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.configuration.metadata;
+
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
+import org.jboss.identity.spi.configuration.metadata.IdentityObjectTypeMetaData;
+
+import java.util.List;
+import java.util.Map;
+import java.util.LinkedList;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentityStoreConfigurationMetaDataImpl implements
IdentityStoreConfigurationMetaData
+{
+
+ private String id;
+
+ private String className;
+
+ private String externalConfig;
+
+ private List<String> supportedRelationshipTypes = new
LinkedList<String>();
+
+ private List<IdentityObjectTypeMetaData> supportedIdentityTypes = new
LinkedList<IdentityObjectTypeMetaData>();
+
+ private Map<String, List<String>> options = new HashMap<String,
List<String>>();
+
+
+ public IdentityStoreConfigurationMetaDataImpl()
+ {
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public String getClassName()
+ {
+ return className;
+ }
+
+ public void setClassName(String className)
+ {
+ this.className = className;
+ }
+
+ public String getExternalConfig()
+ {
+ return externalConfig;
+ }
+
+ public void setExternalConfig(String externalConfig)
+ {
+ this.externalConfig = externalConfig;
+ }
+
+ public List<String> getSupportedRelationshipTypes()
+ {
+ return supportedRelationshipTypes;
+ }
+
+ public void setSupportedRelationshipTypes(List<String>
supportedRelationshipTypes)
+ {
+ this.supportedRelationshipTypes = supportedRelationshipTypes;
+ }
+
+ public List<IdentityObjectTypeMetaData> getSupportedIdentityTypes()
+ {
+ return supportedIdentityTypes;
+ }
+
+ public void setSupportedIdentityTypes(List<IdentityObjectTypeMetaData>
supportedIdentityTypes)
+ {
+ this.supportedIdentityTypes = supportedIdentityTypes;
+ }
+
+ public Map<String, List<String>> getOptions()
+ {
+ return options;
+ }
+
+ public void setOptions(Map<String, List<String>> options)
+ {
+ this.options = options;
+ }
+
+ public List<String> getOption(String optionName)
+ {
+ if (options != null )
+ {
+ return options.get(optionName);
+ }
+
+ return null;
+ }
+
+ public String getOptionSingleValue(String optionName)
+ {
+ List<String> values = getOption(optionName);
+
+ if (values != null && values.size() > 0)
+ {
+ return values.get(0);
+ }
+
+ return null;
+ }
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityStoreMappingMetaDataImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityStoreMappingMetaDataImpl.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/IdentityStoreMappingMetaDataImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,101 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.configuration.metadata;
+
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreMappingMetaData;
+
+import java.util.List;
+import java.util.Map;
+import java.util.LinkedList;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentityStoreMappingMetaDataImpl implements IdentityStoreMappingMetaData
+{
+ private String identityStoreId;
+
+ private List<String> identityObjectTypeMappings = new
LinkedList<String>();
+
+ private Map<String, List<String>> options = new HashMap<String,
List<String>>();
+
+ public IdentityStoreMappingMetaDataImpl()
+ {
+ }
+
+ public void setIdentityStoreId(String identityStoreId)
+ {
+ this.identityStoreId = identityStoreId;
+ }
+
+ public void setIdentityObjectTypeMappings(List<String>
identityObjectTypeMappings)
+ {
+ this.identityObjectTypeMappings = identityObjectTypeMappings;
+ }
+
+ public void setOptions(Map<String, List<String>> options)
+ {
+ this.options = options;
+ }
+
+ public String getIdentityStoreId()
+ {
+ return identityStoreId;
+ }
+
+ public List<String> getIdentityObjectTypeMappings()
+ {
+ return identityObjectTypeMappings;
+ }
+
+ public Map<String, List<String>> getOptions()
+ {
+ return options;
+ }
+
+ public List<String> getOption(String optionName)
+ {
+ if (options != null )
+ {
+ return options.get(optionName);
+ }
+
+ return null;
+ }
+
+ public String getOptionSingleValue(String optionName)
+ {
+ List<String> values = getOption(optionName);
+
+ if (values != null && values.size() > 0)
+ {
+ return values.get(0);
+ }
+
+ return null;
+ }
+
+
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/RealmConfigurationMetaDataImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/RealmConfigurationMetaDataImpl.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/RealmConfigurationMetaDataImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,123 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.configuration.metadata;
+
+import org.jboss.identity.spi.configuration.metadata.RealmConfigurationMetaData;
+
+import java.util.Map;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class RealmConfigurationMetaDataImpl implements RealmConfigurationMetaData
+{
+
+ private String id;
+
+ private String identityRepositoryIdRef;
+
+ private String identityMapping;
+
+ private Map<String, String> groupTypeMappings;
+
+ private Map<String, List<String>> options;
+
+
+ public RealmConfigurationMetaDataImpl()
+ {
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public String getIdentityRepositoryIdRef()
+ {
+ return identityRepositoryIdRef;
+ }
+
+ public void setIdentityRepositoryIdRef(String identityRepositoryIdRef)
+ {
+ this.identityRepositoryIdRef = identityRepositoryIdRef;
+ }
+
+ public String getIdentityMapping()
+ {
+ return identityMapping;
+ }
+
+ public void setIdentityMapping(String identityMapping)
+ {
+ this.identityMapping = identityMapping;
+ }
+
+ public Map<String, String> getGroupTypeMappings()
+ {
+ return groupTypeMappings;
+ }
+
+ public void setGroupTypeMappings(Map<String, String> groupTypeMappings)
+ {
+ this.groupTypeMappings = groupTypeMappings;
+ }
+
+ public Map<String, List<String>> getOptions()
+ {
+ return options;
+ }
+
+ public void setOptions(Map<String, List<String>> options)
+ {
+ this.options = options;
+ }
+
+ List<String> getOption(String optionName)
+ {
+ if (options != null )
+ {
+ return options.get(optionName);
+ }
+
+ return null;
+ }
+
+ String getOptionSingleValue(String optionName)
+ {
+ List<String> values = getOption(optionName);
+
+ if (values != null && values.size() > 0)
+ {
+ return values.get(0);
+ }
+
+ return null;
+ }
+}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/RelationshipMetaDataImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/RelationshipMetaDataImpl.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/configuration/metadata/RelationshipMetaDataImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,62 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.configuration.metadata;
+
+import org.jboss.identity.spi.configuration.metadata.RelationshipMetaData;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class RelationshipMetaDataImpl implements RelationshipMetaData
+{
+
+ private String relationshipTypeRef;
+
+ private String identityObjectTypeRef;
+
+
+ public RelationshipMetaDataImpl()
+ {
+ }
+
+ public String getRelationshipTypeRef()
+ {
+ return relationshipTypeRef;
+ }
+
+ public void setRelationshipTypeRef(String relationshipTypeRef)
+ {
+ this.relationshipTypeRef = relationshipTypeRef;
+ }
+
+ public String getIdentityObjectTypeRef()
+ {
+ return identityObjectTypeRef;
+ }
+
+ public void setIdentityObjectTypeRef(String identityObjectTypeRef)
+ {
+ this.identityObjectTypeRef = identityObjectTypeRef;
+ }
+}
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/AbstractIdentityStoreRepository.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/AbstractIdentityStoreRepository.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/AbstractIdentityStoreRepository.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -28,12 +28,15 @@
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.model.IdentityObject;
+import
org.jboss.identity.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreMappingMetaData;
import org.jboss.identity.exception.IdentityException;
import java.util.Set;
import java.util.Map;
import java.util.HashSet;
-import java.util.Collections;
+import java.util.List;
+import java.util.HashMap;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
@@ -42,29 +45,34 @@
public abstract class AbstractIdentityStoreRepository implements IdentityStoreRepository
{
- private final Map<String, IdentityStore> identityStoreMappings;
+ protected Map<String, IdentityStore> identityStoreMappings = new
HashMap<String, IdentityStore>();
- private final Map<String, AttributeStore> attributeStoreMappings;
+ protected Map<String, AttributeStore> attributeStoreMappings = new
HashMap<String, AttributeStore>();
- public AbstractIdentityStoreRepository(Map<String, IdentityStore>
identityStoreMappings, Map<String, AttributeStore> attributeStoreMappings)
+ public void bootstrap(IdentityRepositoryConfigurationMetaData configurationMD,
+ Map<String, IdentityStore> bootstrappedIdentityStores,
+ Map<String, AttributeStore> bootstrappedAttributeStores)
throws IdentityException
{
- if (identityStoreMappings != null)
+
+ for (IdentityStoreMappingMetaData identityStoreMappingMetaData :
configurationMD.getIdentityStoreToIdentityObjectTypeMappings())
{
- this.identityStoreMappings =
Collections.unmodifiableMap(identityStoreMappings);
- }
- else
- {
- this.identityStoreMappings = null;
- }
+ String storeId = identityStoreMappingMetaData.getIdentityStoreId();
+ List<String> identityObjectTypeMappings =
identityStoreMappingMetaData.getIdentityObjectTypeMappings();
- if (attributeStoreMappings != null)
- {
- this.attributeStoreMappings =
Collections.unmodifiableMap(attributeStoreMappings);
+ IdentityStore store = bootstrappedIdentityStores.get(storeId);
+
+ if (store == null)
+ {
+ throw new IdentityException("Mapped IdentityStore not available: "
+ storeId);
+ }
+
+ for (String mapping : identityObjectTypeMappings)
+ {
+ identityStoreMappings.put(mapping, store);
+ attributeStoreMappings.put(mapping, store);
+ }
+
}
- else
- {
- this.attributeStoreMappings = null;
- }
}
@@ -98,7 +106,7 @@
return attributeStoreMappings.get(identityObjectType.getName());
}
- public boolean hasIdentityObject(IdentityStoreInvocationContext ctx, IdentityStore is,
IdentityObject io) throws IdentityException
+ protected boolean hasIdentityObject(IdentityStoreInvocationContext ctx, IdentityStore
is, IdentityObject io) throws IdentityException
{
try
{
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/FallbackIdentityStoreRepository.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -26,17 +26,21 @@
import org.jboss.identity.spi.store.AttributeStore;
import org.jboss.identity.spi.store.FeaturesMetaData;
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
+import org.jboss.identity.spi.store.IdentityStoreSession;
import org.jboss.identity.spi.model.IdentityObject;
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.spi.model.IdentityObjectRelationship;
import org.jboss.identity.spi.exception.OperationNotSupportedException;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
+import
org.jboss.identity.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
import org.jboss.identity.exception.IdentityException;
-import org.jboss.identity.impl.NotYetImplementedException;
+import org.jboss.identity.impl.store.SimpleIdentityStoreInvocationContext;
import java.util.Map;
import java.util.Collection;
import java.util.Set;
+import java.util.HashMap;
import java.io.IOException;
/**
@@ -47,28 +51,81 @@
*/
public class FallbackIdentityStoreRepository extends AbstractIdentityStoreRepository
{
+ private final String id;
- private final IdentityStore defaultIdentityStore;
+ private IdentityStore defaultIdentityStore;
- private final AttributeStore defaultAttributeStore;
+ private AttributeStore defaultAttributeStore;
- public FallbackIdentityStoreRepository(IdentityStore identityStore, AttributeStore
attributeStore,
- Map<String, IdentityStore>
identityStoreMappings, Map<String, AttributeStore> attributeStoreMappings)
+ //TODO: rewrite this to other config object?
+ private IdentityRepositoryConfigurationMetaData configurationMD;
+
+ public FallbackIdentityStoreRepository(String id)
{
- super(identityStoreMappings, attributeStoreMappings);
+ this.id = id;
+ }
- this.defaultIdentityStore = identityStore;
- this.defaultAttributeStore = attributeStore;
+ public void bootstrap(IdentityRepositoryConfigurationMetaData configurationMD,
+ Map<String, IdentityStore> bootstrappedIdentityStores,
+ Map<String, AttributeStore> bootstrappedAttributeStores)
throws IdentityException
+ {
+ super.bootstrap(configurationMD, bootstrappedIdentityStores,
bootstrappedAttributeStores);
+
+ this.configurationMD = configurationMD;
+
+ String asId = configurationMD.getDefaultAttributeStroeId();
+ String isId = configurationMD.getDefaultIdentityStoreId();
+
+ if (asId != null && bootstrappedAttributeStores.keySet().contains(asId))
+ {
+ defaultAttributeStore = bootstrappedAttributeStores.get(asId);
+ }
+
+ if (isId != null && bootstrappedIdentityStores.keySet().contains(isId))
+ {
+ defaultIdentityStore = bootstrappedIdentityStores.get(isId);
+ }
+
}
- public void bootstrap() throws IOException
+ public void bootstrap(IdentityStoreConfigurationMetaData configurationMD) throws
IdentityException
{
+ // Nothing
+ }
+ public IdentityStoreSession createIdentityStoreSession() throws IdentityException
+ {
+ Map<String, IdentityStoreSession> sessions = new HashMap<String,
IdentityStoreSession>();
+
+ for (IdentityStore identityStore : identityStoreMappings.values())
+ {
+ sessions.put(identityStore.getId(),
identityStore.createIdentityStoreSession());
+ }
+
+ for (AttributeStore attributeStore : attributeStoreMappings.values())
+ {
+ if (!sessions.containsKey(attributeStore.getId()))
+ {
+ sessions.put(attributeStore.getId(),
attributeStore.createIdentityStoreSession());
+ }
+ }
+
+ if (!sessions.containsKey(defaultAttributeStore.getId()))
+ {
+ sessions.put(defaultAttributeStore.getId(),
defaultAttributeStore.createIdentityStoreSession());
+ }
+
+ if (!sessions.containsKey(defaultIdentityStore.getId()))
+ {
+ sessions.put(defaultIdentityStore.getId(),
defaultIdentityStore.createIdentityStoreSession());
+ }
+
+ return new RepositoryIdentityStoreSessionImpl(sessions);
}
public String getId()
{
- return null;
+ return id;
}
public FeaturesMetaData getSupportedFeatures()
@@ -101,32 +158,69 @@
return ads;
}
+ IdentityStoreInvocationContext resolveInvocationContext(IdentityStore targetStore,
IdentityStoreInvocationContext invocationCtx)
+ {
+ return resolveInvocationContext(targetStore.getId(), invocationCtx);
+
+ }
+
+ IdentityStoreInvocationContext resolveInvocationContext(AttributeStore targetStore,
IdentityStoreInvocationContext invocationCtx)
+ {
+ return resolveInvocationContext(targetStore.getId(), invocationCtx);
+
+ }
+
+ IdentityStoreInvocationContext resolveInvocationContext(String id,
IdentityStoreInvocationContext invocationCtx)
+ {
+ RepositoryIdentityStoreSessionImpl repoSession =
(RepositoryIdentityStoreSessionImpl)invocationCtx.getIdentityStoreSession();
+ IdentityStoreSession targetSession = repoSession.getIdentityStoreSession(id);
+
+ return new SimpleIdentityStoreInvocationContext(targetSession,
invocationCtx.getRealmId());
+
+ }
+
public IdentityObject createIdentityObject(IdentityStoreInvocationContext
invocationCtx, String name, IdentityObjectType identityObjectType) throws
IdentityException
{
- return resolveIdentityStore(identityObjectType).createIdentityObject(invocationCtx,
name, identityObjectType);
+ IdentityStore targetStore = resolveIdentityStore(identityObjectType);
+ IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore,
invocationCtx);
+ return targetStore.createIdentityObject(targetCtx, name, identityObjectType);
}
+
+
public void removeIdentityObject(IdentityStoreInvocationContext invocationCtx,
IdentityObject identity) throws IdentityException
{
- resolveIdentityStore(identity).removeIdentityObject(invocationCtx, identity);
+ IdentityStore targetStore = resolveIdentityStore(identity);
+ IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore,
invocationCtx);
+
+ targetStore.removeIdentityObject(targetCtx, identity);
}
public int getIdentityObjectsCount(IdentityStoreInvocationContext invocationCtx,
IdentityObjectType identityType) throws IdentityException
{
- return resolveIdentityStore(identityType).getIdentityObjectsCount(invocationCtx,
identityType);
+ IdentityStore targetStore = resolveIdentityStore(identityType);
+ IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore,
invocationCtx);
+
+ return targetStore.getIdentityObjectsCount(targetCtx, identityType);
}
public IdentityObject findIdentityObject(IdentityStoreInvocationContext
invocationContext, String name, IdentityObjectType identityObjectType) throws
IdentityException
{
- return
resolveIdentityStore(identityObjectType).findIdentityObject(invocationContext, name,
identityObjectType);
+ IdentityStore targetStore = resolveIdentityStore(identityObjectType);
+ IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore,
invocationContext);
+
+ return targetStore.findIdentityObject(targetCtx, name, identityObjectType);
}
public IdentityObject findIdentityObject(IdentityStoreInvocationContext
invocationContext, Object id) throws IdentityException
{
+ //TODO: store
for (IdentityStore identityStore : getIdentityStoreMappings().values())
{
- IdentityObject io = identityStore.findIdentityObject(invocationContext, id);
+ IdentityStoreInvocationContext targetCtx =
resolveInvocationContext(identityStore, invocationContext);
+
+ IdentityObject io = identityStore.findIdentityObject(targetCtx, id);
if (io != null)
{
return io;
@@ -138,12 +232,18 @@
public Collection<IdentityObject>
findIdentityObject(IdentityStoreInvocationContext invocationCtx, IdentityObjectType
identityType, String nameFilter, int offset, int limit, boolean orderByName, boolean
ascending) throws IdentityException
{
- return resolveIdentityStore(identityType).findIdentityObject(invocationCtx,
identityType, nameFilter, offset, limit, orderByName, ascending);
+ IdentityStore targetStore = resolveIdentityStore(identityType);
+ IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore,
invocationCtx);
+
+ return targetStore.findIdentityObject(targetCtx, identityType, nameFilter, offset,
limit, orderByName, ascending);
}
public Collection<IdentityObject>
findIdentityObject(IdentityStoreInvocationContext invocationCtx, IdentityObjectType
identityType, Map<String, String[]> attributes, int offset, int limit, boolean
orderByName, boolean ascending) throws IdentityException
{
- return resolveIdentityStore(identityType).findIdentityObject(invocationCtx,
identityType, attributes, offset, limit, orderByName, ascending);
+ IdentityStore targetStore = resolveIdentityStore(identityType);
+ IdentityStoreInvocationContext targetCtx = resolveInvocationContext(targetStore,
invocationCtx);
+
+ return targetStore.findIdentityObject(targetCtx, identityType, attributes, offset,
limit, orderByName, ascending);
}
public Collection<IdentityObject>
findIdentityObject(IdentityStoreInvocationContext invocationCxt,
@@ -153,142 +253,186 @@
int offset, int limit, boolean
orderByName, boolean ascending) throws IdentityException
{
//TODO:
- return defaultIdentityStore.findIdentityObject(invocationCxt, identity,
relationshipType, parent, offset, limit, orderByName, ascending);
+ IdentityStoreInvocationContext targetCtx =
resolveInvocationContext(defaultIdentityStore, invocationCxt);
+ return defaultIdentityStore.findIdentityObject(targetCtx, identity,
relationshipType, parent, offset, limit, orderByName, ascending);
+
}
public IdentityObjectRelationship createRelationship(IdentityStoreInvocationContext
invocationCxt, IdentityObject fromIdentity, IdentityObject toIdentity,
IdentityObjectRelationshipType relationshipType, String relationshipName, boolean
createNames) throws IdentityException
{
IdentityStore fromStore = resolveIdentityStore(fromIdentity);
+
IdentityStore toStore = resolveIdentityStore(toIdentity);
+ IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore,
invocationCxt);
+
+ IdentityStoreInvocationContext defaultTargetCtx =
resolveInvocationContext(defaultIdentityStore, invocationCxt);
+
if (fromStore == toStore)
{
- return fromStore.createRelationship(invocationCxt, fromIdentity, toIdentity,
relationshipType, relationshipName, createNames);
+ return fromStore.createRelationship(toTargetCtx, fromIdentity, toIdentity,
relationshipType, relationshipName, createNames);
}
- if (!hasIdentityObject(invocationCxt, defaultIdentityStore, fromIdentity))
+ if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, fromIdentity))
{
- defaultIdentityStore.createIdentityObject(invocationCxt, fromIdentity.getName(),
fromIdentity.getIdentityType());
+ defaultIdentityStore.createIdentityObject(defaultTargetCtx,
fromIdentity.getName(), fromIdentity.getIdentityType());
}
- if (!hasIdentityObject(invocationCxt, defaultIdentityStore, toIdentity))
+ if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, toIdentity))
{
- defaultIdentityStore.createIdentityObject(invocationCxt, toIdentity.getName(),
toIdentity.getIdentityType());
+ defaultIdentityStore.createIdentityObject(defaultTargetCtx,
toIdentity.getName(), toIdentity.getIdentityType());
}
- return defaultIdentityStore.createRelationship(invocationCxt, fromIdentity,
toIdentity, relationshipType, relationshipName, createNames);
+ return defaultIdentityStore.createRelationship(defaultTargetCtx, fromIdentity,
toIdentity, relationshipType, relationshipName, createNames);
}
public void removeRelationship(IdentityStoreInvocationContext invocationCxt,
IdentityObject fromIdentity, IdentityObject toIdentity, IdentityObjectRelationshipType
relationshipType, String relationshipName) throws IdentityException
{
IdentityStore fromStore = resolveIdentityStore(fromIdentity);
+
IdentityStore toStore = resolveIdentityStore(toIdentity);
-
+
+ IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore,
invocationCxt);
+
+ IdentityStoreInvocationContext defaultTargetCtx =
resolveInvocationContext(defaultIdentityStore, invocationCxt);
+
if (fromStore == toStore)
{
- fromStore.removeRelationship(invocationCxt, fromIdentity, toIdentity,
relationshipType, relationshipName);
+ fromStore.removeRelationship(toTargetCtx, fromIdentity, toIdentity,
relationshipType, relationshipName);
return;
}
- if (!hasIdentityObject(invocationCxt, defaultIdentityStore, fromIdentity))
+ if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, fromIdentity))
{
- defaultIdentityStore.createIdentityObject(invocationCxt, fromIdentity.getName(),
fromIdentity.getIdentityType());
+ defaultIdentityStore.createIdentityObject(defaultTargetCtx,
fromIdentity.getName(), fromIdentity.getIdentityType());
}
- if (!hasIdentityObject(invocationCxt, defaultIdentityStore, toIdentity))
+ if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, toIdentity))
{
- defaultIdentityStore.createIdentityObject(invocationCxt, toIdentity.getName(),
toIdentity.getIdentityType());
+ defaultIdentityStore.createIdentityObject(defaultTargetCtx,
toIdentity.getName(), toIdentity.getIdentityType());
}
- defaultIdentityStore.removeRelationship(invocationCxt, fromIdentity, toIdentity,
relationshipType, relationshipName);
+ defaultIdentityStore.removeRelationship(defaultTargetCtx, fromIdentity, toIdentity,
relationshipType, relationshipName);
}
public void removeRelationships(IdentityStoreInvocationContext invocationCtx,
IdentityObject identity1, IdentityObject identity2, boolean named) throws
IdentityException
{
IdentityStore fromStore = resolveIdentityStore(identity1);
+
IdentityStore toStore = resolveIdentityStore(identity2);
+ IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore,
invocationCtx);
+
+ IdentityStoreInvocationContext defaultTargetCtx =
resolveInvocationContext(defaultIdentityStore, invocationCtx);
+
+
if (fromStore == toStore)
{
- fromStore.removeRelationships(invocationCtx, identity1, identity2, named);
+ fromStore.removeRelationships(toTargetCtx, identity1, identity2, named);
return;
}
- if (!hasIdentityObject(invocationCtx, defaultIdentityStore, identity1))
+ if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, identity1))
{
- defaultIdentityStore.createIdentityObject(invocationCtx, identity1.getName(),
identity1.getIdentityType());
+ defaultIdentityStore.createIdentityObject(defaultTargetCtx, identity1.getName(),
identity1.getIdentityType());
}
- if (!hasIdentityObject(invocationCtx, defaultIdentityStore, identity2))
+ if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, identity2))
{
- defaultIdentityStore.createIdentityObject(invocationCtx, identity2.getName(),
identity2.getIdentityType());
+ defaultIdentityStore.createIdentityObject(defaultTargetCtx, identity2.getName(),
identity2.getIdentityType());
}
- defaultIdentityStore.removeRelationships(invocationCtx, identity1, identity2,
named);
+ defaultIdentityStore.removeRelationships(defaultTargetCtx, identity1, identity2,
named);
}
public Set<IdentityObjectRelationship>
resolveRelationships(IdentityStoreInvocationContext invocationCxt, IdentityObject
fromIdentity, IdentityObject toIdentity) throws IdentityException
{
+
IdentityStore fromStore = resolveIdentityStore(fromIdentity);
+
IdentityStore toStore = resolveIdentityStore(toIdentity);
+ IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore,
invocationCxt);
+
+ IdentityStoreInvocationContext defaultTargetCtx =
resolveInvocationContext(defaultIdentityStore, invocationCxt);
+
if (fromStore == toStore)
{
- return fromStore.resolveRelationships(invocationCxt, fromIdentity, toIdentity);
+ return fromStore.resolveRelationships(toTargetCtx, fromIdentity, toIdentity);
}
- if (!hasIdentityObject(invocationCxt, defaultIdentityStore, fromIdentity))
+ if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, fromIdentity))
{
- defaultIdentityStore.createIdentityObject(invocationCxt, fromIdentity.getName(),
fromIdentity.getIdentityType());
+ defaultIdentityStore.createIdentityObject(defaultTargetCtx,
fromIdentity.getName(), fromIdentity.getIdentityType());
}
- if (!hasIdentityObject(invocationCxt, defaultIdentityStore, toIdentity))
+ if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, toIdentity))
{
- defaultIdentityStore.createIdentityObject(invocationCxt, toIdentity.getName(),
toIdentity.getIdentityType());
+ defaultIdentityStore.createIdentityObject(defaultTargetCtx,
toIdentity.getName(), toIdentity.getIdentityType());
}
- return defaultIdentityStore.resolveRelationships(invocationCxt, fromIdentity,
toIdentity);
+ return defaultIdentityStore.resolveRelationships(defaultTargetCtx, fromIdentity,
toIdentity);
}
public String createRelationshipName(IdentityStoreInvocationContext ctx, String name)
throws IdentityException, OperationNotSupportedException
{
+ IdentityStoreInvocationContext defaultCtx =
resolveInvocationContext(defaultIdentityStore, ctx);
+
//TODO: For now just assume that named relationships are in default one
- return defaultIdentityStore.createRelationshipName(ctx, name);
+ return defaultIdentityStore.createRelationshipName(defaultCtx, name);
}
public String removeRelationshipName(IdentityStoreInvocationContext ctx, String name)
throws IdentityException, OperationNotSupportedException
{
+ IdentityStoreInvocationContext defaultCtx =
resolveInvocationContext(defaultIdentityStore, ctx);
+
+
//TODO: For now just assume that named relationships are in default one
- return defaultIdentityStore.removeRelationshipName(ctx, name);
+ return defaultIdentityStore.removeRelationshipName(defaultCtx, name);
}
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx, int
offset, int limit, boolean orderByName, boolean ascending) throws IdentityException,
OperationNotSupportedException
{
+ IdentityStoreInvocationContext defaultCtx =
resolveInvocationContext(defaultIdentityStore, ctx);
+
+
//TODO: For now just assume that named relationships are in default one
- return defaultIdentityStore.getRelationshipNames(ctx, offset, limit, orderByName,
ascending);
+ return defaultIdentityStore.getRelationshipNames(defaultCtx, offset, limit,
orderByName, ascending);
}
public Set<String> getRelationshipNames(IdentityStoreInvocationContext ctx,
IdentityObject identity, int offset, int limit, boolean orderByName, boolean ascending)
throws IdentityException, OperationNotSupportedException
{
+ IdentityStoreInvocationContext defaultCtx =
resolveInvocationContext(defaultIdentityStore, ctx);
+
+
//TODO: For now just assume that named relationships are in default one
- return defaultIdentityStore.getRelationshipNames(ctx, identity, offset, limit,
orderByName, ascending);
+ return defaultIdentityStore.getRelationshipNames(defaultCtx, identity, offset,
limit, orderByName, ascending);
}
public boolean hasPasswordAttribute(IdentityStoreInvocationContext ctx,
IdentityObjectType type) throws IdentityException
{
- return resolveIdentityStore(type).hasPasswordAttribute(ctx, type);
+ IdentityStore toStore = resolveIdentityStore(type);
+ IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, ctx);
+
+ return toStore.hasPasswordAttribute(targetCtx, type);
}
public boolean validatePassword(IdentityStoreInvocationContext ctx, IdentityObject
identityObject, String password) throws IdentityException
{
- return resolveIdentityStore(identityObject).validatePassword(ctx, identityObject,
password);
+ IdentityStore toStore = resolveIdentityStore(identityObject);
+ IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, ctx);
+
+ return toStore.validatePassword(targetCtx, identityObject, password);
}
public void updatePassword(IdentityStoreInvocationContext ctx, IdentityObject
identityObject, String password) throws IdentityException
{
- resolveIdentityStore(identityObject).updatePassword(ctx, identityObject,
password);
+ IdentityStore toStore = resolveIdentityStore(identityObject);
+ IdentityStoreInvocationContext targetCtx = resolveInvocationContext(toStore, ctx);
+
+ toStore.updatePassword(targetCtx, identityObject, password);
}
@@ -296,7 +440,9 @@
{
//TODO: for profile stored in two stores this need to be merged with results from
defaultAttributeStore. For now just use the default one.
- return defaultAttributeStore.getSupportedAttributeNames(invocationContext,
identityType);
+ IdentityStoreInvocationContext targetCtx =
resolveInvocationContext(defaultAttributeStore, invocationContext);
+
+ return defaultAttributeStore.getSupportedAttributeNames(targetCtx, identityType);
//return
resolveIdentityStore(identityType).getSupportedAttributeNames(invocationContext,
identityType);
}
@@ -304,7 +450,9 @@
{
//TODO: for profile stored in two stores this need to be merged with results from
defaultAttributeStore. For now just use the default one.
- return defaultAttributeStore.getAttributes(invocationContext, identity);
+ IdentityStoreInvocationContext targetCtx =
resolveInvocationContext(defaultAttributeStore, invocationContext);
+
+ return defaultAttributeStore.getAttributes(targetCtx, identity);
//return resolveIdentityStore(identity).getAttributes(invocationContext,
identity);
}
@@ -312,7 +460,9 @@
{
//TODO: for profile stored in two stores this need to be merged with results from
defaultAttributeStore. For now just use the default one.
- defaultAttributeStore.updateAttributes(invocationCtx, identity, attributes);
+ IdentityStoreInvocationContext targetCtx =
resolveInvocationContext(defaultAttributeStore, invocationCtx);
+
+ defaultAttributeStore.updateAttributes(targetCtx, identity, attributes);
//resolveIdentityStore(identity).updateAttributes(invocationCtx, identity,
attributes);
}
@@ -320,7 +470,9 @@
{
//TODO: for profile stored in two stores this need to be merged with results from
defaultAttributeStore. For now just use the default one.
- defaultAttributeStore.addAttributes(invocationCtx, identity, attributes);
+ IdentityStoreInvocationContext targetCtx =
resolveInvocationContext(defaultAttributeStore, invocationCtx);
+
+ defaultAttributeStore.addAttributes(targetCtx, identity, attributes);
//resolveIdentityStore(identity).addAttributes(invocationCtx, identity,
attributes);
}
@@ -328,7 +480,9 @@
{
//TODO: for profile stored in two stores this need to be merged with results from
defaultAttributeStore. For now just use the default one.
- defaultAttributeStore.removeAttributes(invocationCtx, identity, attributes);
+ IdentityStoreInvocationContext targetCtx =
resolveInvocationContext(defaultAttributeStore, invocationCtx);
+
+ defaultAttributeStore.removeAttributes(targetCtx, identity, attributes);
//resolveIdentityStore(identity).removeAttributes(invocationCtx, identity,
attributes);
}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/RepositoryIdentityStoreSessionImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/RepositoryIdentityStoreSessionImpl.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/RepositoryIdentityStoreSessionImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,146 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.repository;
+
+import org.jboss.identity.spi.store.IdentityStoreSession;
+import org.jboss.identity.exception.IdentityException;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class RepositoryIdentityStoreSessionImpl implements IdentityStoreSession
+{
+
+ //TODO: more sophisticated impl needed.
+
+ protected final Map<String, IdentityStoreSession> identityStoreSessionMappings;
+
+ public RepositoryIdentityStoreSessionImpl(Map<String, IdentityStoreSession>
identityStoreSessionMappings)
+ {
+ if (identityStoreSessionMappings == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ this.identityStoreSessionMappings = identityStoreSessionMappings;
+ }
+
+ public Object getSessionContext() throws IdentityException
+ {
+ return null;
+ }
+
+ public IdentityStoreSession getIdentityStoreSession(String storeId)
+ {
+ return identityStoreSessionMappings.get(storeId);
+ }
+
+ public void close() throws IdentityException
+ {
+ for (IdentityStoreSession identityStoreSession :
identityStoreSessionMappings.values())
+ {
+ identityStoreSession.close();
+ }
+ }
+
+ public void save() throws IdentityException
+ {
+ for (IdentityStoreSession iss : identityStoreSessionMappings.values())
+ {
+ iss.save();
+ }
+
+ }
+
+ public void clear() throws IdentityException
+ {
+ for (IdentityStoreSession iss : identityStoreSessionMappings.values())
+ {
+ iss.clear();
+ }
+
+ }
+
+ public boolean isOpen()
+ {
+ for (IdentityStoreSession identityStoreSession :
identityStoreSessionMappings.values())
+ {
+ if (identityStoreSession.isOpen())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean isTransactionSupported()
+ {
+ for (IdentityStoreSession identityStoreSession :
identityStoreSessionMappings.values())
+ {
+ if (identityStoreSession.isTransactionSupported())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void startTransaction()
+ {
+ for (IdentityStoreSession identityStoreSession :
identityStoreSessionMappings.values())
+ {
+ identityStoreSession.startTransaction();
+ }
+ }
+
+ public void commitTransaction()
+ {
+ for (IdentityStoreSession identityStoreSession :
identityStoreSessionMappings.values())
+ {
+ identityStoreSession.commitTransaction();
+ }
+ }
+
+ public void rollbackTransaction()
+ {
+ for (IdentityStoreSession identityStoreSession :
identityStoreSessionMappings.values())
+ {
+ identityStoreSession.rollbackTransaction();
+ }
+ }
+
+ public boolean isTransactionActive()
+ {
+ for (IdentityStoreSession identityStoreSession :
identityStoreSessionMappings.values())
+ {
+ if (identityStoreSession.isTransactionActive())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+}
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/WrapperIdentityStoreRepository.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/WrapperIdentityStoreRepository.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/repository/WrapperIdentityStoreRepository.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -26,11 +26,13 @@
import org.jboss.identity.spi.store.AttributeStore;
import org.jboss.identity.spi.store.FeaturesMetaData;
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
+import org.jboss.identity.spi.store.IdentityStoreSession;
import org.jboss.identity.spi.model.IdentityObject;
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.spi.model.IdentityObjectRelationship;
import org.jboss.identity.spi.exception.OperationNotSupportedException;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.exception.IdentityException;
import java.util.Map;
@@ -54,15 +56,21 @@
public WrapperIdentityStoreRepository(IdentityStore identityStore, AttributeStore
attributeStore,
Map<String, IdentityStore>
identityStoreMappings, Map<String, AttributeStore> attributeStoreMappings)
{
- super(identityStoreMappings, attributeStoreMappings);
-
+// super(identityStoreMappings, attributeStoreMappings);
+//
this.identityStore = identityStore;
this.attributeStore = attributeStore;
}
- public void bootstrap() throws IOException
+ public void bootstrap(IdentityStoreConfigurationMetaData configurationMD) throws
IdentityException
{
+ //TODO
+ }
+ public IdentityStoreSession createIdentityStoreSession()
+ {
+ //TODO
+ return null;
}
public String getId()
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/SimpleIdentityStoreInvocationContext.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/SimpleIdentityStoreInvocationContext.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/SimpleIdentityStoreInvocationContext.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,53 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.store;
+
+import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
+import org.jboss.identity.spi.store.IdentityStoreSession;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class SimpleIdentityStoreInvocationContext implements
IdentityStoreInvocationContext
+{
+ private final IdentityStoreSession identityStoreSession;
+
+ private final String realmId;
+
+ public SimpleIdentityStoreInvocationContext(IdentityStoreSession identityStoreSession,
String realmId)
+ {
+ this.identityStoreSession = identityStoreSession;
+ this.realmId = realmId;
+ }
+
+ public IdentityStoreSession getIdentityStoreSession()
+ {
+ return identityStoreSession;
+ }
+
+ public String getRealmId()
+ {
+ return realmId;
+ }
+}
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -25,11 +25,14 @@
import org.jboss.identity.spi.store.IdentityStore;
import org.jboss.identity.spi.store.FeaturesMetaData;
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
+import org.jboss.identity.spi.store.IdentityStoreSession;
import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.spi.model.IdentityObject;
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.model.IdentityObjectRelationship;
import org.jboss.identity.spi.exception.OperationNotSupportedException;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
+import org.jboss.identity.spi.configuration.metadata.IdentityObjectTypeMetaData;
import org.jboss.identity.exception.IdentityException;
import org.jboss.identity.impl.model.hibernate.HibernateIdentityObject;
import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectRelationship;
@@ -38,19 +41,20 @@
import org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectRelationshipName;
import org.jboss.identity.impl.NotYetImplementedException;
import org.jboss.identity.impl.store.FeaturesMetaDataImpl;
-import org.jboss.identity.impl.store.hibernate.HibernateIdentityStoreInvocationContext;
import org.hibernate.ejb.HibernateEntityManager;
+import org.hibernate.ejb.HibernateEntityManagerFactory;
import org.hibernate.criterion.Restrictions;
import javax.persistence.NoResultException;
import javax.persistence.Query;
+import javax.persistence.Persistence;
import java.util.Set;
import java.util.Collection;
import java.util.Map;
import java.util.List;
import java.util.Iterator;
import java.util.HashSet;
-import java.io.IOException;
+import java.util.LinkedList;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
@@ -78,34 +82,111 @@
"(r.fromIdentityObject like :IO1 and r.toIdentityObject like :IO2) or
" +
"(r.fromIdentityObject like :IO2 and r.toIdentityObject like :IO1)";
+ public static final String PERSISTENCE_UNIT = "persistenceUnit";
+
+ public static final String POPULATE_MEMBERSHIP_TYPES =
"populateRelationshipTypes";
+
+ public static final String POPULATE_IDENTITY_OBJECT_TYPES =
"populateIdentityObjectTypes";
+
+ public static final String IS_REALM_AWARE = "isRealmAware";
+
private String id;
private FeaturesMetaData supportedFeatures;
- public HibernateIdentityStoreImpl()
+ private HibernateEntityManagerFactory emFactory;
+
+ private boolean isRealmAware = false;
+
+ // TODO: rewrite this into some more handy object
+ private IdentityStoreConfigurationMetaData configurationMD;
+
+ public HibernateIdentityStoreImpl(String id)
{
// For now just dummy impl
//TODO: initialize with configuration
supportedFeatures = new FeaturesMetaDataImpl();
+
+ this.id = id;
}
- public void start()
+ public void bootstrap(IdentityStoreConfigurationMetaData configurationMD) throws
IdentityException
{
- //TODO: populate store with configured identity types if needed (and configured)
+ this.configurationMD = configurationMD;
+ //TODO: bootstrap supportedFeatures from configMD
- }
+ String persistenceUnit = configurationMD.getOptionSingleValue(PERSISTENCE_UNIT);
- public void stop()
- {
+ if (persistenceUnit == null)
+ {
+ throw new IdentityException("Persistence Unit not defined for
IdentityStore: " + getId());
+ }
+ emFactory =
(HibernateEntityManagerFactory)Persistence.createEntityManagerFactory(persistenceUnit);
+
+ String populateMembershipTypes =
configurationMD.getOptionSingleValue(POPULATE_MEMBERSHIP_TYPES);
+ String populateIdentityObjectTypes =
configurationMD.getOptionSingleValue(POPULATE_IDENTITY_OBJECT_TYPES);
+
+ HibernateEntityManager em =
(HibernateEntityManager)emFactory.createEntityManager();
+
+ if (populateMembershipTypes != null &&
populateMembershipTypes.equalsIgnoreCase("true"))
+ {
+ List<String> memberships = new LinkedList<String>();
+
+ for (String membership : configurationMD.getSupportedRelationshipTypes())
+ {
+ memberships.add(membership);
+ }
+
+ try
+ {
+ populateRelationshipTypes(em, memberships.toArray(new
String[memberships.size()]));
+ }
+ catch (Exception e)
+ {
+ throw new IdentityException("Failed to populate relationship
types", e);
+ }
+
+
+ }
+
+ if (populateIdentityObjectTypes != null &&
populateIdentityObjectTypes.equalsIgnoreCase("true"))
+ {
+ List<String> types = new LinkedList<String>();
+
+ for (IdentityObjectTypeMetaData metaData :
configurationMD.getSupportedIdentityTypes())
+ {
+ types.add(metaData.getName());
+ }
+
+ try
+ {
+ populateObjectTypes(em, types.toArray(new String[types.size()]));
+ }
+ catch (Exception e)
+ {
+ throw new IdentityException("Failed to populate identity object
types", e);
+ }
+
+ }
+
+
}
+ public IdentityStoreSession createIdentityStoreSession() throws IdentityException
+ {
- public void bootstrap() throws IOException
- {
- //TODO: NYI
+ try
+ {
+ return new
HibernateIdentityStoreSessionImpl((HibernateEntityManager)emFactory.createEntityManager());
+ }
+ catch (Exception e)
+ {
+ throw new IdentityException("Failed to obtain
HibernateEntityManager",e);
+ }
+
}
public String getId()
@@ -726,12 +807,14 @@
protected HibernateEntityManager
getHibernateEntityManager(IdentityStoreInvocationContext ctx) throws IdentityException
{
- if (ctx instanceof HibernateIdentityStoreInvocationContext)
+ try
{
- return
((HibernateIdentityStoreInvocationContext)ctx).getHibernateEntityManager();
+ return
(HibernateEntityManager)ctx.getIdentityStoreSession().getSessionContext();
}
-
- throw new IdentityException("Not supported IdentityStoreInvocationContext
implementation");
+ catch (IdentityException e)
+ {
+ throw new IdentityException("Cannot obtain HibernateEntityManager",
e);
+ }
}
private void checkIOInstance(IdentityObject io)
@@ -829,4 +912,52 @@
return relationshipType;
}
+ public void populateObjectTypes(HibernateEntityManager em, String[] typeNames) throws
Exception
+ {
+
+ em.getTransaction().begin();
+
+ for (String typeName : typeNames)
+ {
+
+ //Check if present
+
+ HibernateIdentityObjectType hibernateType =
(HibernateIdentityObjectType)em.getSession().
+
createCriteria(HibernateIdentityObjectType.class).add(Restrictions.eq("name",
typeName)).uniqueResult();
+
+ if (hibernateType == null)
+ {
+ hibernateType = new HibernateIdentityObjectType(typeName);
+ em.persist(hibernateType);
+ }
+
+ }
+
+ em.getTransaction().commit();
+
+ }
+
+ public void populateRelationshipTypes(HibernateEntityManager em, String[] typeNames)
throws Exception
+ {
+
+ em.getTransaction().begin();
+
+ for (String typeName : typeNames)
+ {
+ HibernateIdentityObjectRelationshipType hibernateType =
(HibernateIdentityObjectRelationshipType)em.getSession().
+
createCriteria(HibernateIdentityObjectRelationshipType.class).add(Restrictions.eq("name",
typeName)).uniqueResult();
+
+ if (hibernateType == null)
+ {
+ hibernateType = new HibernateIdentityObjectRelationshipType(typeName);
+ em.persist(hibernateType);
+ }
+
+ }
+
+ em.getTransaction().commit();
+ }
+
+
+
}
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreInvocationContext.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreInvocationContext.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreInvocationContext.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -29,9 +29,9 @@
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public interface HibernateIdentityStoreInvocationContext extends
IdentityStoreInvocationContext
-{
-
- public HibernateEntityManager getHibernateEntityManager();
-
-}
+//public interface HibernateIdentityStoreInvocationContext extends
IdentityStoreInvocationContext
+//{
+//
+// public HibernateEntityManager getHibernateEntityManager();
+//
+//}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreSessionImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreSessionImpl.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreSessionImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,101 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.store.hibernate;
+
+import org.jboss.identity.spi.store.IdentityStoreSession;
+import org.jboss.identity.exception.IdentityException;
+import org.hibernate.ejb.HibernateEntityManagerFactory;
+import org.hibernate.ejb.HibernateEntityManager;
+
+import javax.persistence.Persistence;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class HibernateIdentityStoreSessionImpl implements IdentityStoreSession
+{
+
+ private final HibernateEntityManager hem;
+
+ public HibernateIdentityStoreSessionImpl(HibernateEntityManager hem)
+ {
+ this.hem = hem;
+ }
+
+ public HibernateIdentityStoreSessionImpl(String persistenceUnit)
+ {
+ HibernateEntityManagerFactory emFactory =
(HibernateEntityManagerFactory)Persistence.createEntityManagerFactory(persistenceUnit);
+ hem = (HibernateEntityManager)emFactory.createEntityManager();
+ }
+
+ public Object getSessionContext()
+ {
+ return hem;
+ }
+
+ public void close() throws IdentityException
+ {
+ hem.close();
+ }
+
+ public void save() throws IdentityException
+ {
+ hem.flush();
+ }
+
+ public void clear() throws IdentityException
+ {
+ hem.clear();
+ }
+
+ public boolean isOpen()
+ {
+ return hem.isOpen();
+ }
+
+ public boolean isTransactionSupported()
+ {
+ return true;
+ }
+
+ public void startTransaction()
+ {
+ hem.getTransaction().begin();
+ }
+
+ public void commitTransaction()
+ {
+ hem.getTransaction().commit();
+ }
+
+ public void rollbackTransaction()
+ {
+ hem.getTransaction().rollback();
+ }
+
+ public boolean isTransactionActive()
+ {
+ return hem.getTransaction().isActive();
+ }
+}
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStore.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStore.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStore.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -25,11 +25,13 @@
import org.jboss.identity.spi.store.IdentityStore;
import org.jboss.identity.spi.store.FeaturesMetaData;
import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
+import org.jboss.identity.spi.store.IdentityStoreSession;
import org.jboss.identity.spi.model.IdentityObject;
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.spi.model.IdentityObjectRelationship;
import org.jboss.identity.spi.exception.OperationNotSupportedException;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.exception.IdentityException;
import org.jboss.identity.impl.store.FeaturesMetaDataImpl;
import org.jboss.identity.impl.model.ldap.LDAPIdentityObjectImpl;
@@ -76,19 +78,34 @@
private FeaturesMetaData supportedFeatures;
+ LDAPIdentityStoreConfiguration configuration;
+
public LDAPIdentityStore(String id)
{
- // For now just dummy impl
- //TODO: initialize with configuration
- supportedFeatures = new FeaturesMetaDataImpl();
this.id = id;
}
- public void bootstrap() throws IOException
+ public void bootstrap(IdentityStoreConfigurationMetaData configurationMD) throws
IdentityException
{
+ configuration = new SimpleLDAPIdentityStoreConfiguration(configurationMD);
+ //TODO: populate with configuration
+ supportedFeatures = new FeaturesMetaDataImpl();
+
}
+ public IdentityStoreSession createIdentityStoreSession()
+ {
+
+ return new LDAPIdentityStoreSessionImpl(
+ "com.sun.jndi.ldap.LdapCtxFactory",
+ configuration.getProviderURL(),
+ "simple",
+ configuration.getAdminDN(),
+ configuration.getAdminPassword());
+
+ }
+
public String getId()
{
return id;
@@ -962,6 +979,7 @@
return getTypeConfiguration(invocationContext,
identityType).getMappedAttributesNames();
}
+
public Map<String, Set<String>>
getAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity) throws
IdentityException
{
@@ -1396,26 +1414,12 @@
}
}
- private LDAPIdentityStoreInvocationContext
castInvocationContext(IdentityStoreInvocationContext ctx) throws IdentityException
- {
- if (ctx == null)
- {
- throw new IllegalArgumentException("IdentityStoreInvocationContext is
null");
- }
- if (ctx instanceof LDAPIdentityStoreInvocationContext)
- {
- return (LDAPIdentityStoreInvocationContext)ctx;
- }
-
- throw new IdentityException("Not supported IdentityStoreInvocationContext
implementation");
- }
-
private LdapContext getLDAPContext(IdentityStoreInvocationContext ctx) throws
IdentityException
{
try
{
- return castInvocationContext(ctx).getLdapContext();
+ return (LdapContext)ctx.getIdentityStoreSession().getSessionContext();
}
catch (Exception e)
{
@@ -1425,7 +1429,7 @@
private LDAPIdentityStoreConfiguration getConfiguration(IdentityStoreInvocationContext
ctx) throws IdentityException
{
- return castInvocationContext(ctx).getConfiguration();
+ return configuration;
}
private LDAPIdentityObjectTypeConfiguration
getTypeConfiguration(IdentityStoreInvocationContext ctx, IdentityObjectType type) throws
IdentityException
@@ -1437,4 +1441,6 @@
{
return this.getClass().getName() + "[" + getId() +"]";
}
+
+
}
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreInvocationContext.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreInvocationContext.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreInvocationContext.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -30,11 +30,11 @@
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public interface LDAPIdentityStoreInvocationContext extends
IdentityStoreInvocationContext
-{
-
- LdapContext getLdapContext() throws Exception;
-
- LDAPIdentityStoreConfiguration getConfiguration();
-
-}
+//public interface LDAPIdentityStoreInvocationContext extends
IdentityStoreInvocationContext
+//{
+//
+// LdapContext getLdapContext() throws Exception;
+//
+// LDAPIdentityStoreConfiguration getConfiguration();
+//
+//}
Added:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreSessionImpl.java
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreSessionImpl.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreSessionImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,132 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.store.ldap;
+
+import org.jboss.identity.spi.store.IdentityStoreSession;
+import org.jboss.identity.exception.IdentityException;
+
+import javax.naming.ldap.LdapContext;
+import javax.naming.ldap.InitialLdapContext;
+import javax.naming.Context;
+import java.util.Hashtable;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class LDAPIdentityStoreSessionImpl implements IdentityStoreSession
+{
+
+ private final String INITIAL_CONTEXT_FACTORY;
+
+ private final String PROVIDER_URL;
+
+ private final String SECURITY_AUTHENTICATION;
+
+ private final String SECURITY_PRINCIPAL;
+
+ private final String SECURITY_CREDENTIALS;
+
+
+ public LDAPIdentityStoreSessionImpl(String INITIAL_CONTEXT_FACTORY,
+ String PROVIDER_URL,
+ String SECURITY_AUTHENTICATION,
+ String SECURITY_PRINCIPAL,
+ String SECURITY_CREDENTIALS)
+ {
+ this.INITIAL_CONTEXT_FACTORY = INITIAL_CONTEXT_FACTORY;
+ this.PROVIDER_URL = PROVIDER_URL;
+ this.SECURITY_AUTHENTICATION = SECURITY_AUTHENTICATION;
+ this.SECURITY_PRINCIPAL = SECURITY_PRINCIPAL;
+ this.SECURITY_CREDENTIALS = SECURITY_CREDENTIALS;
+ }
+
+ public LdapContext getLdapContext() throws Exception
+ {
+ Hashtable<String,String> env = new Hashtable<String,String>();
+ env.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);
+ env.put(Context.PROVIDER_URL, PROVIDER_URL);
+ env.put(Context.SECURITY_AUTHENTICATION, SECURITY_AUTHENTICATION);
+ env.put(Context.SECURITY_PRINCIPAL, SECURITY_PRINCIPAL);
+ env.put(Context.SECURITY_CREDENTIALS, SECURITY_CREDENTIALS);
+
+ return new InitialLdapContext(env, null);
+ }
+
+ public Object getSessionContext() throws IdentityException
+ {
+ try
+ {
+ return getLdapContext();
+ }
+ catch (Exception e)
+ {
+ throw new IdentityException("Could not create LdapContext", e);
+ }
+ }
+
+ public void close() throws IdentityException
+ {
+
+ }
+
+ public void save() throws IdentityException
+ {
+
+ }
+
+ public void clear() throws IdentityException
+ {
+
+ }
+
+ public boolean isOpen()
+ {
+ return false;
+ }
+
+ public boolean isTransactionSupported()
+ {
+ return false;
+ }
+
+ public void startTransaction()
+ {
+
+ }
+
+ public void commitTransaction()
+ {
+
+ }
+
+ public void rollbackTransaction()
+ {
+
+ }
+
+ public boolean isTransactionActive()
+ {
+ return false;
+ }
+}
Copied:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java
(from rev 109,
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java)
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityObjectTypeConfiguration.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,327 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.store.ldap;
+
+import org.jboss.identity.spi.configuration.metadata.IdentityObjectTypeMetaData;
+import org.jboss.identity.spi.configuration.metadata.RelationshipMetaData;
+import org.jboss.identity.spi.attribute.AttributeMetaData;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.Collections;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class SimpleLDAPIdentityObjectTypeConfiguration implements
LDAPIdentityObjectTypeConfiguration
+{
+ private final String idAttributeName;
+
+ private final String[] ctxDNs;
+
+ private final String entrySearchFilter;
+
+ private final boolean allowCreateEntry;
+
+ private final Map<String, String[]> createEntryAttributeValues;
+
+ private final String[] allowedMembershipTypes;
+
+ private final String membershipAttributeName;
+
+ private final boolean isMembershipAttributeDN;
+
+ private final boolean allowEmptyMemberships;
+
+ private final Map<String, String> attributeNames;
+
+
+ //Consts
+
+ public static final String ID_ATTRIBUTE_NAME = "idAttributeName";
+
+ public static final String CTX_DNS = "ctxDNs";
+
+ public static final String ENTRY_SEARCH_FILTER = "entrySearchFilter";
+
+ public static final String ALLOW_CREATE_ENTRY = "allowCreateEntry";
+
+ public static final String MEMBERSHIP_ATTRIBUTE_NAME =
"membershipAttributeName";
+
+ public static final String IS_MEMBERSHIP_ATTRIBUTE_DN =
"isMembershipAttributeDN";
+
+ public static final String ALLOW_EMPTY_MEMBERSHIPS =
"allowEmptyMemberships";
+
+ public static final String CREATE_ENTRY_ATTRIBUTE_VALUES =
"createEntryAttributeValues";
+
+
+
+ public SimpleLDAPIdentityObjectTypeConfiguration(IdentityObjectTypeMetaData
objectTypeMD)
+ {
+ this.idAttributeName = objectTypeMD.getOptionSingleValue(ID_ATTRIBUTE_NAME);
+ this.entrySearchFilter = objectTypeMD.getOptionSingleValue(ENTRY_SEARCH_FILTER);
+ this.membershipAttributeName =
objectTypeMD.getOptionSingleValue(MEMBERSHIP_ATTRIBUTE_NAME);
+ String allowCreateEntry = objectTypeMD.getOptionSingleValue(ALLOW_CREATE_ENTRY);
+ if (allowCreateEntry != null &&
allowCreateEntry.equalsIgnoreCase("true"))
+ {
+ this.allowCreateEntry = true;
+ }
+ else
+ {
+ this.allowCreateEntry = false;
+ }
+
+ String isMembershipAttributeDN =
objectTypeMD.getOptionSingleValue(IS_MEMBERSHIP_ATTRIBUTE_DN);
+ if (isMembershipAttributeDN != null &&
isMembershipAttributeDN.equalsIgnoreCase("true"))
+ {
+ this.isMembershipAttributeDN = true;
+ }
+ else
+ {
+ this.isMembershipAttributeDN = false;
+ }
+
+ String allowEmptyMemberships =
objectTypeMD.getOptionSingleValue(ALLOW_EMPTY_MEMBERSHIPS);
+ if (allowEmptyMemberships != null &&
allowEmptyMemberships.equalsIgnoreCase("true"))
+ {
+ this.allowEmptyMemberships = true;
+ }
+ else
+ {
+ this.allowEmptyMemberships = false;
+ }
+
+ List<String> relationships = new LinkedList<String>();
+
+ if (objectTypeMD.getRelationships() != null)
+ {
+ for (RelationshipMetaData relationshipMetaData :
objectTypeMD.getRelationships())
+ {
+ relationships.add(relationshipMetaData.getIdentityObjectTypeRef());
+ }
+ }
+
+ allowedMembershipTypes = relationships.toArray(new String[relationships.size()]);
+
+ attributeNames = new HashMap<String, String>();
+
+ for (AttributeMetaData attributeMetaData : objectTypeMD.getAttributes())
+ {
+ attributeNames.put(attributeMetaData.getName(),
attributeMetaData.getStoreMapping());
+ }
+
+ List<String> dns = objectTypeMD.getOption(CTX_DNS);
+ if (dns != null)
+ {
+ this.ctxDNs = dns.toArray(new String[dns.size()]);
+ }
+ else
+ {
+ this.ctxDNs = null;
+ }
+
+ Map<String, List<String>> createEntryAttributesMap = new
HashMap<String, List<String>>();
+
+
+
+ List<String> createAttributes =
objectTypeMD.getOption(CREATE_ENTRY_ATTRIBUTE_VALUES);
+
+ if (createAttributes != null && createAttributes.size() > 0 )
+ {
+ for (String attribute : createAttributes)
+ {
+ String[] parts = attribute.split("=", 2);
+ if (parts.length != 2)
+ {
+ continue;
+ }
+
+ String name = parts[0];
+ String value = parts[1];
+
+ if (!createEntryAttributesMap.containsKey(name))
+ {
+ List<String> list = new LinkedList<String>();
+ list.add(value);
+ createEntryAttributesMap.put(name, list);
+ }
+ else
+ {
+ createEntryAttributesMap.get(name).add(value);
+ }
+ }
+
+ Map<String, String[]> createEntryAttributesArray = new HashMap<String,
String[]>();
+
+ for (Map.Entry<String, List<String>> entry :
createEntryAttributesMap.entrySet())
+ {
+ createEntryAttributesArray.put(entry.getKey(), entry.getValue().toArray(new
String[entry.getValue().size()]));
+ }
+
+ this.createEntryAttributeValues = createEntryAttributesArray;
+ }
+ else
+ {
+ this.createEntryAttributeValues = new HashMap<String, String[]>();
+ }
+
+ //TODO: validate all required options - throw exception for missing ones and set
defaults for others
+
+
+
+ }
+
+ public SimpleLDAPIdentityObjectTypeConfiguration(String idAttributeName,
+ String[] ctxDNs,
+ String entrySearchFilter,
+ boolean allowCreateEntry,
+ Map<String, String[]>
createEntryAttributeValues,
+ String[] allowedMembershipTypes,
+ String membershipAttributeName,
+ boolean membershipAttributeDN,
+ boolean allowEmptyMemberships,
+ Map<String, String>
attributeNames)
+ {
+ this.idAttributeName = idAttributeName;
+ this.ctxDNs = ctxDNs;
+ this.entrySearchFilter = entrySearchFilter;
+ this.allowCreateEntry = allowCreateEntry;
+ this.createEntryAttributeValues = createEntryAttributeValues;
+ this.allowedMembershipTypes = allowedMembershipTypes;
+ this.membershipAttributeName = membershipAttributeName;
+ isMembershipAttributeDN = membershipAttributeDN;
+ this.allowEmptyMemberships = allowEmptyMemberships;
+ this.attributeNames = attributeNames;
+ }
+
+
+
+ public String getIdAttributeName()
+ {
+ return idAttributeName;
+ }
+
+ public String[] getCtxDNs()
+ {
+ return ctxDNs;
+ }
+
+ public String getEntrySearchFilter()
+ {
+ return entrySearchFilter;
+ }
+
+ public boolean isAllowCreateEntry()
+ {
+ return allowCreateEntry;
+ }
+
+ public Map<String, String[]> getCreateEntryAttributeValues()
+ {
+ return createEntryAttributeValues;
+ }
+
+ public String[] getAllowedMembershipTypes()
+ {
+ return allowedMembershipTypes;
+ }
+
+ public String getMembershipAttributeName()
+ {
+ return membershipAttributeName;
+ }
+
+ public boolean isMembershipAttributeDN()
+ {
+ return isMembershipAttributeDN;
+ }
+
+ public boolean allowEmptyMemberships()
+ {
+ return allowEmptyMemberships;
+ }
+
+ public String getAttributeMapping(String name)
+ {
+ return attributeNames.get(name);
+ }
+
+// public void setIdAttributeName(String idAttributeName)
+// {
+// this.idAttributeName = idAttributeName;
+// }
+//
+// public void setCtxDNs(String[] ctxDNs)
+// {
+// this.ctxDNs = ctxDNs;
+// }
+//
+// public void setEntrySearchFilter(String entrySearchFilter)
+// {
+// this.entrySearchFilter = entrySearchFilter;
+// }
+//
+// public void setAllowCreateEntry(boolean allowCreateEntry)
+// {
+// this.allowCreateEntry = allowCreateEntry;
+// }
+//
+// public void setCreateEntryAttributeValues(Map<String, String[]>
createEntryAttributeValues)
+// {
+// this.createEntryAttributeValues = createEntryAttributeValues;
+// }
+//
+// public void setAllowedMembershipTypes(String[] allowedMembershipTypes)
+// {
+// this.allowedMembershipTypes = allowedMembershipTypes;
+// }
+//
+// public void setMembershipAttributeName(String membershipAttributeName)
+// {
+// this.membershipAttributeName = membershipAttributeName;
+// }
+//
+// public void setMembershipAttributeDN(boolean membershipAttributeDN)
+// {
+// isMembershipAttributeDN = membershipAttributeDN;
+// }
+//
+// public void setAllowEmptyMemberships(boolean allowEmptyMemberships)
+// {
+// this.allowEmptyMemberships = allowEmptyMemberships;
+// }
+//
+// public void setAttributeNames(Map<String, String> attributeNames)
+// {
+// this.attributeNames = attributeNames;
+// }
+
+ public Set<String> getMappedAttributesNames()
+ {
+ return Collections.unmodifiableSet(attributeNames.keySet());
+ }
+}
Copied:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityStoreConfiguration.java
(from rev 109,
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityStoreConfiguration.java)
===================================================================
---
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityStoreConfiguration.java
(rev 0)
+++
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityStoreConfiguration.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,147 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.store.ldap;
+
+import org.jboss.identity.spi.model.IdentityObjectType;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
+import org.jboss.identity.spi.configuration.metadata.IdentityObjectTypeMetaData;
+import org.jboss.identity.impl.types.SimpleIdentityObjectType;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class SimpleLDAPIdentityStoreConfiguration implements
LDAPIdentityStoreConfiguration
+{
+ private final String providerURL;
+
+ private final String adminDN;
+
+ private final String adminPassword;
+
+ private final int searchTimeLimit;
+
+ private final Map<String, LDAPIdentityObjectTypeConfiguration>
typesConfiguration;
+
+
+ // Consts
+
+ public static final String PROVIDER_URL = "providerURL";
+
+ public static final String ADMIN_DN = "adminDN";
+
+ public static final String ADMIN_PASSWORD = "adminPassword";
+
+ public static final String SEARCH_TIME_LIMIT = "searchTimeLimit";
+
+ public static final int SEARCH_TIME_LIMIT_DEFAULT = 10000;
+
+// public SimpleLDAPIdentityStoreConfiguration(String providerURL, String adminDN,
String adminPassword, int searchTimeLimit, Map<String,
LDAPIdentityObjectTypeConfiguration> typesConfiguration)
+// {
+// this.providerURL = providerURL;
+// this.adminDN = adminDN;
+// this.adminPassword = adminPassword;
+// this.searchTimeLimit = searchTimeLimit;
+// this.typesConfiguration = typesConfiguration;
+// }
+
+ public SimpleLDAPIdentityStoreConfiguration(IdentityStoreConfigurationMetaData
storeMD)
+ {
+ if (storeMD == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ providerURL = storeMD.getOptionSingleValue(PROVIDER_URL);
+ adminDN = storeMD.getOptionSingleValue(ADMIN_DN);
+ adminPassword = storeMD.getOptionSingleValue(ADMIN_PASSWORD);
+ String searchTL = storeMD.getOptionSingleValue(SEARCH_TIME_LIMIT);
+
+ if (searchTL != null)
+ {
+ searchTimeLimit = Integer.valueOf(searchTL);
+ }
+ else
+ {
+ searchTimeLimit = SEARCH_TIME_LIMIT_DEFAULT;
+ }
+
+ Map<String, LDAPIdentityObjectTypeConfiguration> types = new
HashMap<String, LDAPIdentityObjectTypeConfiguration>();
+
+ for (IdentityObjectTypeMetaData identityObjectTypeMetaData :
storeMD.getSupportedIdentityTypes())
+ {
+ LDAPIdentityObjectTypeConfiguration typeConfig = new
SimpleLDAPIdentityObjectTypeConfiguration(identityObjectTypeMetaData);
+ types.put(identityObjectTypeMetaData.getName(), typeConfig);
+
+ }
+
+ typesConfiguration = types;
+
+ //TODO: validate if critical values are present
+
+
+ }
+
+ public String getProviderURL()
+ {
+ return providerURL;
+ }
+
+ public String getAdminDN()
+ {
+ return adminDN;
+ }
+
+ public String getAdminPassword()
+ {
+ return adminPassword;
+ }
+
+ public int getSearchTimeLimit()
+ {
+ return searchTimeLimit;
+ }
+
+ public LDAPIdentityObjectTypeConfiguration getTypeConfiguration(String typeName)
+ {
+ return typesConfiguration.get(typeName);
+ }
+
+ public IdentityObjectType[] getConfiguredTypes()
+ {
+ IdentityObjectType[] types = new IdentityObjectType[typesConfiguration.size()];
+ Object[] names = typesConfiguration.keySet().toArray();
+
+ for (int i = 0; i < names.length; i++)
+ {
+ String name = names[i].toString();
+ types[i] = new SimpleIdentityObjectType(name);
+ }
+
+ return types;
+ }
+
+}
Modified:
trunk/identity-impl/src/test/java/org/jboss/identity/impl/HibernateTestSupport.java
===================================================================
---
trunk/identity-impl/src/test/java/org/jboss/identity/impl/HibernateTestSupport.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/test/java/org/jboss/identity/impl/HibernateTestSupport.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -120,6 +120,7 @@
}
em.getTransaction().commit();
+
}
public void populateRelationshipTypes(String[] typeNames) throws Exception
Modified: trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/APITestCase.java
===================================================================
---
trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/APITestCase.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/APITestCase.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -24,38 +24,15 @@
import junit.framework.TestCase;
import org.jboss.identity.impl.HibernateTestSupport;
-import org.jboss.identity.impl.store.hibernate.HibernateIdentityStoreImpl;
-import org.jboss.identity.impl.store.hibernate.HibernateIdentityStoreInvocationContext;
-import org.jboss.identity.impl.store.ldap.LDAPIdentityObjectTypeConfiguration;
-import org.jboss.identity.impl.store.ldap.SimpleLDAPIdentityObjectTypeConfiguration;
-import org.jboss.identity.impl.store.ldap.SimpleLDAPIdentityStoreConfiguration;
-import org.jboss.identity.impl.store.ldap.SimpleLDAPIdentityStoreInvocationContext;
-import org.jboss.identity.impl.store.ldap.LDAPIdentityStoreInvocationContext;
-import org.jboss.identity.impl.store.ldap.LDAPIdentityStoreConfiguration;
-import org.jboss.identity.impl.store.ldap.LDAPIdentityStore;
-import org.jboss.identity.impl.store.IdentityTypeEnum;
-import org.jboss.identity.impl.repository.WrapperIdentityStoreRepository;
-import org.jboss.identity.impl.repository.FallbackIdentityStoreRepository;
import org.jboss.identity.api.IdentitySessionFactory;
-import org.jboss.identity.api.IdentitySession;
-import org.jboss.identity.spi.repository.IdentityStoreRepository;
-import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
-import org.jboss.identity.spi.store.IdentityStore;
-import org.jboss.identity.spi.store.AttributeStore;
import org.jboss.identity.opends.OpenDSService;
-import org.hibernate.ejb.HibernateEntityManager;
import org.opends.server.tools.LDAPModify;
import javax.naming.directory.DirContext;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.Binding;
-import javax.naming.ldap.LdapContext;
import javax.naming.ldap.InitialLdapContext;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.HashMap;
import java.util.Hashtable;
import java.io.File;
@@ -65,14 +42,8 @@
*/
public class APITestCase extends TestCase implements APITestContext
{
+ HibernateTestSupport hibernateSupport = new
HibernateTestSupport("unit-testing-jpa1", "jboss-identity-model1");
- //TODO: Code below is hardly readable mess... just made it quickly for prototyping.
Testing bits will be cleanly initialized
- //TODO: once I make XML configuration for all services
-
- HibernateTestSupport hibernateSupport = new
HibernateTestSupport("unit-testing-jpa", "jboss-identity-model");
-
- LDAPIdentityStoreInvocationContext ctx;
-
OrganizationTest orgTest;
IdentitySessionFactory identitySessionFactory;
@@ -112,7 +83,7 @@
protected void tearDown() throws Exception
{
hibernateSupport.stop();
-
+
cleanUp(new InitialLdapContext(env, null));
openDSService.stop();
@@ -120,193 +91,39 @@
public void testDBOrganization() throws Exception
{
- IdentityStore store = new HibernateIdentityStoreImpl();
- IdentityStoreRepository repository = new WrapperIdentityStoreRepository(store,
store, null, null);
- final IdentityStoreInvocationContext invocationContext = new
HibernateIdentityStoreInvocationContext()
- {
- public HibernateEntityManager getHibernateEntityManager()
- {
- return hibernateSupport.getHibernateEntityManager();
- }
- };
- prepareRealm(repository, invocationContext, OrganizationTest.RED_HAT_REALM,
- new String[]{"IDENTITY", "ORGANIZATION",
"ORGANIZATION_UNIT", "DIVISION", "DEPARTMENT",
"PROJECT", "PEOPLE"});
- orgTest.testRedHatOrganization();
+ identitySessionFactory = new IdentitySessionFactoryImpl(new
File("src/test/resources/organization-test-config.xml"));
+
+ orgTest.testRedHatOrganization("realm://RedHat/DB");
}
public void testDBSamplePortal() throws Exception
{
- IdentityStore store = new HibernateIdentityStoreImpl();
- IdentityStoreRepository repository = new WrapperIdentityStoreRepository(store,
store, null, null);
- final IdentityStoreInvocationContext invocationContext = new
HibernateIdentityStoreInvocationContext()
- {
- public HibernateEntityManager getHibernateEntityManager()
- {
- return hibernateSupport.getHibernateEntityManager();
- }
- };
- prepareRealm(repository, invocationContext, OrganizationTest.PORTAL_REALM,
- new String[]{"IDENTITY", "SYSTEM",
"ADMINISTRATION", "COMMUNITY", "ORGANIZATION",
"ORGANIZATION_UNIT",
- "OFFICE", "DIVISION", "DEPARTMENT",
"SECURITY", "PEOPLE"});
- orgTest.testSamplePortal();
+
+ identitySessionFactory = new IdentitySessionFactoryImpl(new
File("src/test/resources/organization-test-config.xml"));
+
+ orgTest.testSamplePortal("realm://portal/SamplePortal/DB");
}
public void testLDAPMixedOrganization() throws Exception
{
populateClean();
- IdentityStore hibernateStore = new HibernateIdentityStoreImpl();
+ identitySessionFactory = new IdentitySessionFactoryImpl(new
File("src/test/resources/organization-test-config.xml"));
- final LDAPIdentityStoreConfiguration ldapConfig =
createLDAPConfig("IDENTITY", null, null);
-
-
- IdentityStore ldapStore = new LDAPIdentityStore("LDAPStore");
-
- Map<String, IdentityStore> isMap = new HashMap<String,
IdentityStore>();
- isMap.put("IDENTITY",ldapStore);
- isMap.put("ORGANIZATION",hibernateStore);
- isMap.put("ORGANIZATION_UNIT",hibernateStore);
- isMap.put("DIVISION",hibernateStore);
- isMap.put("DEPARTMENT",hibernateStore);
- isMap.put("PROJECT",hibernateStore);
- isMap.put("PEOPLE",hibernateStore);
-
- Map<String, AttributeStore> asMap = new HashMap<String,
AttributeStore>();
- isMap.put("IDENTITY",ldapStore);
- isMap.put("ORGANIZATION",hibernateStore);
- isMap.put("ORGANIZATION_UNIT",hibernateStore);
- isMap.put("DIVISION",hibernateStore);
- isMap.put("DEPARTMENT",hibernateStore);
- isMap.put("PROJECT",hibernateStore);
- isMap.put("PEOPLE",hibernateStore);
-
- IdentityStoreRepository repository = new
FallbackIdentityStoreRepository(hibernateStore, hibernateStore, isMap, asMap);
-
- final IdentityStoreInvocationContext invocationContext = new
TestInvocationContext()
- {
- public LdapContext getLdapContext() throws Exception
- {
-
-
- return new InitialLdapContext(env, null);
- }
-
- public LDAPIdentityStoreConfiguration getConfiguration()
- {
- return ldapConfig;
- }
-
- public HibernateEntityManager getHibernateEntityManager()
- {
- return hibernateSupport.getHibernateEntityManager();
- }
- };
-
- prepareRealm(repository, invocationContext, OrganizationTest.RED_HAT_REALM,
- new String[]{"IDENTITY", "ORGANIZATION",
"ORGANIZATION_UNIT", "DIVISION", "DEPARTMENT",
"PROJECT", "PEOPLE"});
- orgTest.testRedHatOrganization();
+ orgTest.testRedHatOrganization("realm://RedHat/DB_LDAP");
}
public void testLDAPMixedSamplePortal() throws Exception
- {
- populateClean();
-
- IdentityStore hibernateStore = new HibernateIdentityStoreImpl();
-
- final LDAPIdentityStoreConfiguration ldapConfig =
createLDAPConfig("IDENTITY", null, null);
-
- IdentityStore ldapStore = new LDAPIdentityStore("LDAPStore");
-
- Map<String, IdentityStore> isMap = new HashMap<String,
IdentityStore>();
- isMap.put("IDENTITY",ldapStore);
- isMap.put("SYSTEM",hibernateStore);
- isMap.put("ADMINISTRATION",hibernateStore);
- isMap.put("COMMUNITY",hibernateStore);
- isMap.put("ORGANIZATION",hibernateStore);
- isMap.put("ORGANIZATION_UNIT",hibernateStore);
- isMap.put("OFFICE",hibernateStore);
- isMap.put("DIVISION",hibernateStore);
- isMap.put("DEPARTMENT",hibernateStore);
- isMap.put("SECURITY",hibernateStore);
- isMap.put("PEOPLE",hibernateStore);
-
- Map<String, AttributeStore> asMap = new HashMap<String,
AttributeStore>();
- asMap.put("IDENTITY",ldapStore);
- asMap.put("SYSTEM",hibernateStore);
- asMap.put("ADMINISTRATION",hibernateStore);
- asMap.put("COMMUNITY",hibernateStore);
- asMap.put("ORGANIZATION",hibernateStore);
- asMap.put("ORGANIZATION_UNIT",hibernateStore);
- asMap.put("OFFICE",hibernateStore);
- asMap.put("DIVISION",hibernateStore);
- asMap.put("DEPARTMENT",hibernateStore);
- asMap.put("SECURITY",hibernateStore);
- asMap.put("PEOPLE",hibernateStore);
-
- IdentityStoreRepository repository = new
FallbackIdentityStoreRepository(hibernateStore, hibernateStore, isMap, asMap);
-
- final IdentityStoreInvocationContext invocationContext = new
TestInvocationContext()
- {
- public LdapContext getLdapContext() throws Exception
- {
- return new InitialLdapContext(env, null);
- }
-
- public LDAPIdentityStoreConfiguration getConfiguration()
- {
- return ldapConfig;
- }
-
- public HibernateEntityManager getHibernateEntityManager()
- {
- return hibernateSupport.getHibernateEntityManager();
- }
- };
-
- prepareRealm(repository, invocationContext, OrganizationTest.PORTAL_REALM,
- new String[]{"IDENTITY", "SYSTEM",
"ADMINISTRATION", "COMMUNITY", "ORGANIZATION",
"ORGANIZATION_UNIT",
- "OFFICE", "DIVISION", "DEPARTMENT",
"SECURITY", "PEOPLE"});
- orgTest.testSamplePortal();
- }
-
- // Helper
-
- private void prepareRealm(IdentityStoreRepository repository, final
IdentityStoreInvocationContext invocationContext, String realmName, String[] objectTypes)
throws Exception
{
+ populateClean();
- Set<SessionWrapper> sessionWrappers = new HashSet<SessionWrapper>();
- sessionWrappers.add(new
EntityManagerWrapper(hibernateSupport.getHibernateEntityManager()));
-
- hibernateSupport.populateObjectTypes(objectTypes);
- hibernateSupport.populateRelationshipTypes(new
String[]{"JBOSS_IDENTITY_MEMBERSHIP", "JBOSS_IDENTITY_ROLE"});
-
- IdentityObjectTypeMapper iotMapper = new
DirectIdentityObjectTypeMapperImpl("IDENTITY");
-
-
-
- IdentityStoreInvocationContextResolver contextResolver = new
IdentityStoreInvocationContextResolver()
- {
- public IdentityStoreInvocationContext resolveInvocationContext()
- {
- return invocationContext;
- }
- };
-
- IdentitySessionContext identitySessionContext = new
IdentitySessionContextImpl(repository, iotMapper, contextResolver);
-
- IdentitySession identitySession = new IdentitySessionImpl(realmName,
identitySessionContext, sessionWrappers);
-
- Map<String, IdentitySession> sessionMap = new HashMap<String,
IdentitySession>();
+ identitySessionFactory = new IdentitySessionFactoryImpl(new
File("src/test/resources/organization-test-config.xml"));
- sessionMap.put(realmName, identitySession);
- identitySessionFactory = new IdentitySessionFactoryImpl(sessionMap);
-
+ orgTest.testSamplePortal("realm://portal/SamplePortal/DB_LDAP");
}
-
-
public IdentitySessionFactory getIdentitySessionFactory()
{
return identitySessionFactory;
@@ -371,90 +188,6 @@
mainCtx.unbind(name);
}
- private SimpleLDAPIdentityStoreConfiguration createLDAPConfig(String peopleTypeName,
String rolesTypeName, String groupsTypeName)
- {
- Map<String, LDAPIdentityObjectTypeConfiguration> typesMap = new
HashMap<String, LDAPIdentityObjectTypeConfiguration>();
-
- //People
- SimpleLDAPIdentityObjectTypeConfiguration tc = new
SimpleLDAPIdentityObjectTypeConfiguration();
- tc.setAllowCreateEntry(true);
- tc.setAllowedMembershipTypes(new String[] {});
- tc.setAllowEmptyMemberships(true);
- Map<String, String> attrs = new HashMap<String, String>();
- attrs.put("phone", "telephoneNumber");
- attrs.put("description", "description");
- attrs.put("carLicense", "carLicense");
- tc.setAttributeNames(attrs);
- Map<String, String[]> newAttrs = new HashMap<String, String[]>();
- newAttrs.put("objectClass", new String[]{"top",
"inetOrgPerson"});
- newAttrs.put("sn", new String[]{" "});
- newAttrs.put("cn", new String[]{" "});
-
- tc.setCreateEntryAttributeValues(newAttrs);
- tc.setCtxDNs(new String[]
{"ou=People,o=test,dc=portal,dc=example,dc=com"});
- tc.setEntrySearchFilter(null);
- tc.setIdAttributeName("uid");
- tc.setMembershipAttributeDN(true);
- tc.setMembershipAttributeName(null);
- typesMap.put(peopleTypeName, tc);
-
-
- if (rolesTypeName != null)
- {
- // ROLE
- tc = new SimpleLDAPIdentityObjectTypeConfiguration();
- tc.setAllowCreateEntry(true);
- tc.setAllowedMembershipTypes(new String[] {IdentityTypeEnum.USER.getName()});
- tc.setAllowEmptyMemberships(true);
- attrs = new HashMap<String, String>();
- //attrs.put();
- tc.setAttributeNames(attrs);
- newAttrs = new HashMap<String, String[]>();
- newAttrs.put("objectClass", new String[]{"top",
"groupOfNames"});
- tc.setCreateEntryAttributeValues(newAttrs);
- tc.setCtxDNs(new String[]
{"ou=Roles,o=test,dc=portal,dc=example,dc=com"});
- tc.setEntrySearchFilter(null);
- tc.setIdAttributeName("cn");
- tc.setMembershipAttributeDN(true);
- tc.setMembershipAttributeName("member");
- typesMap.put(rolesTypeName, tc);
- }
-
- if (groupsTypeName != null)
- {
- // GROUP
- tc = new SimpleLDAPIdentityObjectTypeConfiguration();
- tc.setAllowCreateEntry(true);
- tc.setAllowedMembershipTypes(new String[] {IdentityTypeEnum.USER.getName(),
IdentityTypeEnum.ROLE.getName(), IdentityTypeEnum.GROUP.getName()});
- tc.setAllowEmptyMemberships(true);
- attrs = new HashMap<String, String>();
- //attrs.put();
- tc.setAttributeNames(attrs);
- newAttrs = new HashMap<String, String[]>();
- newAttrs.put("objectClass", new String[]{"top",
"groupOfNames"});
-
- tc.setCreateEntryAttributeValues(newAttrs);
- tc.setCtxDNs(new String[]
{"ou=Groups,o=test,dc=portal,dc=example,dc=com"});
- tc.setEntrySearchFilter(null);
- tc.setIdAttributeName("cn");
- tc.setMembershipAttributeDN(true);
- tc.setMembershipAttributeName("member");
- typesMap.put(groupsTypeName, tc);
- }
-
- return new SimpleLDAPIdentityStoreConfiguration(
- LDAP_PROVIDER_URL,
- LDAP_PRINCIPAL,
- LDAP_CREDENTIALS,
- 10000,
- typesMap);
- }
-
- private interface TestInvocationContext extends
HibernateIdentityStoreInvocationContext, LDAPIdentityStoreInvocationContext
- {
-
- }
-
}
Modified:
trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/OrganizationTest.java
===================================================================
---
trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/OrganizationTest.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/test/java/org/jboss/identity/impl/api/OrganizationTest.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -44,11 +44,6 @@
*/
public class OrganizationTest extends Assert
{
-
- public static final String RED_HAT_REALM = "realm://RedHat";
-
- public static final String PORTAL_REALM = "realm://portal/SamplePortal";
-
APITestContext ctx;
public OrganizationTest(APITestContext ctx)
@@ -66,7 +61,7 @@
return ctx;
}
- public void testRedHatOrganization() throws Exception
+ public void testRedHatOrganization(String realmName) throws Exception
{
// GroupType
@@ -79,7 +74,7 @@
IdentitySessionFactory factory = ctx.getIdentitySessionFactory();
- IdentitySession session = factory.createIdentitySession(RED_HAT_REALM);
+ IdentitySession session = factory.createIdentitySession(realmName);
session.getTransaction().start();
@@ -279,7 +274,7 @@
}
- public void testSamplePortal() throws Exception
+ public void testSamplePortal(String realmName) throws Exception
{
GroupType SYSTEM = new SimpleGroupType("SYSTEM");
GroupType ADMINISTRATION = new SimpleGroupType("ADMINISTRATION");
@@ -296,7 +291,7 @@
//TODO: alter realm policies to make ORGANIZATION, ORGANIZATION_UNIT, DIVISION,
DEPARTMENT and OFFICE hierarchical groups
- IdentitySession session = factory.createIdentitySession(PORTAL_REALM);
+ IdentitySession session = factory.createIdentitySession(realmName);
session.getTransaction().start();
Added:
trunk/identity-impl/src/test/java/org/jboss/identity/impl/configuration/ConfigurationTestCase.java
===================================================================
---
trunk/identity-impl/src/test/java/org/jboss/identity/impl/configuration/ConfigurationTestCase.java
(rev 0)
+++
trunk/identity-impl/src/test/java/org/jboss/identity/impl/configuration/ConfigurationTestCase.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,52 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.impl.configuration;
+
+import junit.framework.TestCase;
+
+import java.io.File;
+
+import org.jboss.identity.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
+import org.jboss.identity.spi.configuration.metadata.IdentityConfigurationMetaData;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class ConfigurationTestCase extends TestCase
+{
+
+
+
+ public void testSimple() throws Exception
+ {
+
+ IdentityConfigurationMetaData config =
JAXB2IdentityConfiguration.createConfigurationMetaData(new
File("src/test/resources/test-config.xml"));
+
+ assertNotNull(config);
+
+ assertEquals("Hibernate Identity Store",
config.getIdentityStores().get(0).getId() );
+
+
+ }
+}
Modified:
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreTestCase.java
===================================================================
---
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -61,7 +61,7 @@
{
super.setUp();
- store = new HibernateIdentityStoreImpl()
+ store = new HibernateIdentityStoreImpl("test-id")
{
protected HibernateEntityManager
getHibernateEntityManager(IdentityStoreInvocationContext ctx)
Modified:
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreTestCase.java
===================================================================
---
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreTestCase.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/LDAPIdentityStoreTestCase.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -1,514 +1,514 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.identity.impl.store.ldap;
-
-import junit.framework.TestCase;
-import org.jboss.identity.opends.OpenDSService;
-import org.jboss.identity.spi.store.IdentityStore;
-import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
-import org.jboss.identity.spi.model.IdentityObject;
-import org.jboss.identity.impl.store.IdentityTypeEnum;
-import org.jboss.identity.impl.store.CommonIdentityStoreTest;
-import org.jboss.identity.impl.store.IdentityStoreTestContext;
-import org.opends.server.tools.LDAPModify;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.NamingEnumeration;
-import javax.naming.Binding;
-import javax.naming.directory.DirContext;
-import javax.naming.ldap.LdapContext;
-import javax.naming.ldap.InitialLdapContext;
-import java.net.URL;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.logging.Logger;
-import java.util.logging.Level;
-import java.io.File;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public class LDAPIdentityStoreTestCase extends TestCase implements
IdentityStoreTestContext
-{
-
- public static final String LDAP_HOST = "localhost";
-
- public static final String LDAP_PORT = "10389";
-
- public static final String LDAP_PROVIDER_URL = "ldap://" + LDAP_HOST +
":" + LDAP_PORT;
-
- public static final String LDAP_PRINCIPAL = "cn=Directory Manager";
-
- public static final String LDAP_CREDENTIALS = "password";
-
- OpenDSService openDSService = new
OpenDSService("target/test-classes/opends");
-
- IdentityStore store;
-
- CommonIdentityStoreTest commonTest;
-
- LDAPIdentityStoreInvocationContext ctx;
-
- public LDAPIdentityStoreTestCase(String s)
- {
- super(s);
- commonTest = new CommonIdentityStoreTest(this);
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- openDSService.start();
-
- // Initiate invocation context with simple configuration
- initiateCtx();
-
+///*
+//* JBoss, a division of Red Hat
+//* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+//* by the @authors tag. See the copyright.txt in the distribution for a
+//* full listing of individual contributors.
+//*
+//* This is free software; you can redistribute it and/or modify it
+//* under the terms of the GNU Lesser General Public License as
+//* published by the Free Software Foundation; either version 2.1 of
+//* the License, or (at your option) any later version.
+//*
+//* This software is distributed in the hope that it will be useful,
+//* but WITHOUT ANY WARRANTY; without even the implied warranty of
+//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+//* Lesser General Public License for more details.
+//*
+//* You should have received a copy of the GNU Lesser General Public
+//* License along with this software; if not, write to the Free
+//* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+//* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+//*/
+//
+//package org.jboss.identity.impl.store.ldap;
+//
+//import junit.framework.TestCase;
+//import org.jboss.identity.opends.OpenDSService;
+//import org.jboss.identity.spi.store.IdentityStore;
+//import org.jboss.identity.spi.store.IdentityStoreInvocationContext;
+//import org.jboss.identity.spi.model.IdentityObject;
+//import org.jboss.identity.impl.store.IdentityTypeEnum;
+//import org.jboss.identity.impl.store.CommonIdentityStoreTest;
+//import org.jboss.identity.impl.store.IdentityStoreTestContext;
+//import org.opends.server.tools.LDAPModify;
+//
+//import javax.naming.Context;
+//import javax.naming.NamingException;
+//import javax.naming.NamingEnumeration;
+//import javax.naming.Binding;
+//import javax.naming.directory.DirContext;
+//import javax.naming.ldap.LdapContext;
+//import javax.naming.ldap.InitialLdapContext;
+//import java.net.URL;
+//import java.util.Hashtable;
+//import java.util.Map;
+//import java.util.HashMap;
+//import java.util.Set;
+//import java.util.HashSet;
+//import java.util.logging.Logger;
+//import java.util.logging.Level;
+//import java.io.File;
+//
+///**
+// * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+// * @version : 0.1 $
+// */
+//public class LDAPIdentityStoreTestCase extends TestCase implements
IdentityStoreTestContext
+//{
+//
+// public static final String LDAP_HOST = "localhost";
+//
+// public static final String LDAP_PORT = "10389";
+//
+// public static final String LDAP_PROVIDER_URL = "ldap://" + LDAP_HOST +
":" + LDAP_PORT;
+//
+// public static final String LDAP_PRINCIPAL = "cn=Directory Manager";
+//
+// public static final String LDAP_CREDENTIALS = "password";
+//
+// OpenDSService openDSService = new
OpenDSService("target/test-classes/opends");
+//
+// IdentityStore store;
+//
+// CommonIdentityStoreTest commonTest;
+//
+// LDAPIdentityStoreInvocationContext ctx;
+//
+// public LDAPIdentityStoreTestCase(String s)
+// {
+// super(s);
+// commonTest = new CommonIdentityStoreTest(this);
+// }
+//
+// protected void setUp() throws Exception
+// {
+// super.setUp();
+//
+// openDSService.start();
+//
+// // Initiate invocation context with simple configuration
+// initiateCtx();
+//
+//// populate();
+//
+// store = new LDAPIdentityStore("simpleTestLDAPStore");
+//
+//
+//
+// }
+//
+// protected void tearDown() throws Exception
+// {
+// super.tearDown();
+//
+// cleanUp();
+//
+// openDSService.stop();
+// }
+//
+// public void begin() throws Exception
+// {
+// //nothing
+// }
+//
+// public void commit() throws Exception
+// {
+// //nothing
+// }
+//
+// public void flush() throws Exception
+// {
+// //nothing
+// }
+//
+// public IdentityStore getStore()
+// {
+// return store;
+// }
+//
+// public IdentityStoreInvocationContext getCtx()
+// {
+// return ctx;
+// }
+//
+//
+//
+//
+//
+// public void populate() throws Exception
+// {
+// populateLDIF("target/test-classes/ldap/initial-opends.ldif");
+// }
+//
+// public void populateClean() throws Exception
+// {
+// populateLDIF("target/test-classes/ldap/initial-empty-opends.ldif");
+// }
+//
+// public void populateLDIF(String ldifRelativePath) throws Exception
+// {
+// File ldif = new File(ldifRelativePath);
+//
+// System.out.println("LDIF: " + ldif.getAbsolutePath());
+//
+// String[] cmd = new String[] {"-h", LDAP_HOST,
+// "-p", LDAP_PORT,
+// "-D", LDAP_PRINCIPAL,
+// "-w", LDAP_CREDENTIALS,
+// "-a", "-f", ldif.getPath()};
+//
+// System.out.println("Populate success: " + (LDAPModify.mainModify(cmd,
false, System.out, System.err) == 0));
+//
+// }
+//
+// protected void cleanUp() throws Exception
+// {
+// try
+// {
+//
+// DirContext ldapCtx = ctx.getLdapContext();
+// String dn = "dc=portal,dc=example,dc=com";
+//
+// System.out.println("Removing: " + dn);
+//
+// removeContext(ldapCtx, dn);
+// }
+// catch (Exception e)
+// {
+// //
+// }
+// }
+//
+// //subsequent remove of javax.naming.Context
+// protected void removeContext(Context mainCtx, String name) throws Exception
+// {
+// Context deleteCtx = (Context)mainCtx.lookup(name);
+// NamingEnumeration subDirs = mainCtx.listBindings(name);
+//
+// while (subDirs.hasMoreElements())
+// {
+// Binding binding = (Binding)subDirs.nextElement();
+// String subName = binding.getName();
+//
+// removeContext(deleteCtx, subName);
+// }
+//
+// mainCtx.unbind(name);
+// }
+//
+// private void initiateCtx()
+// {
+//
+// Map<String, LDAPIdentityObjectTypeConfiguration> typesMap = new
HashMap<String, LDAPIdentityObjectTypeConfiguration>();
+//
+// //USER
+// SimpleLDAPIdentityObjectTypeConfiguration tc = new
SimpleLDAPIdentityObjectTypeConfiguration();
+// tc.setAllowCreateEntry(true);
+// tc.setAllowedMembershipTypes(new String[] {});
+// tc.setAllowEmptyMemberships(true);
+// Map<String, String> attrs = new HashMap<String, String>();
+// attrs.put("phone", "telephoneNumber");
+// attrs.put("description", "description");
+// attrs.put("carLicense", "carLicense");
+// tc.setAttributeNames(attrs);
+// Map<String, String[]> newAttrs = new HashMap<String, String[]>();
+// newAttrs.put("objectClass", new String[]{"top",
"inetOrgPerson"});
+// newAttrs.put("sn", new String[]{" "});
+// newAttrs.put("cn", new String[]{" "});
+//
+// tc.setCreateEntryAttributeValues(newAttrs);
+// tc.setCtxDNs(new String[]
{"ou=People,o=test,dc=portal,dc=example,dc=com"});
+// tc.setEntrySearchFilter(null);
+// tc.setIdAttributeName("uid");
+// tc.setMembershipAttributeDN(true);
+// tc.setMembershipAttributeName(null);
+// typesMap.put(IdentityTypeEnum.USER.getName(), tc);
+//
+//
+// // ROLE
+// tc = new SimpleLDAPIdentityObjectTypeConfiguration();
+// tc.setAllowCreateEntry(true);
+// tc.setAllowedMembershipTypes(new String[] {IdentityTypeEnum.USER.getName()});
+// tc.setAllowEmptyMemberships(true);
+// attrs = new HashMap<String, String>();
+// //attrs.put();
+// tc.setAttributeNames(attrs);
+// newAttrs = new HashMap<String, String[]>();
+// newAttrs.put("objectClass", new String[]{"top",
"groupOfNames"});
+// tc.setCreateEntryAttributeValues(newAttrs);
+// tc.setCtxDNs(new String[]
{"ou=Roles,o=test,dc=portal,dc=example,dc=com"});
+// tc.setEntrySearchFilter(null);
+// tc.setIdAttributeName("cn");
+// tc.setMembershipAttributeDN(true);
+// tc.setMembershipAttributeName("member");
+// typesMap.put(IdentityTypeEnum.ROLE.getName(), tc);
+//
+// // GROUP
+// tc = new SimpleLDAPIdentityObjectTypeConfiguration();
+// tc.setAllowCreateEntry(true);
+// tc.setAllowedMembershipTypes(new String[] {IdentityTypeEnum.USER.getName(),
IdentityTypeEnum.ROLE.getName(), IdentityTypeEnum.GROUP.getName()});
+// tc.setAllowEmptyMemberships(true);
+// attrs = new HashMap<String, String>();
+// //attrs.put();
+// tc.setAttributeNames(attrs);
+// newAttrs = new HashMap<String, String[]>();
+// newAttrs.put("objectClass", new String[]{"top",
"groupOfNames"});
+//
+// tc.setCreateEntryAttributeValues(newAttrs);
+// tc.setCtxDNs(new String[]
{"ou=Groups,o=test,dc=portal,dc=example,dc=com"});
+// tc.setEntrySearchFilter(null);
+// tc.setIdAttributeName("cn");
+// tc.setMembershipAttributeDN(true);
+// tc.setMembershipAttributeName("member");
+// typesMap.put(IdentityTypeEnum.GROUP.getName(), tc);
+//
+// // ORGANIZATION
+// tc = new SimpleLDAPIdentityObjectTypeConfiguration();
+// tc.setAllowCreateEntry(true);
+// tc.setAllowedMembershipTypes(new String[] {IdentityTypeEnum.USER.getName(),
IdentityTypeEnum.ROLE.getName(), IdentityTypeEnum.GROUP.getName()});
+// tc.setAllowEmptyMemberships(true);
+// attrs = new HashMap<String, String>();
+// //attrs.put();
+// tc.setAttributeNames(attrs);
+// newAttrs = new HashMap<String, String[]>();
+// newAttrs.put("objectClass", new String[]{"top",
"groupOfNames"});
+//
+// tc.setCreateEntryAttributeValues(newAttrs);
+// tc.setCtxDNs(new String[]
{"ou=Organizations,o=test,dc=portal,dc=example,dc=com"});
+// tc.setEntrySearchFilter(null);
+// tc.setIdAttributeName("cn");
+// tc.setMembershipAttributeDN(true);
+// tc.setMembershipAttributeName("member");
+// typesMap.put(IdentityTypeEnum.ORGANIZATION.getName(), tc);
+//
+//
+// SimpleLDAPIdentityStoreConfiguration configuration =
+// new SimpleLDAPIdentityStoreConfiguration(
+// LDAP_PROVIDER_URL,
+// LDAP_PRINCIPAL,
+// LDAP_CREDENTIALS,
+// 10000,
+// typesMap);
+//
+// ctx = new SimpleLDAPIdentityStoreInvocationContext(configuration);
+// }
+//
+//
+// // Tests
+//
+//// Just test if OpenDS is running and was populated...
+// public void testSimple() throws Exception
+// {
// populate();
-
- store = new LDAPIdentityStore("simpleTestLDAPStore");
-
-
-
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- cleanUp();
-
- openDSService.stop();
- }
-
- public void begin() throws Exception
- {
- //nothing
- }
-
- public void commit() throws Exception
- {
- //nothing
- }
-
- public void flush() throws Exception
- {
- //nothing
- }
-
- public IdentityStore getStore()
- {
- return store;
- }
-
- public IdentityStoreInvocationContext getCtx()
- {
- return ctx;
- }
-
-
-
-
-
- public void populate() throws Exception
- {
- populateLDIF("target/test-classes/ldap/initial-opends.ldif");
- }
-
- public void populateClean() throws Exception
- {
- populateLDIF("target/test-classes/ldap/initial-empty-opends.ldif");
- }
-
- public void populateLDIF(String ldifRelativePath) throws Exception
- {
- File ldif = new File(ldifRelativePath);
-
- System.out.println("LDIF: " + ldif.getAbsolutePath());
-
- String[] cmd = new String[] {"-h", LDAP_HOST,
- "-p", LDAP_PORT,
- "-D", LDAP_PRINCIPAL,
- "-w", LDAP_CREDENTIALS,
- "-a", "-f", ldif.getPath()};
-
- System.out.println("Populate success: " + (LDAPModify.mainModify(cmd,
false, System.out, System.err) == 0));
-
- }
-
- protected void cleanUp() throws Exception
- {
- try
- {
-
- DirContext ldapCtx = ctx.getLdapContext();
- String dn = "dc=portal,dc=example,dc=com";
-
- System.out.println("Removing: " + dn);
-
- removeContext(ldapCtx, dn);
- }
- catch (Exception e)
- {
- //
- }
- }
-
- //subsequent remove of javax.naming.Context
- protected void removeContext(Context mainCtx, String name) throws Exception
- {
- Context deleteCtx = (Context)mainCtx.lookup(name);
- NamingEnumeration subDirs = mainCtx.listBindings(name);
-
- while (subDirs.hasMoreElements())
- {
- Binding binding = (Binding)subDirs.nextElement();
- String subName = binding.getName();
-
- removeContext(deleteCtx, subName);
- }
-
- mainCtx.unbind(name);
- }
-
- private void initiateCtx()
- {
-
- Map<String, LDAPIdentityObjectTypeConfiguration> typesMap = new
HashMap<String, LDAPIdentityObjectTypeConfiguration>();
-
- //USER
- SimpleLDAPIdentityObjectTypeConfiguration tc = new
SimpleLDAPIdentityObjectTypeConfiguration();
- tc.setAllowCreateEntry(true);
- tc.setAllowedMembershipTypes(new String[] {});
- tc.setAllowEmptyMemberships(true);
- Map<String, String> attrs = new HashMap<String, String>();
- attrs.put("phone", "telephoneNumber");
- attrs.put("description", "description");
- attrs.put("carLicense", "carLicense");
- tc.setAttributeNames(attrs);
- Map<String, String[]> newAttrs = new HashMap<String, String[]>();
- newAttrs.put("objectClass", new String[]{"top",
"inetOrgPerson"});
- newAttrs.put("sn", new String[]{" "});
- newAttrs.put("cn", new String[]{" "});
-
- tc.setCreateEntryAttributeValues(newAttrs);
- tc.setCtxDNs(new String[]
{"ou=People,o=test,dc=portal,dc=example,dc=com"});
- tc.setEntrySearchFilter(null);
- tc.setIdAttributeName("uid");
- tc.setMembershipAttributeDN(true);
- tc.setMembershipAttributeName(null);
- typesMap.put(IdentityTypeEnum.USER.getName(), tc);
-
-
- // ROLE
- tc = new SimpleLDAPIdentityObjectTypeConfiguration();
- tc.setAllowCreateEntry(true);
- tc.setAllowedMembershipTypes(new String[] {IdentityTypeEnum.USER.getName()});
- tc.setAllowEmptyMemberships(true);
- attrs = new HashMap<String, String>();
- //attrs.put();
- tc.setAttributeNames(attrs);
- newAttrs = new HashMap<String, String[]>();
- newAttrs.put("objectClass", new String[]{"top",
"groupOfNames"});
- tc.setCreateEntryAttributeValues(newAttrs);
- tc.setCtxDNs(new String[]
{"ou=Roles,o=test,dc=portal,dc=example,dc=com"});
- tc.setEntrySearchFilter(null);
- tc.setIdAttributeName("cn");
- tc.setMembershipAttributeDN(true);
- tc.setMembershipAttributeName("member");
- typesMap.put(IdentityTypeEnum.ROLE.getName(), tc);
-
- // GROUP
- tc = new SimpleLDAPIdentityObjectTypeConfiguration();
- tc.setAllowCreateEntry(true);
- tc.setAllowedMembershipTypes(new String[] {IdentityTypeEnum.USER.getName(),
IdentityTypeEnum.ROLE.getName(), IdentityTypeEnum.GROUP.getName()});
- tc.setAllowEmptyMemberships(true);
- attrs = new HashMap<String, String>();
- //attrs.put();
- tc.setAttributeNames(attrs);
- newAttrs = new HashMap<String, String[]>();
- newAttrs.put("objectClass", new String[]{"top",
"groupOfNames"});
-
- tc.setCreateEntryAttributeValues(newAttrs);
- tc.setCtxDNs(new String[]
{"ou=Groups,o=test,dc=portal,dc=example,dc=com"});
- tc.setEntrySearchFilter(null);
- tc.setIdAttributeName("cn");
- tc.setMembershipAttributeDN(true);
- tc.setMembershipAttributeName("member");
- typesMap.put(IdentityTypeEnum.GROUP.getName(), tc);
-
- // ORGANIZATION
- tc = new SimpleLDAPIdentityObjectTypeConfiguration();
- tc.setAllowCreateEntry(true);
- tc.setAllowedMembershipTypes(new String[] {IdentityTypeEnum.USER.getName(),
IdentityTypeEnum.ROLE.getName(), IdentityTypeEnum.GROUP.getName()});
- tc.setAllowEmptyMemberships(true);
- attrs = new HashMap<String, String>();
- //attrs.put();
- tc.setAttributeNames(attrs);
- newAttrs = new HashMap<String, String[]>();
- newAttrs.put("objectClass", new String[]{"top",
"groupOfNames"});
-
- tc.setCreateEntryAttributeValues(newAttrs);
- tc.setCtxDNs(new String[]
{"ou=Organizations,o=test,dc=portal,dc=example,dc=com"});
- tc.setEntrySearchFilter(null);
- tc.setIdAttributeName("cn");
- tc.setMembershipAttributeDN(true);
- tc.setMembershipAttributeName("member");
- typesMap.put(IdentityTypeEnum.ORGANIZATION.getName(), tc);
-
-
- SimpleLDAPIdentityStoreConfiguration configuration =
- new SimpleLDAPIdentityStoreConfiguration(
- LDAP_PROVIDER_URL,
- LDAP_PRINCIPAL,
- LDAP_CREDENTIALS,
- 10000,
- typesMap);
-
- ctx = new SimpleLDAPIdentityStoreInvocationContext(configuration);
- }
-
-
- // Tests
-
-// Just test if OpenDS is running and was populated...
- public void testSimple() throws Exception
- {
- populate();
-
- Hashtable<String,String> env = new Hashtable<String,String>();
- env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
- env.put(Context.PROVIDER_URL, LDAP_PROVIDER_URL);
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, LDAP_PRINCIPAL);
- env.put(Context.SECURITY_CREDENTIALS, LDAP_CREDENTIALS);
-
- LdapContext ldapCtx = null;
- try
- {
- ldapCtx = new InitialLdapContext(env, null);
-
-// Do something ...
- System.out.println("Attributes: " +
ldapCtx.getAttributes("o=test,dc=portal,dc=example,dc=com"));
-
- }
- catch (NamingException e)
- {
- e.printStackTrace();
- }
- finally
- {
- try
- {
- if (ldapCtx != null)
- {
- ldapCtx.close();
- }
- }
- catch (NamingException e)
- {
- e.printStackTrace();
- }
- }
- }
-
- public void testIdentityObjectCount() throws Exception
- {
- populate();
-
- assertEquals(7, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
- assertEquals(5, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.ROLE));
- assertEquals(2, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.GROUP));
- }
-
- public void testFindCreateRemove() throws Exception
- {
- populate();
-
- assertEquals(7, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
-
- IdentityObject io = store.findIdentityObject(ctx, "admin",
IdentityTypeEnum.USER);
- assertEquals("admin", io.getName());
- assertEquals("uid=admin,ou=People,o=test,dc=portal,dc=example,dc=com",
io.getId().toString());
-
- //
-
- store.removeIdentityObject(ctx, io);
-
- assertEquals(6, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
-
- store.createIdentityObject(ctx, "newUserA", IdentityTypeEnum.USER);
-
- assertEquals(7, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
-
- //
-
- assertEquals(2, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.GROUP));
-
- store.createIdentityObject(ctx, "newGroupA", IdentityTypeEnum.GROUP);
-
- assertEquals(3, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.GROUP));
-
- //
-
- io = store.findIdentityObject(ctx,
"cn=newGroupA,ou=Groups,o=test,dc=portal,dc=example,dc=com");
- assertEquals("newGroupA", io.getName());
-
- }
-
- public void testAttributes() throws Exception{
-
- populate();
-
- IdentityObject user1 = store.createIdentityObject(ctx, "Adam",
IdentityTypeEnum.USER);
- IdentityObject user2 = store.createIdentityObject(ctx, "Eva",
IdentityTypeEnum.USER);
-
- //
-
- Map<String, Set<String>> attrs = new HashMap<String,
Set<String>>();
- HashSet<String> vals = new HashSet<String>();
- vals.add("val1");
- vals.add("val2");
- vals.add("val3");
-
- attrs.put("phone", vals);
-
- vals = new HashSet<String>();
- vals.add("val1");
- vals.add("val2");
- vals.add("val3");
- vals.add("val4");
- attrs.put("description", vals);
-
- store.addAttributes(ctx, user1, attrs);
-
- //
-
- Map<String, Set<String>> persistedAttrs = store.getAttributes(ctx,
user1);
-
- assertEquals(2, persistedAttrs.keySet().size());
-
- assertTrue(persistedAttrs.containsKey("phone"));
- assertEquals(3, persistedAttrs.get("phone").size());
-
- assertTrue(persistedAttrs.containsKey("description"));
- assertEquals(4, persistedAttrs.get("description").size());
-
- //
-
- attrs = new HashMap<String, Set<String>>();
- vals = new HashSet<String>();
- vals.add("val1");
- attrs.put("carLicense", vals);
-
- store.addAttributes(ctx, user1, attrs);
-
- //
-
- persistedAttrs = store.getAttributes(ctx, user1);
-
- assertEquals(3, persistedAttrs.keySet().size());
-
- assertTrue(persistedAttrs.containsKey("phone"));
- assertEquals(3, persistedAttrs.get("phone").size());
-
- assertTrue(persistedAttrs.containsKey("description"));
- assertEquals(4, persistedAttrs.get("description").size());
-
- assertTrue(persistedAttrs.containsKey("carLicense"));
- assertEquals(1, persistedAttrs.get("carLicense").size());
-
- //
-
- vals = new HashSet<String>();
- vals.add("val2");
- attrs.put("carLicense", vals);
-
- store.addAttributes(ctx, user1, attrs);
-
- //
-
- persistedAttrs = store.getAttributes(ctx, user1);
-
- assertEquals(3, persistedAttrs.keySet().size());
-
- assertTrue(persistedAttrs.containsKey("carLicense"));
- assertEquals(2, persistedAttrs.get("carLicense").size());
-
- //
-
- store.updateAttributes(ctx, user1, attrs);
-
- //
-
- persistedAttrs = store.getAttributes(ctx, user1);
-
- assertEquals(3, persistedAttrs.keySet().size());
-
- assertTrue(persistedAttrs.containsKey("carLicense"));
- assertEquals(1, persistedAttrs.get("carLicense").size());
-
- //
-
- Set<String> names = new HashSet<String>();
- names.add("carLicense");
- store.removeAttributes(ctx, user1, names);
-
- //
-
- persistedAttrs = store.getAttributes(ctx, user1);
-
- assertEquals(2, persistedAttrs.keySet().size());
-
- }
-
- public void testRelationships() throws Exception
- {
- populateClean();
-
- commonTest.testRelationships();
-
- }
-
- public void testStorePersistence() throws Exception
- {
- populateClean();
-
- commonTest.testStorePersistence();
-
- }
-
- public void testFindMethods() throws Exception
- {
- populateClean();
-
- commonTest.testFindMethods();
-
- }
-
-}
+//
+// Hashtable<String,String> env = new Hashtable<String,String>();
+// env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
+// env.put(Context.PROVIDER_URL, LDAP_PROVIDER_URL);
+// env.put(Context.SECURITY_AUTHENTICATION, "simple");
+// env.put(Context.SECURITY_PRINCIPAL, LDAP_PRINCIPAL);
+// env.put(Context.SECURITY_CREDENTIALS, LDAP_CREDENTIALS);
+//
+// LdapContext ldapCtx = null;
+// try
+// {
+// ldapCtx = new InitialLdapContext(env, null);
+//
+//// Do something ...
+// System.out.println("Attributes: " +
ldapCtx.getAttributes("o=test,dc=portal,dc=example,dc=com"));
+//
+// }
+// catch (NamingException e)
+// {
+// e.printStackTrace();
+// }
+// finally
+// {
+// try
+// {
+// if (ldapCtx != null)
+// {
+// ldapCtx.close();
+// }
+// }
+// catch (NamingException e)
+// {
+// e.printStackTrace();
+// }
+// }
+// }
+//
+// public void testIdentityObjectCount() throws Exception
+// {
+// populate();
+//
+// assertEquals(7, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
+// assertEquals(5, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.ROLE));
+// assertEquals(2, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.GROUP));
+// }
+//
+// public void testFindCreateRemove() throws Exception
+// {
+// populate();
+//
+// assertEquals(7, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
+//
+// IdentityObject io = store.findIdentityObject(ctx, "admin",
IdentityTypeEnum.USER);
+// assertEquals("admin", io.getName());
+// assertEquals("uid=admin,ou=People,o=test,dc=portal,dc=example,dc=com",
io.getId().toString());
+//
+// //
+//
+// store.removeIdentityObject(ctx, io);
+//
+// assertEquals(6, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
+//
+// store.createIdentityObject(ctx, "newUserA", IdentityTypeEnum.USER);
+//
+// assertEquals(7, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.USER));
+//
+// //
+//
+// assertEquals(2, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.GROUP));
+//
+// store.createIdentityObject(ctx, "newGroupA", IdentityTypeEnum.GROUP);
+//
+// assertEquals(3, store.getIdentityObjectsCount(ctx, IdentityTypeEnum.GROUP));
+//
+// //
+//
+// io = store.findIdentityObject(ctx,
"cn=newGroupA,ou=Groups,o=test,dc=portal,dc=example,dc=com");
+// assertEquals("newGroupA", io.getName());
+//
+// }
+//
+// public void testAttributes() throws Exception{
+//
+// populate();
+//
+// IdentityObject user1 = store.createIdentityObject(ctx, "Adam",
IdentityTypeEnum.USER);
+// IdentityObject user2 = store.createIdentityObject(ctx, "Eva",
IdentityTypeEnum.USER);
+//
+// //
+//
+// Map<String, Set<String>> attrs = new HashMap<String,
Set<String>>();
+// HashSet<String> vals = new HashSet<String>();
+// vals.add("val1");
+// vals.add("val2");
+// vals.add("val3");
+//
+// attrs.put("phone", vals);
+//
+// vals = new HashSet<String>();
+// vals.add("val1");
+// vals.add("val2");
+// vals.add("val3");
+// vals.add("val4");
+// attrs.put("description", vals);
+//
+// store.addAttributes(ctx, user1, attrs);
+//
+// //
+//
+// Map<String, Set<String>> persistedAttrs = store.getAttributes(ctx,
user1);
+//
+// assertEquals(2, persistedAttrs.keySet().size());
+//
+// assertTrue(persistedAttrs.containsKey("phone"));
+// assertEquals(3, persistedAttrs.get("phone").size());
+//
+// assertTrue(persistedAttrs.containsKey("description"));
+// assertEquals(4, persistedAttrs.get("description").size());
+//
+// //
+//
+// attrs = new HashMap<String, Set<String>>();
+// vals = new HashSet<String>();
+// vals.add("val1");
+// attrs.put("carLicense", vals);
+//
+// store.addAttributes(ctx, user1, attrs);
+//
+// //
+//
+// persistedAttrs = store.getAttributes(ctx, user1);
+//
+// assertEquals(3, persistedAttrs.keySet().size());
+//
+// assertTrue(persistedAttrs.containsKey("phone"));
+// assertEquals(3, persistedAttrs.get("phone").size());
+//
+// assertTrue(persistedAttrs.containsKey("description"));
+// assertEquals(4, persistedAttrs.get("description").size());
+//
+// assertTrue(persistedAttrs.containsKey("carLicense"));
+// assertEquals(1, persistedAttrs.get("carLicense").size());
+//
+// //
+//
+// vals = new HashSet<String>();
+// vals.add("val2");
+// attrs.put("carLicense", vals);
+//
+// store.addAttributes(ctx, user1, attrs);
+//
+// //
+//
+// persistedAttrs = store.getAttributes(ctx, user1);
+//
+// assertEquals(3, persistedAttrs.keySet().size());
+//
+// assertTrue(persistedAttrs.containsKey("carLicense"));
+// assertEquals(2, persistedAttrs.get("carLicense").size());
+//
+// //
+//
+// store.updateAttributes(ctx, user1, attrs);
+//
+// //
+//
+// persistedAttrs = store.getAttributes(ctx, user1);
+//
+// assertEquals(3, persistedAttrs.keySet().size());
+//
+// assertTrue(persistedAttrs.containsKey("carLicense"));
+// assertEquals(1, persistedAttrs.get("carLicense").size());
+//
+// //
+//
+// Set<String> names = new HashSet<String>();
+// names.add("carLicense");
+// store.removeAttributes(ctx, user1, names);
+//
+// //
+//
+// persistedAttrs = store.getAttributes(ctx, user1);
+//
+// assertEquals(2, persistedAttrs.keySet().size());
+//
+// }
+//
+// public void testRelationships() throws Exception
+// {
+// populateClean();
+//
+// commonTest.testRelationships();
+//
+// }
+//
+// public void testStorePersistence() throws Exception
+// {
+// populateClean();
+//
+// commonTest.testStorePersistence();
+//
+// }
+//
+// public void testFindMethods() throws Exception
+// {
+// populateClean();
+//
+// commonTest.testFindMethods();
+//
+// }
+//
+//}
Modified:
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityStoreInvocationContext.java
===================================================================
---
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityStoreInvocationContext.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-impl/src/test/java/org/jboss/identity/impl/store/ldap/SimpleLDAPIdentityStoreInvocationContext.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -1,60 +1,60 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.identity.impl.store.ldap;
-
-import javax.naming.ldap.LdapContext;
-import javax.naming.ldap.InitialLdapContext;
-import javax.naming.Context;
-import java.util.Hashtable;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public class SimpleLDAPIdentityStoreInvocationContext implements
LDAPIdentityStoreInvocationContext
-{
-
- LDAPIdentityStoreConfiguration configuration;
-
- public SimpleLDAPIdentityStoreInvocationContext(LDAPIdentityStoreConfiguration
configuration)
- {
- this.configuration = configuration;
- }
-
- public LdapContext getLdapContext() throws Exception
- {
- Hashtable<String,String> env = new Hashtable<String,String>();
- env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
- env.put(Context.PROVIDER_URL, getConfiguration().getProviderURL());
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, getConfiguration().getAdminDN());
- env.put(Context.SECURITY_CREDENTIALS, getConfiguration().getAdminPassword());
-
- return new InitialLdapContext(env, null);
- }
-
- public LDAPIdentityStoreConfiguration getConfiguration()
- {
- return configuration;
- }
-}
+///*
+//* JBoss, a division of Red Hat
+//* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+//* by the @authors tag. See the copyright.txt in the distribution for a
+//* full listing of individual contributors.
+//*
+//* This is free software; you can redistribute it and/or modify it
+//* under the terms of the GNU Lesser General Public License as
+//* published by the Free Software Foundation; either version 2.1 of
+//* the License, or (at your option) any later version.
+//*
+//* This software is distributed in the hope that it will be useful,
+//* but WITHOUT ANY WARRANTY; without even the implied warranty of
+//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+//* Lesser General Public License for more details.
+//*
+//* You should have received a copy of the GNU Lesser General Public
+//* License along with this software; if not, write to the Free
+//* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+//* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+//*/
+//
+//package org.jboss.identity.impl.store.ldap;
+//
+//import javax.naming.ldap.LdapContext;
+//import javax.naming.ldap.InitialLdapContext;
+//import javax.naming.Context;
+//import java.util.Hashtable;
+//
+///**
+// * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+// * @version : 0.1 $
+// */
+//public class SimpleLDAPIdentityStoreInvocationContext implements
LDAPIdentityStoreInvocationContext
+//{
+//
+// LDAPIdentityStoreConfiguration configuration;
+//
+// public SimpleLDAPIdentityStoreInvocationContext(LDAPIdentityStoreConfiguration
configuration)
+// {
+// this.configuration = configuration;
+// }
+//
+// public LdapContext getLdapContext() throws Exception
+// {
+// Hashtable<String,String> env = new Hashtable<String,String>();
+// env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
+// env.put(Context.PROVIDER_URL, getConfiguration().getProviderURL());
+// env.put(Context.SECURITY_AUTHENTICATION, "simple");
+// env.put(Context.SECURITY_PRINCIPAL, getConfiguration().getAdminDN());
+// env.put(Context.SECURITY_CREDENTIALS, getConfiguration().getAdminPassword());
+//
+// return new InitialLdapContext(env, null);
+// }
+//
+// public LDAPIdentityStoreConfiguration getConfiguration()
+// {
+// return configuration;
+// }
+//}
Modified: trunk/identity-impl/src/test/resources/META-INF/persistence.xml
===================================================================
--- trunk/identity-impl/src/test/resources/META-INF/persistence.xml 2008-11-04 03:45:19
UTC (rev 119)
+++ trunk/identity-impl/src/test/resources/META-INF/persistence.xml 2008-11-06 23:36:08
UTC (rev 120)
@@ -5,7 +5,7 @@
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
- <persistence-unit name="jboss-identity-model"
transaction-type="RESOURCE_LOCAL">
+ <persistence-unit name="jboss-identity-model1"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
@@ -19,14 +19,39 @@
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
- <property name="hibernate.connection.url"
value="jdbc:hsqldb:mem:unit-testing-jpa"/>
+ <property name="hibernate.connection.url"
value="jdbc:hsqldb:mem:unit-testing-jpa1"/>
<property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
<property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
+ <property name="hibernate.hbm2ddl.auto"
value="update"/>
<property name="hibernate.connection.username"
value="sa"/>
<property name="hibernate.connection.password"
value=""/>
</properties>
</persistence-unit>
+
+ <persistence-unit name="jboss-identity-model2"
transaction-type="RESOURCE_LOCAL">
+
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+
+
<class>org.jboss.identity.impl.model.hibernate.HibernateIdentityObject</class>
+
<class>org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectAttribute</class>
+
<class>org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectType</class>
+
<class>org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectRelationship</class>
+
<class>org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectRelationshipType</class>
+
<class>org.jboss.identity.impl.model.hibernate.HibernateIdentityObjectRelationshipName</class>
+
+
+ <exclude-unlisted-classes>true</exclude-unlisted-classes>
+ <properties>
+ <property name="hibernate.connection.url"
value="jdbc:hsqldb:mem:unit-testing-jpa2"/>
+ <property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.hbm2ddl.auto"
value="update"/>
+ <property name="hibernate.connection.username"
value="sa"/>
+ <property name="hibernate.connection.password"
value=""/>
+ </properties>
+
+
+ </persistence-unit>
</persistence>
\ No newline at end of file
Added: trunk/identity-impl/src/test/resources/identity-config.xml
===================================================================
--- trunk/identity-impl/src/test/resources/identity-config.xml
(rev 0)
+++ trunk/identity-impl/src/test/resources/identity-config.xml 2008-11-06 23:36:08 UTC
(rev 120)
@@ -0,0 +1,252 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--<xs:schema-->
+<!--attributeFormDefault="unqualified"-->
+<!--elementFormDefault="qualified"-->
+<!--xmlns:xs="http://www.w3.org/2001/XMLSchema"-->
+<!--targetNamespace="urn:jboss:identity:config:v0_1"-->
+<!--xmlns="urn:jboss:identity:config:v0_1"-->
+<!--xmlns:xml="http://www.w3.org/XML/1998/namespace"-->
+<!--xmlns:wcc="urn:jboss:identity:config:v0_1"> -->
+
+<jboss-identity xmlns="urn:jboss:identity:config:v0_1"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:config:v0_1
identity-config.xsd">
+ <realms>
+ <realm>
+ <id></id>
+ <repository-id-ref></repository-id-ref>
+ <realm-configuration>
+ <identity-type-mappings>
+ <identity-mapping></identity-mapping>
+ <group-type-mapping>
+ <group-type-name></group-type-name>
+ <identity-object-type-name></identity-object-type-name>
+ </group-type-mapping>
+ <group-type-mapping>
+ <group-type-name></group-type-name>
+ <identity-object-type-name></identity-object-type-name>
+ </group-type-mapping>
+ </identity-type-mappings>
+ <options>
+ <option>
+ <name></name>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </option>
+ <option>
+ <name></name>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </option>
+ </options>
+ </realm-configuration>
+ </realm>
+ <realm>
+ <id></id>
+ <repository-id-ref></repository-id-ref>
+ <realm-configuration/>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id></id>
+ <class></class>
+ <repository-configuration>
+ <external-config override="true"></external-config>
+ <default-identity-store-id></default-identity-store-id>
+ <default-attribute-store-id></default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id></identity-store-id>
+ <identity-object-types>
+ <identity-object-type></identity-object-type>
+ <identity-object-type></identity-object-type>
+ <identity-object-type></identity-object-type>
+ <identity-object-type></identity-object-type>
+ <identity-object-type></identity-object-type>
+ </identity-object-types>
+ <options>
+ <option>
+ <name></name>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </option>
+ <option>
+ <name></name>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </option>
+ </options>
+ </identity-store-mapping>
+ <identity-store-mapping>
+ <identity-store-id></identity-store-id>
+ <identity-object-types>
+ <identity-object-type></identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ <options>
+ <option>
+ <name></name>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </option>
+ <option>
+ <name></name>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </option>
+ </options>
+ </repository-configuration>
+ </repository>
+ <repository>
+ <id></id>
+ <class></class>
+ <repository-configuration/>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id></id>
+ <class></class>
+ <identity-store-configuration>
+ <external-config
override="false"></external-config>
+ <supported-relationship-types>
+ <relationship-type></relationship-type>
+ <relationship-type></relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name></name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name></name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref></relationship-type-ref>
+
<identity-object-type-ref></identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options/>
+ </identity-store-configuration>
+ </identity-store>
+ <identity-store>
+ <id></id>
+ <class></class>
+ <identity-store-configuration>
+ <external-config override="true"></external-config>
+ <supported-relationship-types>
+ <relationship-type></relationship-type>
+ <relationship-type></relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name></name>
+ <relationships/>
+ <attributes>
+ <attribute>
+ <name></name>
+ <mapping></mapping>
+ <isRequired></isRequired>
+ <isMultivalued></isMultivalued>
+ <isReadOnly></isReadOnly>
+ </attribute>
+ <attribute>
+ <name></name>
+ <mapping/>
+ <isRequired></isRequired>
+ <isMultivalued></isMultivalued>
+ <isReadOnly></isReadOnly>
+ </attribute>
+ </attributes>
+ <options>
+ <option>
+ <name></name>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </option>
+ <option>
+ <name></name>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name></name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref></relationship-type-ref>
+
<identity-object-type-ref></identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref></relationship-type-ref>
+
<identity-object-type-ref></identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <attributes>
+ <attribute>
+ <name></name>
+ <mapping/>
+ <isRequired>true</isRequired>
+ <isMultivalued>true</isMultivalued>
+ </attribute>
+ <attribute>
+ <name></name>
+ <mapping/>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ </attribute>
+ </attributes>
+ <options>
+ <option>
+ <name></name>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </option>
+ </options>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name></name>
+ <value></value>
+ <value></value>
+ <value></value>
+ <value></value>
+ </option>
+ </options>
+ </identity-store-configuration>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
\ No newline at end of file
Added: trunk/identity-impl/src/test/resources/identity-config.xsd
===================================================================
--- trunk/identity-impl/src/test/resources/identity-config.xsd
(rev 0)
+++ trunk/identity-impl/src/test/resources/identity-config.xsd 2008-11-06 23:36:08 UTC
(rev 120)
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="urn:jboss:identity:config:v0_1"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="jboss-identity" type="urn:jboss-identityType"
xmlns:urn="urn:jboss:identity:config:v0_1">
+ <xs:annotation>
+
<
xs:documentation><xs:schemaattributeFormDefault="unqualifi...
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="repositoryType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="id"/>
+ <xs:element type="xs:string" name="class"/>
+ <xs:element type="urn:repository-configurationType"
name="repository-configuration"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-store-configurationType">
+ <xs:sequence>
+ <xs:element type="urn:external-configType"
name="external-config"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ <xs:element type="urn:supported-relationship-typesType"
name="supported-relationship-types"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ <xs:element type="urn:supported-identity-object-typesType"
name="supported-identity-object-types"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ <xs:element name="options">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element type="urn:optionType" name="option"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="external-configType">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute type="xs:string" name="override"
use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:complexType name="identity-store-mappingsType">
+ <xs:sequence>
+ <xs:element type="urn:identity-store-mappingType"
name="identity-store-mapping" maxOccurs="unbounded"
minOccurs="0" xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="jboss-identityType">
+ <xs:sequence>
+ <xs:element type="urn:realmsType" name="realms"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ <xs:element type="urn:repositoriesType" name="repositories"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ <xs:element type="urn:storesType" name="stores"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="optionType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="name"/>
+ <xs:element type="xs:string" name="value"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="realmsType">
+ <xs:sequence>
+ <xs:element type="urn:realmType" name="realm"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-type-mappingsType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="identity-mapping"/>
+ <xs:element type="urn:group-type-mappingType"
name="group-type-mapping" maxOccurs="unbounded"
minOccurs="0" xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-storesType">
+ <xs:sequence>
+ <xs:element type="urn:identity-storeType"
name="identity-store" maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-store-mappingType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="identity-store-id"/>
+ <xs:element type="urn:identity-object-typesType"
name="identity-object-types"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ <xs:element type="urn:optionsType" name="options"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="attributesType">
+ <xs:sequence>
+ <xs:element type="urn:attributeType" name="attribute"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="realm-configurationType">
+ <xs:sequence>
+ <xs:element type="urn:identity-type-mappingsType"
name="identity-type-mappings" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ <xs:element type="urn:optionsType" name="options"
minOccurs="0" xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="repository-configurationType">
+ <xs:sequence>
+ <xs:element type="urn:external-configType"
name="external-config" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ <xs:element type="xs:string"
name="default-identity-store-id" minOccurs="0"/>
+ <xs:element type="xs:string"
name="default-attribute-store-id" minOccurs="0"/>
+ <xs:element type="urn:identity-store-mappingsType"
name="identity-store-mappings" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ <xs:element type="urn:optionsType" name="options"
minOccurs="0" xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-object-typeType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="name"/>
+ <xs:element name="relationships">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element type="urn:relationshipType"
name="relationship" maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="attributes">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element type="urn:attributeType" name="attribute"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="options">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element type="urn:optionType" name="option"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-object-typesType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="identity-object-type"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="identity-storeType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="id"/>
+ <xs:element type="xs:string" name="class"/>
+ <xs:element type="urn:identity-store-configurationType"
name="identity-store-configuration"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="storesType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="attribute-stores"/>
+ <xs:element type="urn:identity-storesType"
name="identity-stores"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="supported-identity-object-typesType">
+ <xs:sequence>
+ <xs:element type="urn:identity-object-typeType"
name="identity-object-type" maxOccurs="unbounded"
minOccurs="0" xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="group-type-mappingType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="group-type-name"/>
+ <xs:element type="xs:string"
name="identity-object-type-name"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="repositoriesType">
+ <xs:sequence>
+ <xs:element type="urn:repositoryType" name="repository"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="realmType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="id"/>
+ <xs:element type="xs:string" name="repository-id-ref"/>
+ <xs:element type="urn:realm-configurationType"
name="realm-configuration"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="relationshipsType">
+ <xs:sequence>
+ <xs:element type="urn:relationshipType" name="relationship"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="supported-relationship-typesType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="relationship-type"
maxOccurs="unbounded" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="optionsType">
+ <xs:sequence>
+ <xs:element type="urn:optionType" name="option"
maxOccurs="unbounded" minOccurs="0"
xmlns:urn="urn:jboss:identity:config:v0_1"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="relationshipType">
+ <xs:sequence>
+ <xs:element type="xs:string"
name="relationship-type-ref"/>
+ <xs:element type="xs:string"
name="identity-object-type-ref"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="attributeType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="name"/>
+ <xs:element type="xs:string" name="mapping"/>
+ <xs:element type="xs:string" name="isRequired"/>
+ <xs:element type="xs:string" name="isMultivalued"/>
+ <xs:element type="xs:string" name="isReadOnly"
minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file
Added: trunk/identity-impl/src/test/resources/organization-test-config.xml
===================================================================
--- trunk/identity-impl/src/test/resources/organization-test-config.xml
(rev 0)
+++ trunk/identity-impl/src/test/resources/organization-test-config.xml 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,439 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-identity xmlns="urn:jboss:identity:config:v0_1"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:config:v0_1
identity-config.xsd">
+ <realms>
+ <realm>
+ <id>realm://RedHat/DB</id>
+ <repository-id-ref>RedHat Repository DB</repository-id-ref>
+ <realm-configuration>
+ <identity-type-mappings>
+ <identity-mapping>IDENTITY</identity-mapping>
+ </identity-type-mappings>
+ </realm-configuration>
+ </realm>
+ <realm>
+ <id>realm://portal/SamplePortal/DB</id>
+ <repository-id-ref>Sample Portal Repository DB</repository-id-ref>
+ <realm-configuration>
+ <identity-type-mappings>
+ <identity-mapping>IDENTITY</identity-mapping>
+ </identity-type-mappings>
+ </realm-configuration>
+ </realm>
+ <realm>
+ <id>realm://RedHat/DB_LDAP</id>
+ <repository-id-ref>RedHat Repository DB+LDAP</repository-id-ref>
+ <realm-configuration>
+ <identity-type-mappings>
+ <identity-mapping>IDENTITY</identity-mapping>
+ </identity-type-mappings>
+ </realm-configuration>
+ </realm>
+ <realm>
+ <id>realm://portal/SamplePortal/DB_LDAP</id>
+ <repository-id-ref>Sample Portal Repository
DB+LDAP</repository-id-ref>
+ <realm-configuration>
+ <identity-type-mappings>
+ <identity-mapping>IDENTITY</identity-mapping>
+ </identity-type-mappings>
+ </realm-configuration>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>RedHat Repository DB</id>
+
<class>org.jboss.identity.impl.repository.FallbackIdentityStoreRepository</class>
+ <repository-configuration>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id>Hibernate Identity
Store</identity-store-id>
+ <identity-object-types>
+
<identity-object-type>ORGANIZATION</identity-object-type>
+
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
+ <identity-object-type>DIVISION</identity-object-type>
+ <identity-object-type>DEPARTMENT</identity-object-type>
+ <identity-object-type>PROJECT</identity-object-type>
+ <identity-object-type>PEOPLE</identity-object-type>
+ <identity-object-type>IDENTITY</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ </repository-configuration>
+ </repository>
+ <repository>
+ <id>Sample Portal Repository DB</id>
+
<class>org.jboss.identity.impl.repository.FallbackIdentityStoreRepository</class>
+ <repository-configuration>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id>Hibernate Identity
Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>SYSTEM</identity-object-type>
+
<identity-object-type>ADMINISTRATION</identity-object-type>
+ <identity-object-type>COMMUNITY</identity-object-type>
+
<identity-object-type>ORGANIZATION</identity-object-type>
+
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
+ <identity-object-type>OFFICE</identity-object-type>
+ <identity-object-type>DIVISION</identity-object-type>
+ <identity-object-type>DEPARTMENT</identity-object-type>
+ <identity-object-type>SECURITY</identity-object-type>
+ <identity-object-type>PEOPLE</identity-object-type>
+ <identity-object-type>IDENTITY</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ </repository-configuration>
+ </repository>
+ <repository>
+ <id>RedHat Repository DB+LDAP</id>
+
<class>org.jboss.identity.impl.repository.FallbackIdentityStoreRepository</class>
+ <repository-configuration>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id>Hibernate Identity
Store</identity-store-id>
+ <identity-object-types>
+
<identity-object-type>ORGANIZATION</identity-object-type>
+
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
+ <identity-object-type>DIVISION</identity-object-type>
+ <identity-object-type>DEPARTMENT</identity-object-type>
+ <identity-object-type>PROJECT</identity-object-type>
+ <identity-object-type>PEOPLE</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ <identity-store-mapping>
+ <identity-store-id>LDAP Identity Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>IDENTITY</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ </repository-configuration>
+ </repository>
+ <repository>
+ <id>Sample Portal Repository DB+LDAP</id>
+
<class>org.jboss.identity.impl.repository.FallbackIdentityStoreRepository</class>
+ <repository-configuration>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id>Hibernate Identity
Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>SYSTEM</identity-object-type>
+
<identity-object-type>ADMINISTRATION</identity-object-type>
+ <identity-object-type>COMMUNITY</identity-object-type>
+
<identity-object-type>ORGANIZATION</identity-object-type>
+
<identity-object-type>ORGANIZATION_UNIT</identity-object-type>
+ <identity-object-type>OFFICE</identity-object-type>
+ <identity-object-type>DIVISION</identity-object-type>
+ <identity-object-type>DEPARTMENT</identity-object-type>
+ <identity-object-type>SECURITY</identity-object-type>
+ <identity-object-type>PEOPLE</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ <identity-store-mapping>
+ <identity-store-id>LDAP Identity Store</identity-store-id>
+ <identity-object-types>
+ <identity-object-type>IDENTITY</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ </repository-configuration>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>Hibernate Identity Store</id>
+
<class>org.jboss.identity.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <identity-store-configuration>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+ <relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>IDENTITY</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION_UNIT</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DIVISION</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DEPARTMENT</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>PROJECT</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>PEOPLE</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ADMINISTRATION</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>COMMUNITY</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>OFFICE</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>SECURITY</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>SYSTEM</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>persistenceUnit</name>
+ <value>jboss-identity-model1</value>
+ </option>
+ <option>
+ <name>populateRelationshipTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </identity-store-configuration>
+ </identity-store>
+ <identity-store>
+ <id>LDAP Identity Store</id>
+
<class>org.jboss.identity.impl.store.ldap.LDAPIdentityStore</class>
+ <identity-store-configuration>
+ <external-config/>
+ <supported-relationship-types/>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>IDENTITY</name>
+ <relationships/>
+ <attributes>
+ <attribute>
+ <name>phone</name>
+ <mapping>telephoneNumber</mapping>
+ <isRequired/>
+ <isMultivalued/>
+ <isReadOnly/>
+ </attribute>
+ <attribute>
+ <name>description</name>
+ <mapping>description</mapping>
+ <isRequired/>
+ <isMultivalued/>
+ <isReadOnly/>
+ </attribute>
+ <attribute>
+ <name>carLicense</name>
+ <mapping>carLicense</mapping>
+ <isRequired/>
+ <isMultivalued/>
+ <isReadOnly/>
+ </attribute>
+ </attributes>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=People,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=inetOrgPerson</value>
+ <value>sn= </value>
+ <value>cn= </value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>GROUP</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref/>
+
<identity-object-type-ref>IDENTITY</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref/>
+
<identity-object-type-ref>ROLE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref/>
+
<identity-object-type-ref>GROUP</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Roles,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ROLE</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref/>
+
<identity-object-type-ref>IDENTITY</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+
<value>ou=Roles,o=test,dc=portal,dc=example,dc=com</value>
+ </option>
+ <!--<option>-->
+ <!--<name>entrySearchFilter</name>-->
+ <!--<value></value>-->
+ <!--</option>-->
+ <option>
+ <name>allowCreateEntry</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>membershipAttributeName</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>isMembershipAttributeDN</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowEmptyMemberships</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>createEntryAttributeValues</name>
+ <value>objectClass=top</value>
+ <value>objectClass=groupOfNames</value>
+ </option>
+ </options>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>providerURL</name>
+ <value>ldap://localhost:10389</value>
+ </option>
+ <option>
+ <name>adminDN</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>adminPassword</name>
+ <value>password</value>
+ </option>
+ <option>
+ <name>searchTimeLimit</name>
+ <value>10000</value>
+ </option>
+ </options>
+ </identity-store-configuration>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
\ No newline at end of file
Added: trunk/identity-impl/src/test/resources/test-config.xml
===================================================================
--- trunk/identity-impl/src/test/resources/test-config.xml (rev
0)
+++ trunk/identity-impl/src/test/resources/test-config.xml 2008-11-06 23:36:08 UTC (rev
120)
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-identity xmlns="urn:jboss:identity:config:v0_1"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:config:v0_1
identity-config.xsd">
+ <realms>
+ <realm>
+ <id></id>
+ <repository-id-ref></repository-id-ref>
+ <realm-configuration>
+ <!--Use direct type mappper when not specified-->
+ <!--<identity-type-mappings>-->
+
<!--<identity-mapping>JBOSS_IDENTITY_IDENTITY</identity-mapping>-->
+ <!--<group-type-mapping>-->
+ <!--<group-type-name>ORGANIZATION</group-type-name>-->
+
<!--<identity-object-type-name>JBOSS_IDENTITY_GROUP_ORGANIZATION</identity-object-type-name>-->
+ <!--</group-type-mapping>-->
+ <!--<group-type-mapping>-->
+
<!--<group-type-name>ORGANIZATION_UNIT</group-type-name>-->
+
<!--<identity-object-type-name>JBOSS_IDENTITY_GROUP_ORGANIZATION_UNIT</identity-object-type-name>-->
+ <!--</group-type-mapping>-->
+ <!--</identity-type-mappings>-->
+ </realm-configuration>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>Fallback Repository - ACME</id>
+
<class>org.jboss.identity.impl.repository.FallbackIdentityStoreRepository</class>
+ <repository-configuration>
+ <external-config
override="false">path/to/file.xml</external-config>
+ <default-identity-store-id>Hibernate Identity
Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity
Store</default-attribute-store-id>
+ <identity-store-mappings>
+ <identity-store-mapping>
+ <identity-store-id>Hibernate Identity
Store</identity-store-id>
+ <identity-object-types>
+
<identity-object-type>JBOSS_IDENTITY_GROUP_ORGANIZATION</identity-object-type>
+
<identity-object-type>JBOSS_IDENTITY_GROUP_ORGANIZATION_UNIT</identity-object-type>
+
<identity-object-type>JBOSS_IDENTITY_GROUP_DIVISION</identity-object-type>
+
<identity-object-type>JBOSS_IDENTITY_GROUP_DEPARTMENT</identity-object-type>
+
<identity-object-type>JBOSS_IDENTITY_GROUP_PROJECT</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ <identity-store-mapping>
+ <identity-store-id>LDAP Identity
Store</identity-store-id>
+ <identity-object-types>
+
<identity-object-type>JBOSS_IDENTITY_GROUP_PEOPLE</identity-object-type>
+ </identity-object-types>
+ <options/>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ <!--<option-groups>-->
+ <!--<option-group>-->
+ <!--<name></name>-->
+ <!--<options>-->
+ <!--<option>-->
+ <!--<name></name>-->
+ <!--<values>-->
+ <!--<value></value>-->
+ <!--</values>-->
+ <!--</option>-->
+ <!--</options>-->
+ <!--</option-group>-->
+ <!--</option-groups>-->
+ </repository-configuration>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>Hibernate Identity Store</id>
+
<class>org.jboss.identity.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <identity-store-configuration>
+ <external-config/>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_RELATIONSHIP_MEMBERSHIP</relationship-type>
+
<relationship-type>JBOSS_IDENTITY_RELATIONSHIP_ROLE</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>JBOSS_IDENTITY_IDENTITY</name>
+ <relationships/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>JBOSS_IDENTITY_GROUP</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_RELATIONSHIP_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>JBOSS_IDENTITY_IDENTITY</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options/>
+
+ </identity-store-configuration>
+ </identity-store>
+ <identity-store>
+ <id>LDAP Identity Store</id>
+
<class>org.jboss.identity.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <identity-store-configuration>
+ <external-config
override="false">path/to/file.xml</external-config>
+ <supported-relationship-types>
+
<relationship-type>JBOSS_IDENTITY_RELATIONSHIP_MEMBERSHIP</relationship-type>
+
<relationship-type>JBOSS_IDENTITY_RELATIONSHIP_ROLE</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>JBOSS_IDENTITY_IDENTITY</name>
+ <relationships/>
+ <attributes>
+ <attribute>
+ <name>user.name.given</name>
+ <mapping/>
+ <isRequired>false</isRequired>
+ <isMultivalued>true</isMultivalued>
+ </attribute>
+ <attribute>
+ <name>user.name.family</name>
+ <mapping/>
+ <isRequired>false</isRequired>
+ <isMultivalued>true</isMultivalued>
+ </attribute>
+ </attributes>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>JBOSS_IDENTITY_GROUP_ORGANIZATION</name>
+ <relationships>
+ <relationship>
+
<relationship-type-ref>JBOSS_IDENTITY_RELATIONSHIP_MEMBERSHIP</relationship-type-ref>
+
<identity-object-type-ref>JBOSS_IDENTITY_IDENTITY</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <attributes>
+ <attribute>
+ <name>user.name.given</name>
+ <mapping/>
+ <isRequired>false</isRequired>
+ <isMultivalued>true</isMultivalued>
+ </attribute>
+ <attribute>
+ <name>user.name.family</name>
+ <mapping/>
+ <isRequired>false</isRequired>
+ <isMultivalued>true</isMultivalued>
+ </attribute>
+ </attributes>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options/>
+ <!--<options>-->
+ <!--<option>-->
+ <!--<name></name>-->
+ <!--<values>-->
+ <!--<value></value>-->
+ <!--</values>-->
+ <!--</option>-->
+ <!--</options>-->
+ </identity-store-configuration>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
\ No newline at end of file
Modified:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaData.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -31,12 +31,22 @@
/**
* @return
*/
+ String getName();
+
+ /**
+ * @return
+ */
+ String getStoreMapping();
+
+ /**
+ * @return
+ */
boolean isReadonly();
/**
* @return
*/
- boolean isMultivalue();
+ boolean isMultivalued();
/**
* @return
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaDataImpl.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaDataImpl.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/attribute/AttributeMetaDataImpl.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,95 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.attribute;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class AttributeMetaDataImpl implements AttributeMetaData
+{
+
+ private String name;
+
+ private String storeMapping;
+
+ private boolean readonly;
+
+ private boolean multivalued;
+
+ private boolean required;
+
+ public AttributeMetaDataImpl()
+ {
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getStoreMapping()
+ {
+ return storeMapping;
+ }
+
+ public void setStoreMapping(String storeMapping)
+ {
+ this.storeMapping = storeMapping;
+ }
+
+ public boolean isReadonly()
+ {
+ return readonly;
+ }
+
+ public void setReadonly(boolean readonly)
+ {
+ this.readonly = readonly;
+ }
+
+ public boolean isMultivalued()
+ {
+ return multivalued;
+ }
+
+ public void setMultivalued(boolean multivalued)
+ {
+ this.multivalued = multivalued;
+ }
+
+ public boolean isRequired()
+ {
+ return required;
+ }
+
+ public void setRequired(boolean required)
+ {
+ this.required = required;
+ }
+}
Modified:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/ConfigurationService.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/ConfigurationService.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/ConfigurationService.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -25,33 +25,14 @@
import java.util.Collection;
/**
- *
- * Main entry point to grab configuration information
- *
- * //TODO: Should this be readonly (bootstrapped once) or expose setters also
- *
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
public interface ConfigurationService
{
- /**
- * @return group of global properties
- */
- PropertyGroup getProperties();
- /**
- * @param groupName
- * @return group of properties under given namespace
- */
- PropertyGroup getProperties(String groupName);
- /**
- * @return all property groups
- */
- Collection<PropertyGroup> getPropertyGroups();
-
}
Deleted:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/PropertyGroup.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/PropertyGroup.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/PropertyGroup.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -1,41 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.identity.spi.configuration;
-
-import java.util.Set;
-import java.util.Map;
-
-/**
- * Group of multivalued properties
- *
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface PropertyGroup
-{
-
- Map<String, Set<String>> getProperties();
-
- Set<String> getPropertyValues(String name);
-
-}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityConfigurationMetaData.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityConfigurationMetaData.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityConfigurationMetaData.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,41 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.configuration.metadata;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityConfigurationMetaData
+{
+ List<RealmConfigurationMetaData> getRealms();
+
+ List<IdentityRepositoryConfigurationMetaData> getRepositories();
+
+ List<IdentityStoreConfigurationMetaData> getIdentityStores();
+
+ Map<String, List<String>> getOptions();
+}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityObjectTypeMetaData.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityObjectTypeMetaData.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityObjectTypeMetaData.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,47 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.configuration.metadata;
+
+import org.jboss.identity.spi.attribute.AttributeMetaData;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityObjectTypeMetaData
+{
+ String getName();
+
+ List<RelationshipMetaData> getRelationships();
+
+ List<AttributeMetaData> getAttributes();
+
+ Map<String, List<String>> getOptions();
+
+ List<String> getOption(String optionName);
+
+ String getOptionSingleValue(String optionName);
+}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityRepositoryConfigurationMetaData.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityRepositoryConfigurationMetaData.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityRepositoryConfigurationMetaData.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,51 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.configuration.metadata;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityRepositoryConfigurationMetaData
+{
+ String getId();
+
+ String getClassName();
+
+ String getExternalConfig();
+
+ String getDefaultIdentityStoreId();
+
+ String getDefaultAttributeStroeId();
+
+ List<IdentityStoreMappingMetaData>
getIdentityStoreToIdentityObjectTypeMappings();
+
+ Map<String, List<String>> getOptions();
+
+ List<String> getOption(String optionName);
+
+ String getOptionSingleValue(String optionName);
+}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityStoreConfigurationMetaData.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityStoreConfigurationMetaData.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityStoreConfigurationMetaData.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,49 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.configuration.metadata;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityStoreConfigurationMetaData
+{
+ String getId();
+
+ String getClassName();
+
+ String getExternalConfig();
+
+ List<String> getSupportedRelationshipTypes();
+
+ List<IdentityObjectTypeMetaData> getSupportedIdentityTypes();
+
+ Map<String, List<String>> getOptions();
+
+ List<String> getOption(String optionName);
+
+ String getOptionSingleValue(String optionName);
+}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityStoreMappingMetaData.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityStoreMappingMetaData.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/IdentityStoreMappingMetaData.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,43 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.configuration.metadata;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityStoreMappingMetaData
+{
+ String getIdentityStoreId();
+
+ List<String> getIdentityObjectTypeMappings();
+
+ Map<String, List<String>> getOptions();
+
+ List<String> getOption(String optionName);
+
+ String getOptionSingleValue(String optionName);
+}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/RealmConfigurationMetaData.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/RealmConfigurationMetaData.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/RealmConfigurationMetaData.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,43 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.configuration.metadata;
+
+import java.util.Map;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface RealmConfigurationMetaData
+{
+ String getId();
+
+ String getIdentityRepositoryIdRef();
+
+ String getIdentityMapping();
+
+ Map<String, String> getGroupTypeMappings();
+
+ Map<String, List<String>> getOptions();
+}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/RelationshipMetaData.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/RelationshipMetaData.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/configuration/metadata/RelationshipMetaData.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,34 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.configuration.metadata;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface RelationshipMetaData
+{
+ String getRelationshipTypeRef();
+
+ String getIdentityObjectTypeRef();
+}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/exception/IdentityConfigurationException.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/exception/IdentityConfigurationException.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/exception/IdentityConfigurationException.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,52 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.exception;
+
+import org.jboss.identity.exception.IdentityException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentityConfigurationException extends IdentityException
+{
+ public IdentityConfigurationException()
+ {
+ super();
+ }
+
+ public IdentityConfigurationException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public IdentityConfigurationException(String msg)
+ {
+ super(msg);
+ }
+
+ public IdentityConfigurationException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Modified:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/repository/IdentityStoreRepository.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/repository/IdentityStoreRepository.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/repository/IdentityStoreRepository.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -23,12 +23,12 @@
import java.util.Map;
import java.util.Set;
-import java.util.List;
import org.jboss.identity.spi.model.IdentityObjectType;
import org.jboss.identity.spi.store.IdentityStore;
import org.jboss.identity.spi.store.AttributeStore;
-import org.jboss.identity.spi.policy.RelationshipPolicy;
+import
org.jboss.identity.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
+import org.jboss.identity.exception.IdentityException;
/**
* IdentityStoreRepository exposes identity object management
@@ -43,6 +43,11 @@
*/
public interface IdentityStoreRepository extends IdentityStore
{
+
+ public void bootstrap(IdentityRepositoryConfigurationMetaData configurationMD,
+ Map<String, IdentityStore> bootstrappedIdentityStores,
+ Map<String, AttributeStore> bootstrappedAttributeStores)
throws IdentityException;
+
/**
* @return a set of configured identity stores
*/
Modified:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/AttributeStore.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -36,9 +36,14 @@
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public interface AttributeStore
+public interface AttributeStore extends IdentityStoreSessionFactory
{
+ /**
+ * @return id of this identity store
+ */
+ String getId();
+
//TODO: replace Set<String> with String[] in method signatures
/**
@@ -50,6 +55,8 @@
<T extends IdentityObjectType> Set<String>
getSupportedAttributeNames(IdentityStoreInvocationContext invocationContext, T
identityType)
throws IdentityException;
+ //TODO: isNotConfiguredAttributeSupported - if store can handle attribute not
mentioned in method above
+
/**
* Get attributes for the given identity
*
Modified:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/FeaturesMetaData.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -37,6 +37,9 @@
*/
public interface FeaturesMetaData
{
+
+ //TODO: change supported operations to isControlSupported(IdentitySearchControl)
+
/**
* Get the supported operations
* @param identityObjectType a type representing identity, role, group
Modified:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStore.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -31,6 +31,7 @@
import org.jboss.identity.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.spi.model.IdentityObjectRelationship;
import org.jboss.identity.spi.exception.OperationNotSupportedException;
+import org.jboss.identity.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.exception.IdentityException;
/**
@@ -42,10 +43,14 @@
*/
public interface IdentityStore extends AttributeStore
{
+
/**
* Set up the store
+ *
+ * @param configurationMD
+ * @throws IOException
*/
- void bootstrap() throws IOException;
+ void bootstrap(IdentityStoreConfigurationMetaData configurationMD) throws
IdentityException;
/**
* @return id of this identity store
@@ -72,6 +77,10 @@
*/
IdentityObject createIdentityObject(IdentityStoreInvocationContext invocationCtx,
String name, IdentityObjectType identityObjectType) throws IdentityException;
+
+ //TODO: create method with a set of attributes (for required attrs)
+
+
/**
* Remove given identity
*
Modified:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreInvocationContext.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreInvocationContext.java 2008-11-04
03:45:19 UTC (rev 119)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreInvocationContext.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -31,4 +31,9 @@
*/
public interface IdentityStoreInvocationContext
{
+
+ IdentityStoreSession getIdentityStoreSession();
+
+ String getRealmId();
+
}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreSession.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreSession.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreSession.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,87 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.store;
+
+import org.jboss.identity.exception.IdentityException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityStoreSession
+{
+
+ /**
+ * Session Context
+ * @return
+ */
+ Object getSessionContext() throws IdentityException;
+
+ /**
+ * Close this session
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void close() throws IdentityException;
+
+ /**
+ * Save all pending changes
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void save() throws IdentityException;
+
+ /**
+ * Clear this session
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void clear() throws IdentityException;
+
+ /**
+ * Check if this session is open
+ * @return
+ */
+ boolean isOpen();
+
+
+ boolean isTransactionSupported();
+
+ /**
+ * Begin new transaction
+ */
+ void startTransaction();
+
+ /**
+ * Commit transaction - flush associated session
+ */
+ void commitTransaction();
+
+ /**
+ * Rollback transaction
+ */
+ void rollbackTransaction();
+
+ /**
+ *
+ * @return
+ */
+ boolean isTransactionActive();
+}
Added:
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreSessionFactory.java
===================================================================
---
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreSessionFactory.java
(rev 0)
+++
trunk/identity-spi/src/main/java/org/jboss/identity/spi/store/IdentityStoreSessionFactory.java 2008-11-06
23:36:08 UTC (rev 120)
@@ -0,0 +1,39 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.spi.store;
+
+import org.jboss.identity.exception.IdentityException;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityStoreSessionFactory
+{
+
+ /**
+ * @return
+ */
+ IdentityStoreSession createIdentityStoreSession() throws IdentityException;
+
+}
Modified: trunk/parent/pom.xml
===================================================================
--- trunk/parent/pom.xml 2008-11-04 03:45:19 UTC (rev 119)
+++ trunk/parent/pom.xml 2008-11-06 23:36:08 UTC (rev 120)
@@ -45,7 +45,7 @@
<disableXmlReport>false</disableXmlReport>
<testFailureIgnore>false</testFailureIgnore>
<includes>
- <include>**/*TestCase.java</include>
+ <include>**/APITestCase.java</include>
</includes>
<forkMode>pertest</forkMode>
<argLine>${surefire.jvm.args}</argLine>