JBoss Identity SVN: r611 - idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate.
by jboss-identity-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-06-15 08:57:41 -0400 (Mon, 15 Jun 2009)
New Revision: 611
Modified:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
Log:
* JBID-129, fix the ConcurrentModificationException.
Modified: idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
===================================================================
--- idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-06-15 06:30:34 UTC (rev 610)
+++ idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-06-15 12:57:41 UTC (rev 611)
@@ -508,16 +508,18 @@
try
{
- // Remove all related relationships
- for (HibernateIdentityObjectRelationship relationship : hibernateObject.getFromRelationships())
+
+ // Remove all related relationships
+ HibernateIdentityObjectRelationship[] from = new HibernateIdentityObjectRelationship[hibernateObject.getFromRelationships().size()];
+ for (HibernateIdentityObjectRelationship relationship : hibernateObject.getFromRelationships().toArray(from))
{
relationship.getFromIdentityObject().getFromRelationships().remove(relationship);
relationship.getToIdentityObject().getToRelationships().remove(relationship);
-
hibernateSession.delete(relationship);
}
-
- for (HibernateIdentityObjectRelationship relationship : hibernateObject.getToRelationships())
+
+ HibernateIdentityObjectRelationship[] to = new HibernateIdentityObjectRelationship[hibernateObject.getToRelationships().size()];
+ for (HibernateIdentityObjectRelationship relationship : hibernateObject.getToRelationships().toArray(to))
{
relationship.getFromIdentityObject().getFromRelationships().remove(relationship);
relationship.getToIdentityObject().getToRelationships().remove(relationship);
14 years, 10 months
JBoss Identity SVN: r610 - in idm/trunk/integration/deployer: src/main/resources and 1 other directory.
by jboss-identity-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-06-15 02:30:34 -0400 (Mon, 15 Jun 2009)
New Revision: 610
Modified:
idm/trunk/integration/deployer/pom.xml
idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml
Log:
* Remove the portal common lib dependency.
(If setup.txt uses the portal common lib, then needs to be included manually)
we shouldn't rely on portal lib, even common, in the jboss idm.
Modified: idm/trunk/integration/deployer/pom.xml
===================================================================
--- idm/trunk/integration/deployer/pom.xml 2009-06-15 06:00:42 UTC (rev 609)
+++ idm/trunk/integration/deployer/pom.xml 2009-06-15 06:30:34 UTC (rev 610)
@@ -38,68 +38,7 @@
<artifactId>idm-ldap</artifactId>
<version>${project.version}</version>
</dependency>
- <!--<dependency>-->
- <!--<groupId>org.jboss.identity.idm</groupId>-->
- <!--<artifactId>idm-cache</artifactId>-->
- <!--<version>${version}</version>-->
- <!--</dependency>-->
<dependency>
- <groupId>org.jboss.portal.common</groupId>
- <artifactId>common-common</artifactId>
- <version>1.2.3</version>
- <exclusions>
- <exclusion>
- <groupId>apache-log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2ee</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-jmx</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-junit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-core-uberjar</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-nodeps</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-launcher</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
-
- </exclusions>
- </dependency>
- <dependency>
<groupId>bsh</groupId>
<artifactId>bsh</artifactId>
<version>1.3.0</version>
Modified: idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml
===================================================================
--- idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml 2009-06-15 06:00:42 UTC (rev 609)
+++ idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml 2009-06-15 06:30:34 UTC (rev 610)
@@ -27,7 +27,6 @@
<include>org.jboss.identity.idm:idm-api</include>
<include>org.jboss.identity.idm:idm-common</include>
<include>org.jboss.identity.idm:idm-spi</include>
- <include>org.jboss.portal.common:common-common</include>
</includes>
</dependencySet>
</dependencySets>
14 years, 10 months
JBoss Identity SVN: r609 - in idm/trunk/integration/deployer/src/main: resources and 1 other directory.
by jboss-identity-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-06-15 02:00:42 -0400 (Mon, 15 Jun 2009)
New Revision: 609
Modified:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/HibernatePopulator.java
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMDeployer.java
idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml
Log:
* Add the portal related common jar into the distribution.
Modified: idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/HibernatePopulator.java
===================================================================
--- idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/HibernatePopulator.java 2009-06-12 12:24:01 UTC (rev 608)
+++ idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/HibernatePopulator.java 2009-06-15 06:00:42 UTC (rev 609)
@@ -3,32 +3,29 @@
*/
package org.jboss.identity.idm.integration.jboss5;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
import java.util.Collection;
import java.util.Iterator;
+import java.util.logging.Level;
import java.util.logging.Logger;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
import javax.transaction.TransactionManager;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
-import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.exception.SQLGrammarException;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
-import org.jboss.identity.idm.api.cfg.IdentityConfiguration;
import org.jboss.identity.idm.common.transaction.TransactionManagerProvider;
import org.jboss.identity.idm.common.transaction.Transactions;
+import org.jboss.identity.idm.impl.helper.SecurityActions;
import org.jboss.identity.idm.integration.jboss5.jaxb2.HibernateInitializerType;
-import org.jboss.portal.common.net.URLTools;
-import org.jboss.portal.common.util.CLResourceLoader;
-import org.jboss.portal.common.util.LoaderResource;
import bsh.EvalError;
import bsh.Interpreter;
@@ -54,89 +51,47 @@
/** doCheck result - schema not exist */
private static final int RESULT_CREATE = 2;
-
- private Configuration config;
- private SessionFactory sessionFactory;
-
private HibernateInitializerType type;
- private String hibernateSessionFactoryJNDIName;
+ private Configuration config;
- private IdentityConfiguration identityConfiguration;
+ private SessionFactory sessionFactory;
-
- public HibernatePopulator(HibernateInitializerType type, IdentityConfiguration identityConfig) {
+ public HibernatePopulator(HibernateInitializerType type, Configuration config) {
this.type = type;
- this.identityConfiguration = identityConfig;
+ this.config = config;
}
- public void populateSchema() throws Exception {
+ public void populateSchema() {
+ sessionFactory = config.buildSessionFactory();
- // If hibernate config is present than create SessionFactory manually and register it into identity config
- if (type.getHibernateConfigLocation() != null)
- {
- URL configURL = Thread.currentThread().getContextClassLoader().getResource(type.getHibernateConfigLocation());
- if (configURL == null)
- {
- throw new Exception("The config " + type.getHibernateConfigLocation() + " does not exist");
- }
-
- if (!URLTools.exists(configURL))
- {
- throw new Exception("The config " + configURL + " does not exist");
- }
-
- config = new AnnotationConfiguration().configure(configURL);
-
- createHibernateSessionFactory();
-
- Context context = new InitialContext();
- if (getHibernateSessionFactoryJNDIName() != null)
- {
- try
- {
- context.bind(getHibernateSessionFactoryJNDIName(), sessionFactory);
- }
- catch (NamingException e)
- {
- logger.severe(e.getMessage());
-
- }
- }
-
- if (type.getHibernateSessionFactoryRegistryName() != null)
- {
- identityConfiguration.getIdentityConfigurationRegistry().
- register(sessionFactory, type.getHibernateSessionFactoryRegistryName());
- }
-
- if (type.isDoChecking())
- {
- //check the schema
- int check = doCheck();
- switch (check)
- {
- case RESULT_NONE:
- break;
- case RESULT_UPDATE:
- updateSchema();
- break;
- case RESULT_CREATE:
- createSchema();
- createContent();
-
- break;
- }
- } else {
- createSchema();
- }
- }
-
- }
+ if (type.isDoChecking())
+ {
+ //check the schema
+ int check = doCheck();
+ switch (check)
+ {
+ case RESULT_NONE:
+ break;
+ case RESULT_UPDATE:
+ updateSchema();
+ break;
+ case RESULT_CREATE:
+ createSchema();
+ createContent();
+ break;
+ }
+ } else {
+ createSchema();
+ }
+
+ sessionFactory.close();
+ }
+
private int doCheck()
{
Session session = null;
@@ -215,62 +170,25 @@
SchemaUpdate update = new SchemaUpdate(config);
update.execute(false, true);
}
-
- public String getHibernateSessionFactoryJNDIName() {
- return hibernateSessionFactoryJNDIName;
- }
-
-
- public void setHibernateSessionFactoryJNDIName(
- String hibernateSessionFactoryJNDIName) {
- this.hibernateSessionFactoryJNDIName = hibernateSessionFactoryJNDIName;
- }
-
-
- private void createHibernateSessionFactory() throws Exception
- {
- // Set JNDI name if present and absent
- if (getHibernateSessionFactoryJNDIName() != null)
- {
- setPropertyIfAbsent("hibernate.session_factory_name", getHibernateSessionFactoryJNDIName());
- }
-
- sessionFactory = config.buildSessionFactory();
- }
-
- private void setPropertyIfAbsent(String name, String value)
- {
- if (config.getProperty(name) == null)
- {
- config.setProperty(name, value);
- }
- }
- private void createContent()
- {
- LoaderResource setupResource = null;
-
- if (type.getSetupLocation() != null && setupResource == null)
- {
- setupResource = new CLResourceLoader().getResource(type.getSetupLocation());
- }
-
- if (setupResource != null)
- {
- if (setupResource.exists())
- {
- try
+ private void createContent()
+ {
+
+ if (type.getSetupLocation() != null) {
+ URL setupResource = SecurityActions.getContextClassLoader().getResource(type.getSetupLocation()) ;
+ if ( setupResource != null ) {
+ try
{
logger.info("Creating database content");
- final String script = setupResource.asString("UTF-8");
-
+ final String script = getString(setupResource.openStream());
+
// Create an interpreter and configures it
final Interpreter interpreter = new Interpreter();
interpreter.setClassLoader(Thread.currentThread().getContextClassLoader());
interpreter.setOut(System.out);
interpreter.set("SessionFactory", sessionFactory);
-
+
TransactionManager tm = TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager();
Transactions.required(tm, new Transactions.Runnable()
{
@@ -294,11 +212,40 @@
logger.info("Error in bsh script execution: " + e);
}
}
- else
- {
- logger.info("There is a setup URL but the not valid " + setupResource);
- }
- }
- }
+ }
+ }
+
+ private String getString(InputStream in) {
+ try {
+ ByteArrayOutputStream out = new ByteArrayOutputStream(in.available());
+ byte[] buffer = new byte[512];
+ while (true)
+ {
+ int i = in.read(buffer);
+ if (i == 0)
+ {
+ continue;
+ }
+ if (i == -1)
+ {
+ break;
+ }
+ out.write(buffer, 0, i);
+ }
+ return out.toString("UTF-8");
+ } catch (IOException e) {
+ logger.log(Level.SEVERE, "error in converting inputstream into string", e);
+ return null;
+ } finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch (IOException e) {
+ logger.log(Level.SEVERE, "error in closing inputstream", e);
+ }
+ }
+ }
+ }
+
}
Modified: idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMDeployer.java
===================================================================
--- idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMDeployer.java 2009-06-12 12:24:01 UTC (rev 608)
+++ idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMDeployer.java 2009-06-15 06:00:42 UTC (rev 609)
@@ -18,6 +18,7 @@
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
+import org.hibernate.cfg.Configuration;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.DialectFactory;
import org.jboss.deployers.spi.DeploymentException;
@@ -39,7 +40,11 @@
/**
*
+ * Deploy the JBoss identity Management:
*
+ * 1. Start the IdentitySessionFactory.
+ * 2. Register it into the JNDI.
+ *
* @author Jeff Yu
*
*/
@@ -112,14 +117,19 @@
SqlInitializerType sqlInitializer = config.getInitializers().getSqlInitializer();
if (hibernateInitializer != null) {
- for (IdentityStoreConfigurationMetaData store : identityMetadata.getIdentityStores()) {
- String hibernateConfigFile = store.getOptionSingleValue(HIBERNATE_CONFIGFILE);
- if (hibernateConfigFile != null && !"".equals(hibernateConfigFile.trim())) {
- logger.fine("starting to populate the schema from file [" + hibernateConfigFile + "]");
- HibernatePopulator hibernatePopulator = new HibernatePopulator(hibernateInitializer, identityConfiguration);
- hibernatePopulator.populateSchema();
+ String hibernateConfigFile = config.getHibernateDeployer().getHibernateConfiguration();
+ if (hibernateConfigFile == null) {
+ for (IdentityStoreConfigurationMetaData store : identityMetadata.getIdentityStores()) {
+ hibernateConfigFile = store.getOptionSingleValue(HIBERNATE_CONFIGFILE);
}
}
+ if (hibernateConfigFile == null) {
+ throw new Exception ("Couldn't find the hibernate configuration file");
+ }
+ Configuration configuration = new AnnotationConfiguration().configure(hibernateConfigFile);
+ logger.fine("starting to populate the schema from file [" + hibernateConfigFile + "]");
+ HibernatePopulator hibernatePopulator = new HibernatePopulator(hibernateInitializer, configuration);
+ hibernatePopulator.populateSchema();
}else if (sqlInitializer != null) {
logger.fine("starting to populate the schema from script file [" + sqlInitializer.getSqlFile() + "]");
Modified: idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml
===================================================================
--- idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml 2009-06-12 12:24:01 UTC (rev 608)
+++ idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml 2009-06-15 06:00:42 UTC (rev 609)
@@ -27,6 +27,7 @@
<include>org.jboss.identity.idm:idm-api</include>
<include>org.jboss.identity.idm:idm-common</include>
<include>org.jboss.identity.idm:idm-spi</include>
+ <include>org.jboss.portal.common:common-common</include>
</includes>
</dependencySet>
</dependencySets>
14 years, 10 months
JBoss Identity SVN: r608 - in idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl: helper and 1 other directory.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2009-06-12 08:24:01 -0400 (Fri, 12 Jun 2009)
New Revision: 608
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationContextImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityRepositoryConfigurationContextImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityStoreConfigurationContextImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/RealmConfigurationContextImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/helper/CopyOnWriteRegistry.java
Log:
some "implements Serializable" to fix deployment issues
Modified: idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationContextImpl.java
===================================================================
--- idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationContextImpl.java 2009-06-12 10:50:48 UTC (rev 607)
+++ idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationContextImpl.java 2009-06-12 12:24:01 UTC (rev 608)
@@ -26,11 +26,13 @@
import org.jboss.identity.idm.spi.configuration.IdentityConfigurationContextRegistry;
import org.jboss.identity.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
* @version : 0.1 $
*/
-public class IdentityConfigurationContextImpl implements IdentityConfigurationContext
+public class IdentityConfigurationContextImpl implements IdentityConfigurationContext, Serializable
{
private final IdentityConfigurationMetaData configurationMD;
Modified: idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationImpl.java
===================================================================
--- idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationImpl.java 2009-06-12 10:50:48 UTC (rev 607)
+++ idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationImpl.java 2009-06-12 12:24:01 UTC (rev 608)
@@ -50,6 +50,7 @@
import java.util.Map;
import java.util.HashMap;
import java.io.File;
+import java.io.Serializable;
import java.lang.reflect.Constructor;
/**
@@ -57,7 +58,7 @@
* @version : 0.1 $
*/
public class IdentityConfigurationImpl
- implements IdentityConfiguration, IdentityConfigurationRegistry, IdentityConfigurationContextRegistry
+ implements IdentityConfiguration, IdentityConfigurationRegistry, IdentityConfigurationContextRegistry, Serializable
{
private static final Logger log = Logger.getLogger(IdentityConfigurationImpl.class.getName());
Modified: idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityRepositoryConfigurationContextImpl.java
===================================================================
--- idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityRepositoryConfigurationContextImpl.java 2009-06-12 10:50:48 UTC (rev 607)
+++ idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityRepositoryConfigurationContextImpl.java 2009-06-12 12:24:01 UTC (rev 608)
@@ -27,6 +27,8 @@
import org.jboss.identity.idm.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
* @version : 0.1 $
Modified: idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityStoreConfigurationContextImpl.java
===================================================================
--- idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityStoreConfigurationContextImpl.java 2009-06-12 10:50:48 UTC (rev 607)
+++ idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityStoreConfigurationContextImpl.java 2009-06-12 12:24:01 UTC (rev 608)
@@ -27,12 +27,14 @@
import org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
* @version : 0.1 $
*/
public class IdentityStoreConfigurationContextImpl
- extends IdentityConfigurationContextImpl implements IdentityStoreConfigurationContext
+ extends IdentityConfigurationContextImpl implements IdentityStoreConfigurationContext, Serializable
{
private final IdentityStoreConfigurationMetaData storeMD;
Modified: idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/RealmConfigurationContextImpl.java
===================================================================
--- idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/RealmConfigurationContextImpl.java 2009-06-12 10:50:48 UTC (rev 607)
+++ idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/RealmConfigurationContextImpl.java 2009-06-12 12:24:01 UTC (rev 608)
@@ -27,12 +27,14 @@
import org.jboss.identity.idm.spi.configuration.IdentityConfigurationContextRegistry;
import org.jboss.identity.idm.spi.configuration.RealmConfigurationContext;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
* @version : 0.1 $
*/
public class RealmConfigurationContextImpl
- extends IdentityConfigurationContextImpl implements RealmConfigurationContext
+ extends IdentityConfigurationContextImpl implements RealmConfigurationContext, Serializable
{
private final RealmConfigurationMetaData realmMD;
Modified: idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/helper/CopyOnWriteRegistry.java
===================================================================
--- idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/helper/CopyOnWriteRegistry.java 2009-06-12 10:50:48 UTC (rev 607)
+++ idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/helper/CopyOnWriteRegistry.java 2009-06-12 12:24:01 UTC (rev 608)
@@ -27,6 +27,7 @@
import java.util.Set;
import java.util.Collections;
import java.util.Collection;
+import java.io.Serializable;
/**
* Implementation of a registry that implements copy on write semantics.
@@ -34,7 +35,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 7228 $
*/
-public class CopyOnWriteRegistry
+public class CopyOnWriteRegistry implements Serializable
{
/** . */
14 years, 11 months
JBoss Identity SVN: r607 - in idm/trunk: assembly/src/main/files/db/jdbc and 1 other directory.
by jboss-identity-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-06-12 06:50:48 -0400 (Fri, 12 Jun 2009)
New Revision: 607
Removed:
idm/trunk/distro/
Modified:
idm/trunk/assembly/src/main/files/db/jdbc/mysql.properties
idm/trunk/pom.xml
Log:
* Update the mysql.properties, using the qa one.
* remove the distro, as we are using the ANT based installation.
Modified: idm/trunk/assembly/src/main/files/db/jdbc/mysql.properties
===================================================================
--- idm/trunk/assembly/src/main/files/db/jdbc/mysql.properties 2009-06-12 10:09:20 UTC (rev 606)
+++ idm/trunk/assembly/src/main/files/db/jdbc/mysql.properties 2009-06-12 10:50:48 UTC (rev 607)
@@ -1,4 +1,4 @@
jdbc.driver=com.mysql.jdbc.Driver
-jdbc.url=jdbc:mysql://localhost:3306/jbossidm
-jdbc.username=root
-jdbc.password=
+jdbc.url=jdbc:mysql://dev02.qa.atl.jboss.com/portal?jdbcCompliantTruncation=false
+jdbc.username=portal
+jdbc.password=password
Modified: idm/trunk/pom.xml
===================================================================
--- idm/trunk/pom.xml 2009-06-12 10:09:20 UTC (rev 606)
+++ idm/trunk/pom.xml 2009-06-12 10:50:48 UTC (rev 607)
@@ -45,7 +45,6 @@
<module>idm-auth</module>
<module>idm-testsuite</module>
<module>integration</module>
- <module>distro</module>
<module>assembly</module>
</modules>
<properties>
14 years, 11 months
JBoss Identity SVN: r606 - in idm/trunk: idm-core/src/main/java/org/jboss/identity/idm/impl/repository and 7 other directories.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2009-06-12 06:09:20 -0400 (Fri, 12 Jun 2009)
New Revision: 606
Added:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/MinimalFlexibleConfigTestCase.java
idm/trunk/idm-testsuite/src/test/resources/minimal-flexible-identity-config.xml
idm/trunk/idm-testsuite/src/test/resources/test-identity-config.xml
Removed:
idm/trunk/idm-core/src/test/resources/organization-test-config.xml
idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml
idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/types/SimpleIdentityObjectType.java
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/repository/IdentityStoreRepository.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java
Log:
add "allowNotDefinedIdentityObjectTypes" - allow minimal idm config with maximum flexibilty to use not configured identity types
Modified: idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
===================================================================
--- idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java 2009-06-11 20:28:06 UTC (rev 605)
+++ idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java 2009-06-12 10:09:20 UTC (rev 606)
@@ -441,11 +441,11 @@
}
// all configured identity object types
- if (storeMD.getSupportedIdentityTypes() == null || storeMD.getSupportedIdentityTypes().size() == 0)
- {
- throw new IdentityConfigurationException("identity-store \"" + storeMD.getId() + "\" doesn't have any supported " +
- "identity-object-types configured");
- }
+// if (storeMD.getSupportedIdentityTypes() == null || storeMD.getSupportedIdentityTypes().size() == 0)
+// {
+// throw new IdentityConfigurationException("identity-store \"" + storeMD.getId() + "\" doesn't have any supported " +
+// "identity-object-types configured");
+// }
// check each configured types
for (IdentityObjectTypeMetaData typeMD : storeMD.getSupportedIdentityTypes())
Modified: idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java
===================================================================
--- idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java 2009-06-11 20:28:06 UTC (rev 605)
+++ idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java 2009-06-12 10:09:20 UTC (rev 606)
@@ -60,17 +60,24 @@
protected AttributeStore defaultAttributeStore;
+ protected IdentityRepositoryConfigurationContext configurationContext;
+
public static final String CACHE_OPTION = "cache";
public static final String CACHE_CONFIG_FILE_OPTION = "cache.config-file";
public static final String CACHE_PROVIDER_CLASS_OPTION = "cache.provider.class";
+ public static final String ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION = "allowNotDefinedIdentityObjectTypes";
+ private boolean allowNotDefinedIdentityObjectTypes = false;
+
+
public void bootstrap(IdentityRepositoryConfigurationContext configurationContext,
Map<String, IdentityStore> bootstrappedIdentityStores,
Map<String, AttributeStore> bootstrappedAttributeStores) throws IdentityException
{
+ this.configurationContext = configurationContext;
IdentityRepositoryConfigurationMetaData configurationMD = configurationContext.getRepositoryConfigurationMetaData();
@@ -84,6 +91,13 @@
//TODO: cache wrap support
}
+ String allowNotDefinedIOT = configurationMD.getOptionSingleValue(ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION);
+
+ if (allowNotDefinedIOT != null && allowNotDefinedIOT.equalsIgnoreCase("true"))
+ {
+ this.allowNotDefinedIdentityObjectTypes = true;
+ }
+
if (isId != null && bootstrappedIdentityStores.keySet().contains(isId))
{
defaultIdentityStore = bootstrappedIdentityStores.get(isId);
@@ -239,14 +253,46 @@
return attributeStoreMappings;
}
- public IdentityStore getIdentityStore(IdentityObjectType identityObjectType)
+ public IdentityStore getIdentityStore(IdentityObjectType identityObjectType) throws IdentityException
{
- return identityStoreMappings.get(identityObjectType.getName());
+ IdentityStore store = identityStoreMappings.get(identityObjectType.getName());
+
+ if (store == null)
+ {
+ String option = configurationContext.getRepositoryConfigurationMetaData().getOptionSingleValue(ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION);
+
+ if (option != null && option.equalsIgnoreCase("true"))
+ {
+ return defaultIdentityStore;
+ }
+ else
+ {
+ throw new IdentityException("IdentityObjectType not mapped in the configuration: " + identityObjectType);
+ }
+ }
+
+ return store;
}
- public AttributeStore getAttributeStore(IdentityObjectType identityObjectType)
+ public AttributeStore getAttributeStore(IdentityObjectType identityObjectType) throws IdentityException
{
- return attributeStoreMappings.get(identityObjectType.getName());
+ AttributeStore store = attributeStoreMappings.get(identityObjectType.getName());
+
+ if (store == null)
+ {
+ String option = configurationContext.getRepositoryConfigurationMetaData().getOptionSingleValue(ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION);
+
+ if (option != null && option.equalsIgnoreCase("true"))
+ {
+ return defaultIdentityStore;
+ }
+ else
+ {
+ throw new IdentityException("IdentityObjectType not mapped in the configuration: " + identityObjectType);
+ }
+ }
+
+ return store;
}
protected boolean hasIdentityObject(IdentityStoreInvocationContext ctx, IdentityStore is, IdentityObject io) throws IdentityException
@@ -266,4 +312,10 @@
}
return false;
}
+
+
+ public boolean isAllowNotDefinedIdentityObjectTypes()
+ {
+ return allowNotDefinedIdentityObjectTypes;
+ }
}
Modified: idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java
===================================================================
--- idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java 2009-06-11 20:28:06 UTC (rev 605)
+++ idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java 2009-06-12 10:09:20 UTC (rev 606)
@@ -301,14 +301,30 @@
return featuresMetaData;
}
- IdentityStore resolveIdentityStore(IdentityObject io)
+ IdentityStore resolveIdentityStore(IdentityObject io) throws IdentityException
{
return resolveIdentityStore(io.getIdentityType());
}
IdentityStore resolveIdentityStore(IdentityObjectType iot)
{
- IdentityStore ids = getIdentityStore(iot);
+
+ IdentityStore ids = null;
+ try
+ {
+ ids = getIdentityStore(iot);
+ }
+ catch (IdentityException e)
+ {
+ if (isAllowNotDefinedAttributes())
+ {
+ return defaultIdentityStore;
+ }
+
+ throw new IllegalStateException("Used IdentityObjectType not mapped. Consider using " + ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION +
+ " repository option switch: " + iot );
+ }
+
if (ids == null)
{
ids = defaultIdentityStore;
@@ -318,10 +334,25 @@
AttributeStore resolveAttributeStore(IdentityObjectType iot)
{
- AttributeStore ads = getAttributeStore(iot);
+ AttributeStore ads = null;
+ try
+ {
+ ads = getAttributeStore(iot);
+ }
+ catch (IdentityException e)
+ {
+ if (isAllowNotDefinedAttributes())
+ {
+ return defaultAttributeStore;
+ }
+
+ throw new IllegalStateException("Used IdentityObjectType not mapped. Consider using " + ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION +
+ " repository option switch: " + iot );
+ }
+
if (ads == null)
{
- ads = defaultIdentityStore;
+ ads = defaultAttributeStore;
}
return ads;
}
@@ -1161,4 +1192,7 @@
{
return allowNotDefinedAttributes;
}
+
+
+
}
Modified: idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/types/SimpleIdentityObjectType.java
===================================================================
--- idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/types/SimpleIdentityObjectType.java 2009-06-11 20:28:06 UTC (rev 605)
+++ idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/types/SimpleIdentityObjectType.java 2009-06-12 10:09:20 UTC (rev 606)
@@ -52,4 +52,12 @@
{
return name;
}
+
+ @Override
+ public String toString()
+ {
+ return "SimpleIdentityObjectType{" +
+ "name='" + name + '\'' +
+ '}';
+ }
}
Deleted: idm/trunk/idm-core/src/test/resources/organization-test-config.xml
===================================================================
--- idm/trunk/idm-core/src/test/resources/organization-test-config.xml 2009-06-11 20:28:06 UTC (rev 605)
+++ idm/trunk/idm-core/src/test/resources/organization-test-config.xml 2009-06-12 10:09:20 UTC (rev 606)
@@ -1,818 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha identity-config.xsd">
- <realms>
- <realm>
- <id>realm://RedHat/DB</id>
- <repository-id-ref>RedHat Repository DB</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://portal/SamplePortal/DB</id>
- <repository-id-ref>Sample Portal Repository DB</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://RedHat/DB_LDAP</id>
- <repository-id-ref>RedHat Repository DB+LDAP</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://portal/SamplePortal/DB_LDAP</id>
- <repository-id-ref>Sample Portal Repository DB+LDAP</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- </realms>
- <repositories>
- <repository>
- <id>RedHat Repository DB</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity Store</default-attribute-store-id>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>Sample Portal Repository DB</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity Store</default-attribute-store-id>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>RedHat Repository DB+LDAP</id>
- <class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
- <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>DIVISION</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>USER</identity-object-type>
- <identity-object-type>ORGANIZATION</identity-object-type>
- <identity-object-type>ORGANIZATION_UNIT</identity-object-type>
- <identity-object-type>DEPARTMENT</identity-object-type>
- </identity-object-types>
- <options>
- <option>
- <name>cache</name>
- <value>true</value>
- </option>
- <option>
- <name>cache.provider.class</name>
- <value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheSupportImpl</value>
- </option>
- <option>
- <name>cache.config-file</name>
- <value>src/test/resources/jboss-cache-config.xml</value>
- </option>
- </options>
- </identity-store-mapping>
- </identity-store-mappings>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>Sample Portal Repository DB+LDAP</id>
- <class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
- <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>DIVISION</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>USER</identity-object-type>
- <identity-object-type>DEPARTMENT</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-types>
- <options>
- <option>
- <name>cache</name>
- <value>true</value>
- </option>
- <option>
- <name>cache.provider.class</name>
- <value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheSupportImpl</value>
- </option>
- <option>
- <name>cache.config-file</name>
- <value>src/test/resources/jboss-cache-config.xml</value>
- </option>
- </options>
- </identity-store-mapping>
- </identity-store-mappings>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- </repositories>
- <stores>
- <attribute-stores/>
- <identity-stores>
- <identity-store>
- <id>Hibernate Identity Store</id>
- <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
- <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>USER</name>
- <relationships>
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>COMMUNITY</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>OFFICE</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>SECURITY</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>PROJECT</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>PEOPLE</identity-object-type-ref>-->
- <!--</relationship>-->
- </relationships>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- <attribute>
- <name>picture</name>
- <mapping>user.picture</mapping>
- <type>binary</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>email</name>
- <mapping>mail</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- <isUnique>true</isUnique>
- </attribute>
- </attributes>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DIVISION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION_UNIT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DIVISION</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>PEOPLE</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>PROJECT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>DIVISION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>DEPARTMENT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>PROJECT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>PEOPLE</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ADMINISTRATION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>COMMUNITY</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>OFFICE</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>SECURITY</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>SYSTEM</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>SECURITY</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>COMMUNITY</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- </supported-identity-object-types>
- <options>
- <option>
- <name>hibernateConfiguration</name>
- <value>hibernate-jboss-identity.cfg.xml</value>
- </option>
- <!--<option>-->
- <!--<name>hibernateSessionFactoryJNDIName</name>-->
- <!--<value>java:/jbossidentity/HibernateStoreSessionFactory</value>-->
- <!--</option>-->
- <option>
- <name>populateRelationshipTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>populateIdentityObjectTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- <option>
- <name>isRealmAware</name>
- <value>true</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </identity-store>
- <identity-store>
- <id>LDAP Identity Store</id>
- <class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
- <external-config/>
- <supported-relationship-types>
- <relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
- </supported-relationship-types>
- <supported-identity-object-types>
- <identity-object-type>
- <name>USER</name>
- <relationships/>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- <attribute>
- <name>phone</name>
- <mapping>telephoneNumber</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>email</name>
- <mapping>mail</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- <isUnique>true</isUnique>
- </attribute>
- <attribute>
- <name>description</name>
- <mapping>description</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>carLicense</name>
- <mapping>carLicense</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- </attributes>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeName</name>
- <value>userPassword</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>ORGANIZATION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=Organizations,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>ORGANIZATION_UNIT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=OrganizationUnits,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>DEPARTMENT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=Departments,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>OFFICE</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=Offices,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>
- </identity-stores>
- </stores>
-</jboss-identity>
\ No newline at end of file
Modified: idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
===================================================================
--- idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-06-11 20:28:06 UTC (rev 605)
+++ idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-06-12 10:09:20 UTC (rev 606)
@@ -122,6 +122,8 @@
public static final String ALLOW_NOT_DEFINED_ATTRIBUTES = "allowNotDefinedAttributes";
+ public static final String ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION = "allowNotDefinedIdentityObjectTypes";
+
public static final String DEFAULT_REALM_NAME = HibernateIdentityStoreImpl.class.getName() + ".DEFAULT_REALM";
public static final String CREDENTIAL_TYPE_PASSWORD = "PASSWORD";
@@ -138,6 +140,8 @@
private boolean isAllowNotDefinedAttributes = false;
+ private boolean isAllowNotDefinedIdentityObjectTypes = false;
+
// TODO: rewrite this into some more handy object
private IdentityStoreConfigurationMetaData configurationMD;
@@ -286,6 +290,13 @@
this.isAllowNotDefinedAttributes = true;
}
+ String allowNotDefinedIOT = configurationMD.getOptionSingleValue(ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION);
+
+ if (allowNotDefinedIOT != null && allowNotDefinedIOT.equalsIgnoreCase("true"))
+ {
+ this.isAllowNotDefinedIdentityObjectTypes = true;
+ }
+
// Default realm
HibernateRealm realm = null;
@@ -561,13 +572,13 @@
HibernateIdentityObject hibernateObject = null;
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
try
{
hibernateObject = (HibernateIdentityObject)getHibernateSession(ctx).
createQuery(HibernateIdentityObject.findIdentityObjectByNameAndType)
- .setParameter("realm", getRealm(em, ctx))
+ .setParameter("realm", getRealm(hibernateSession, ctx))
.setParameter("name", name)
.setParameter("typeName", hibernateType.getName())
.uniqueResult();
@@ -688,7 +699,7 @@
@SuppressWarnings("unchecked")
public Collection<IdentityObject> findIdentityObject(IdentityStoreInvocationContext ctx,
IdentityObject identity,
- IdentityObjectRelationshipType relationshipType,
+ IdentityObjectRelationshipType relationshipType,
boolean parent,
IdentityObjectSearchCriteria criteria) throws IdentityException
{
@@ -787,7 +798,7 @@
q.setParameter("nameFilter", "%");
}
-
+
if (criteria != null && criteria.isPaged())
{
q.setFirstResult(criteria.getFirstResult());
@@ -843,8 +854,11 @@
if (!getSupportedFeatures().isRelationshipTypeSupported(fromIO.getIdentityType(), toIO.getIdentityType(), relationshipType))
{
- throw new IdentityException("Relationship not supported. RelationshipType[ " + relationshipType.getName() + " ] " +
- "beetween: [ " + fromIO.getIdentityType().getName() + " ] and [ " + toIO.getIdentityType().getName() + " ]");
+ if (!isAllowNotDefinedIdentityObjectTypes())
+ {
+ throw new IdentityException("Relationship not supported. RelationshipType[ " + relationshipType.getName() + " ] " +
+ "beetween: [ " + fromIO.getIdentityType().getName() + " ] and [ " + toIO.getIdentityType().getName() + " ]");
+ }
}
org.hibernate.Query query = getHibernateSession(ctx).createQuery(QUERY_RELATIONSHIP_BY_FROM_TO_TYPE_NAME)
@@ -875,7 +889,7 @@
throw new IdentityException("Relationship name not present in the store");
}
- relationship = new HibernateIdentityObjectRelationship(type, fromIO, toIO, relationshipName);
+ relationship = new HibernateIdentityObjectRelationship(type, fromIO, toIO, relationshipName);
}
else
{
@@ -885,7 +899,7 @@
getHibernateSession(ctx).persist(relationship);
return relationship;
-
+
}
@@ -902,7 +916,7 @@
HibernateIdentityObject toIO = safeGet(ctx, toIdentity);
HibernateIdentityObjectRelationshipType type = getHibernateIdentityObjectRelationshipType(ctx, relationshipType);
- getSupportedFeatures().isRelationshipTypeSupported(fromIO.getIdentityType(), toIO.getIdentityType(), relationshipType);
+ //getSupportedFeatures().isRelationshipTypeSupported(fromIO.getIdentityType(), toIO.getIdentityType(), relationshipType);
org.hibernate.Query query = null;
@@ -940,7 +954,7 @@
throw new IdentityException("Relationship already present");
}
- HibernateIdentityObjectRelationship relationship = (HibernateIdentityObjectRelationship)results.iterator().next();
+ HibernateIdentityObjectRelationship relationship = (HibernateIdentityObjectRelationship)results.iterator().next();
fromIO.getFromRelationships().remove(relationship);
toIO.getToRelationships().remove(relationship);
@@ -1057,13 +1071,13 @@
throw new IllegalArgumentException("name is null");
}
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
- HibernateRealm realm = getRealm(em, ctx);
+ HibernateRealm realm = getRealm(hibernateSession, ctx);
try
{
- HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)em.createCriteria(HibernateIdentityObjectRelationshipName.class)
+ HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)hibernateSession.createCriteria(HibernateIdentityObjectRelationshipName.class)
.add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", realm)).uniqueResult();
if (hiorn != null)
@@ -1091,13 +1105,13 @@
throw new IllegalArgumentException("name is null");
}
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
try
{
- HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)em.createCriteria(HibernateIdentityObjectRelationshipName.class)
- .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(em, ctx))).uniqueResult();
+ HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)hibernateSession.createCriteria(HibernateIdentityObjectRelationshipName.class)
+ .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(hibernateSession, ctx))).uniqueResult();
if (hiorn == null)
{
@@ -1121,7 +1135,7 @@
Set<String> names = null;
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
try
{
@@ -1131,19 +1145,19 @@
{
if (criteria.isAscending())
{
- q = em.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesOrderedByNameAsc);
+ q = hibernateSession.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesOrderedByNameAsc);
}
else
{
- q = em.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesOrderedByNameDesc);
+ q = hibernateSession.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesOrderedByNameDesc);
}
}
else
{
- q = em.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNames);
+ q = hibernateSession.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNames);
}
- q.setParameter("realm", getRealm(em, ctx));
+ q.setParameter("realm", getRealm(hibernateSession, ctx));
if (criteria != null && criteria.getFilter() != null)
{
@@ -1189,7 +1203,7 @@
HibernateIdentityObject hibernateObject = safeGet(ctx, identity);
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
try
{
@@ -1199,16 +1213,16 @@
{
if (criteria.isAscending())
{
- q = em.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesForIdentityObjectOrderedByNameAsc);
+ q = hibernateSession.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesForIdentityObjectOrderedByNameAsc);
}
else
{
- q = em.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesForIdentityObjectOrdereByNameDesc);
+ q = hibernateSession.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesForIdentityObjectOrdereByNameDesc);
}
}
else
{
- q = em.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesForIdentityObject);
+ q = hibernateSession.createQuery(HibernateIdentityObjectRelationshipName.findIdentityObjectRelationshipNamesForIdentityObject);
}
q.setParameter("identityObject", hibernateObject);
@@ -1247,13 +1261,13 @@
throw new IllegalArgumentException("name is null");
}
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
try
{
- HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)em.createCriteria(HibernateIdentityObjectRelationshipName.class)
- .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(em, ctx))).uniqueResult();
+ HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)hibernateSession.createCriteria(HibernateIdentityObjectRelationshipName.class)
+ .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(hibernateSession, ctx))).uniqueResult();
if (hiorn == null)
{
@@ -1276,13 +1290,13 @@
throw new IllegalArgumentException("name is null");
}
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
try
{
- HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)em.createCriteria(HibernateIdentityObjectRelationshipName.class)
- .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(em, ctx))).uniqueResult();
+ HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)hibernateSession.createCriteria(HibernateIdentityObjectRelationshipName.class)
+ .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(hibernateSession, ctx))).uniqueResult();
if (hiorn == null)
{
@@ -1305,13 +1319,13 @@
throw new IllegalArgumentException("name is null");
}
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
try
{
- HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)em.createCriteria(HibernateIdentityObjectRelationshipName.class)
- .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(em, ctx))).uniqueResult();
+ HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)hibernateSession.createCriteria(HibernateIdentityObjectRelationshipName.class)
+ .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(hibernateSession, ctx))).uniqueResult();
if (hiorn == null)
{
@@ -1516,7 +1530,7 @@
Set<HibernateIdentityObjectAttribute> storeAttributes = hibernateObject.getAttributes();
Map<String, IdentityObjectAttribute> result = new HashMap<String, IdentityObjectAttribute>();
-
+
// Remap the names
for (HibernateIdentityObjectAttribute attribute : storeAttributes)
{
@@ -1676,7 +1690,7 @@
}
}
}
-
+
}
public void addAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity, IdentityObjectAttribute[] attributes) throws IdentityException
@@ -1707,8 +1721,13 @@
}
- IdentityObjectAttributeMetaData amd = mdMap.get(attribute.getName());
+ IdentityObjectAttributeMetaData amd = null;
+ if (mdMap != null)
+ {
+ amd = mdMap.get(attribute.getName());
+ }
+
if (amd != null)
{
@@ -1760,7 +1779,7 @@
{
IdentityObjectAttribute attribute = mappedAttributes.get(name);
- IdentityObjectAttributeMetaData amd = mdMap.get(attribute.getName());
+ IdentityObjectAttributeMetaData amd = mdMap != null ? mdMap.get(attribute.getName()) : null;
// Default to text
String type = amd != null ? amd.getType() : IdentityObjectAttributeMetaData.TEXT_TYPE;
@@ -1920,14 +1939,6 @@
q.setParameter("identityType", hiot)
.setParameter("attributeName", attrMappedName)
.setParameter("value", attribute.getValue()).list();
-//
-// List<HibernateIdentityObjectAttribute> attrs = (List<HibernateIdentityObjectAttribute>)
-// session.createCriteria(HibernateIdentityObjectAttribute.class)
-// .createAlias("identityObject", "io")
-// .createAlias("values", "v")
-// .add(Restrictions.eq("io.identityType", hiot))
-// .add(Restrictions.eq("name", attrMappedName))
-// .add(Restrictions.like("v[0]", attribute.getValue())).list();
if (attrs.size() == 0)
{
@@ -2012,7 +2023,7 @@
HibernateIdentityObject hibernateObject = safeGet(ctx, identityObject);
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
if (supportedFeatures.isCredentialSupported(hibernateObject.getIdentityType(),credential.getType()))
{
@@ -2061,7 +2072,7 @@
throw new IdentityException("Not supported credential value: " + value.getClass());
}
- em.persist(hibernateCredential);
+ hibernateSession.persist(hibernateCredential);
hibernateObject.addCredential(hibernateCredential);
@@ -2076,7 +2087,7 @@
-
+
// Internal
public void addIdentityObjectType(IdentityStoreInvocationContext ctx, IdentityObjectType type) throws IdentityException
@@ -2136,32 +2147,55 @@
throw new IllegalArgumentException("IdentityObjectType is null");
}
+
if (!getSupportedFeatures().isIdentityObjectTypeSupported(iot))
{
- throw new IdentityException("IdentityType not supported by this IdentityStore implementation: " + iot);
+ if (!isAllowNotDefinedIdentityObjectTypes())
+ {
+ throw new IdentityException("IdentityType not supported by this IdentityStore implementation: " + iot);
+ }
}
}
private HibernateIdentityObjectType getHibernateIdentityObjectType(IdentityStoreInvocationContext ctx, IdentityObjectType type) throws IdentityException
{
+ checkIOType(type);
+
HibernateIdentityObjectType hibernateType = null;
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
-
try
{
- hibernateType = (HibernateIdentityObjectType)em.
+ Query q = hibernateSession.
createQuery(HibernateIdentityObjectType.findIdentityObjectTypeByName)
- .setParameter("name", type.getName())
- .uniqueResult() ;
+ .setParameter("name", type.getName());
+
+ hibernateType = (HibernateIdentityObjectType)q.uniqueResult();
+
+ if (hibernateType == null)
+ {
+ if (isAllowNotDefinedIdentityObjectTypes())
+ {
+ populateObjectTypes(hibernateSession, new String[]{type.getName()});
+ }
+
+ hibernateType = (HibernateIdentityObjectType)q.uniqueResult();
+ }
+
+
}
- catch (HibernateException e)
+ catch (Exception e)
{
throw new IdentityException("IdentityObjectType[" + type.getName() + "] not present in the store.", e);
}
+ if (hibernateType == null)
+ {
+ throw new IdentityException("IdentityObjectType[" + type.getName() + "] not present in the store.");
+ }
+
return hibernateType;
}
@@ -2170,15 +2204,15 @@
HibernateIdentityObject hibernateObject = null;
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
try
{
- hibernateObject = (HibernateIdentityObject)em.createQuery(HibernateIdentityObject.findIdentityObjectByNameAndType)
+ hibernateObject = (HibernateIdentityObject)hibernateSession.createQuery(HibernateIdentityObject.findIdentityObjectByNameAndType)
.setParameter("name", io.getName())
.setParameter("typeName", io.getIdentityType().getName())
- .setParameter("realm", getRealm(em, ctx))
+ .setParameter("realm", getRealm(hibernateSession, ctx))
.uniqueResult();
}
catch (Exception e)
@@ -2194,11 +2228,11 @@
HibernateIdentityObjectRelationshipType relationshipType = null;
- Session em = getHibernateSession(ctx);
+ Session hibernateSession = getHibernateSession(ctx);
try
{
- relationshipType = (HibernateIdentityObjectRelationshipType)em.
+ relationshipType = (HibernateIdentityObjectRelationshipType)hibernateSession.
createQuery(HibernateIdentityObjectRelationshipType.findIdentityObjectRelationshipTypeByName)
.setParameter("name", iot.getName())
.uniqueResult();
@@ -2464,5 +2498,11 @@
}
}
+ protected boolean isAllowNotDefinedIdentityObjectTypes()
+ {
+ return isAllowNotDefinedIdentityObjectTypes;
+ }
+
+
}
Modified: idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/repository/IdentityStoreRepository.java
===================================================================
--- idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/repository/IdentityStoreRepository.java 2009-06-11 20:28:06 UTC (rev 605)
+++ idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/repository/IdentityStoreRepository.java 2009-06-12 10:09:20 UTC (rev 606)
@@ -72,13 +72,13 @@
* @param identityObjectType
* @return proper identity store to store given identity type
*/
- IdentityStore getIdentityStore(IdentityObjectType identityObjectType);
+ IdentityStore getIdentityStore(IdentityObjectType identityObjectType) throws IdentityException;
/**
* @param identityObjectType
* @return proper identity store to store given identity type
*/
- AttributeStore getAttributeStore(IdentityObjectType identityObjectType);
+ AttributeStore getAttributeStore(IdentityObjectType identityObjectType) throws IdentityException;
/**
Modified: idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java
===================================================================
--- idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java 2009-06-11 20:28:06 UTC (rev 605)
+++ idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/IdentityTestPOJO.java 2009-06-12 10:09:20 UTC (rev 606)
@@ -57,7 +57,7 @@
public class IdentityTestPOJO extends TestCase
{
- private String identityConfig = "organization-test-jboss-unit-config.xml";
+ private String identityConfig = "test-identity-config.xml";
private String realmName;
Copied: idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/MinimalFlexibleConfigTestCase.java (from rev 592, idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTestCase.java)
===================================================================
--- idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/MinimalFlexibleConfigTestCase.java (rev 0)
+++ idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/MinimalFlexibleConfigTestCase.java 2009-06-12 10:09:20 UTC (rev 606)
@@ -0,0 +1,150 @@
+/*
+* 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.idm.impl.api;
+
+import org.jboss.identity.idm.impl.IdentityTestPOJO;
+import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+import org.jboss.unit.api.pojo.annotations.Create;
+import org.jboss.unit.api.pojo.annotations.Destroy;
+import org.jboss.unit.api.pojo.annotations.Test;
+import org.jboss.unit.api.pojo.annotations.Parameter;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class MinimalFlexibleConfigTestCase extends IdentityTestPOJO implements APITestContext
+{
+ private OrganizationTest orgTest;
+
+ private PersistenceManagerTest persistenceManagerTest;
+
+ private RelationshipManagerTest relationshipManagerTest;
+
+ private RoleManagerTest roleManagerTest;
+
+ private UserQueryTest userQueryTest;
+
+ private GroupQueryTest groupQueryTest;
+
+ private RoleQueryTest roleQueryTest;
+
+ private IdentitySessionFactory identitySessionFactory;
+
+ @Create
+ public void setUp() throws Exception
+ {
+ setIdentityConfig("minimal-flexible-identity-config.xml");
+ setRealmName("realm://FlexibleRealm");
+
+ super.start();
+
+ orgTest = new OrganizationTest(this);
+
+ persistenceManagerTest = new PersistenceManagerTest(this);
+ relationshipManagerTest = new RelationshipManagerTest(this);
+ roleManagerTest = new RoleManagerTest(this);
+
+ userQueryTest = new UserQueryTest(this);
+ groupQueryTest = new GroupQueryTest(this);
+ roleQueryTest = new RoleQueryTest(this);
+
+ identitySessionFactory = new IdentityConfigurationImpl().
+ configure(getIdentityConfig()).buildIdentitySessionFactory();
+ }
+
+ @Destroy
+ public void tearDown() throws Exception
+ {
+ super.stop();
+ }
+
+ public IdentitySessionFactory getIdentitySessionFactory()
+ {
+ return identitySessionFactory;
+ }
+
+ @Test
+ public void testOrganization() throws Exception
+ {
+
+ orgTest.testRedHatOrganization(getRealmName());
+ }
+
+ @Test
+ public void testSamplePortal() throws Exception
+ {
+
+ orgTest.testSamplePortal(getRealmName());
+ }
+
+ @Test
+ public void testPersistenceManager() throws Exception
+ {
+ persistenceManagerTest.testMethods(getRealmName());
+ }
+
+ @Test
+ public void testRelationshipManager() throws Exception
+ {
+ relationshipManagerTest.testMethods(getRealmName());
+ }
+
+ @Test
+ public void testRelationshipManagerCascade() throws Exception
+ {
+ relationshipManagerTest.testCascade(getRealmName());
+ }
+
+ @Test
+ public void testRelationshipManagerMergedRoleAssociations() throws Exception
+ {
+ relationshipManagerTest.testMergedRoleAssociations(getRealmName());
+ }
+
+ @Test
+ public void testRoleManager() throws Exception
+ {
+ roleManagerTest.testMethods(getRealmName());
+ }
+
+ @Test
+ public void testUserQuery() throws Exception
+ {
+ userQueryTest.testQuery(getRealmName());
+ }
+
+ @Test
+ public void testGroupQuery() throws Exception
+ {
+ groupQueryTest.testQuery(getRealmName());
+ }
+
+ @Test
+ public void testRoleQuery() throws Exception
+ {
+ roleQueryTest.testQuery(getRealmName());
+ }
+
+}
\ No newline at end of file
Modified: idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java
===================================================================
--- idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java 2009-06-11 20:28:06 UTC (rev 605)
+++ idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java 2009-06-12 10:09:20 UTC (rev 606)
@@ -272,87 +272,117 @@
assertTrue(groups.contains(portalTeamGroup));
- // Check that binary attribute picture is mapped
- AttributeDescription attributeDescription = session.getAttributesManager().getAttributeDescription(bdawidowUser, "picture");
- assertNotNull(attributeDescription);
- assertEquals("binary", attributeDescription.getType());
-
-
- // Generate random binary data for binary attribute
- Random random = new Random();
-
- // 900 kilobytes
- byte[] picture = new byte[921600];
- random.nextBytes(picture);
// User attributes
Attribute[] userInfo = new Attribute[]
{
new SimpleAttribute(P3PConstants.INFO_USER_NAME_GIVEN, new String[]{"Boleslaw"}),
new SimpleAttribute(P3PConstants.INFO_USER_NAME_FAMILY, new String[]{"Dawidowicz"}),
- new SimpleAttribute("picture", new byte[][]{picture}),
+ //new SimpleAttribute("picture", new byte[][]{picture}),
new SimpleAttribute("email", new String[]{"bd(a)example.com"})
};
session.getAttributesManager().addAttributes(bdawidowUser, userInfo);
Map<String, Attribute> attributes = session.getAttributesManager().getAttributes(bdawidowUser);
- assertEquals(4, attributes.keySet().size());
+ assertEquals(3, attributes.keySet().size());
assertEquals("Dawidowicz", (attributes.get(P3PConstants.INFO_USER_NAME_FAMILY)).getValue());
- assertTrue(Arrays.equals((byte[])attributes.get("picture").getValue(), picture));
+
+ // Generate random binary data for binary attribute
+ Random random = new Random();
+
+ // Check that binary attribute picture is mapped
+ AttributeDescription attributeDescription = session.getAttributesManager().getAttributeDescription(bdawidowUser, "picture");
+
+ if (attributeDescription != null && attributeDescription.getType().equals("binary"))
+ {
+
+ // 900 kilobytes
+ byte[] picture = new byte[921600];
+ random.nextBytes(picture);
+
+ userInfo = new Attribute[]
+ {
+ new SimpleAttribute("picture", new byte[][]{picture}),
+ };
+
+ session.getAttributesManager().addAttributes(bdawidowUser, userInfo);
+
+ attributes = session.getAttributesManager().getAttributes(bdawidowUser);
+ assertEquals(4, attributes.keySet().size());
+ assertEquals("Dawidowicz", (attributes.get(P3PConstants.INFO_USER_NAME_FAMILY)).getValue());
+ assertTrue(Arrays.equals((byte[])attributes.get("picture").getValue(), picture));
+ }
+
+
// Find user by email
assertNull(session.getAttributesManager().findUserByUniqueAttribute("email", "toto"));
User user = session.getAttributesManager().findUserByUniqueAttribute("email", "bd(a)example.com");
assertEquals(bdawidowUser, user);
- // check if same unique email can be used for other user
- try
+ // If email is configured as unique it should not be possible to set same value for different user
+
+ attributeDescription = session.getAttributesManager().getAttributeDescription(bdawidowUser, "email");
+
+ if (attributeDescription != null && attributeDescription.isUnique())
{
- session.getAttributesManager().addAttributes(theuteUser, userInfo);
- fail();
+
+
+ // check if same unique email can be used for other user
+ try
+ {
+ userInfo = new Attribute[]
+ {
+ new SimpleAttribute("email", new String[]{"bd(a)example.com"})
+ };
+
+ session.getAttributesManager().addAttributes(theuteUser, userInfo);
+ fail();
+ }
+ catch (IdentityException e)
+ {
+ // expected
+ }
}
- catch (IdentityException e)
- {
- // expected
- }
-
// Credential
User anotherOne = bdawidowUser; //session.getPersistenceManager().createUser("blah1");
- assertTrue(session.getAttributesManager().isCredentialTypeSupported(PasswordCredential.TYPE));
+ if (session.getAttributesManager().isCredentialTypeSupported(PasswordCredential.TYPE))
+ {
- // #1
- session.getAttributesManager().updatePassword(anotherOne, "secret");
- assertTrue(session.getAttributesManager().validatePassword(anotherOne, "secret"));
- assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret2"));
- assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret3"));
+ // #1
+ session.getAttributesManager().updatePassword(anotherOne, "secret");
+ assertTrue(session.getAttributesManager().validatePassword(anotherOne, "secret"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret2"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret3"));
- // #1
- session.getAttributesManager().updatePassword(anotherOne, "secret2");
- assertTrue(session.getAttributesManager().validatePassword(anotherOne, "secret2"));
- assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret"));
- assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret3"));
+ // #1
+ session.getAttributesManager().updatePassword(anotherOne, "secret2");
+ assertTrue(session.getAttributesManager().validatePassword(anotherOne, "secret2"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret3"));
- // #1
- session.getAttributesManager().updatePassword(anotherOne, "secret3");
- assertTrue(session.getAttributesManager().validatePassword(anotherOne, "secret3"));
- assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret"));
- assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret2"));
+ // #1
+ session.getAttributesManager().updatePassword(anotherOne, "secret3");
+ assertTrue(session.getAttributesManager().validatePassword(anotherOne, "secret3"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret"));
+ assertFalse(session.getAttributesManager().validatePassword(anotherOne, "secret2"));
- // #2
- Credential password = new PasswordCredential("secretPhrase");
- session.getAttributesManager().updateCredential(anotherOne, password);
- assertTrue(session.getAttributesManager().validateCredentials(anotherOne, new Credential[]{password}));
+ // #2
+ Credential password = new PasswordCredential("secretPhrase");
+ session.getAttributesManager().updateCredential(anotherOne, password);
+ assertTrue(session.getAttributesManager().validateCredentials(anotherOne, new Credential[]{password}));
- // #3
+ // #3
+ }
if (session.getAttributesManager().isCredentialTypeSupported(BinaryCredential.TYPE))
{
Copied: idm/trunk/idm-testsuite/src/test/resources/minimal-flexible-identity-config.xml (from rev 601, idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml)
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/minimal-flexible-identity-config.xml (rev 0)
+++ idm/trunk/idm-testsuite/src/test/resources/minimal-flexible-identity-config.xml 2009-06-12 10:09:20 UTC (rev 606)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha identity-config.xsd">
+ <realms>
+ <realm>
+ <id>realm://FlexibleRealm</id>
+ <repository-id-ref>Flexible Repo</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>Flexible Repo</id>
+ <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity Store</default-attribute-store-id>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>Hibernate Identity Store</id>
+ <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <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/>
+ <options>
+ <option>
+ <name>hibernateSessionFactoryJNDIName</name>
+ <value>java:/jbossidentity/HibernateStoreSessionFactory</value>
+ </option>
+ <option>
+ <name>populateRelationshipTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>isRealmAware</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
\ No newline at end of file
Deleted: idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml 2009-06-11 20:28:06 UTC (rev 605)
+++ idm/trunk/idm-testsuite/src/test/resources/organization-test-config.xml 2009-06-12 10:09:20 UTC (rev 606)
@@ -1,818 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha identity-config.xsd">
- <realms>
- <realm>
- <id>realm://RedHat/DB</id>
- <repository-id-ref>RedHat Repository DB</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://portal/SamplePortal/DB</id>
- <repository-id-ref>Sample Portal Repository DB</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://RedHat/DB_LDAP</id>
- <repository-id-ref>RedHat Repository DB+LDAP</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://portal/SamplePortal/DB_LDAP</id>
- <repository-id-ref>Sample Portal Repository DB+LDAP</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- </realms>
- <repositories>
- <repository>
- <id>RedHat Repository DB</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity Store</default-attribute-store-id>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>Sample Portal Repository DB</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity Store</default-attribute-store-id>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>RedHat Repository DB+LDAP</id>
- <class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
- <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>DIVISION</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>USER</identity-object-type>
- <identity-object-type>ORGANIZATION</identity-object-type>
- <identity-object-type>ORGANIZATION_UNIT</identity-object-type>
- <identity-object-type>DEPARTMENT</identity-object-type>
- </identity-object-types>
- <options>
- <option>
- <name>cache</name>
- <value>true</value>
- </option>
- <option>
- <name>cache.provider.class</name>
- <value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheSupportImpl</value>
- </option>
- <option>
- <name>cache.config-file</name>
- <value>src/test/resources/jboss-cache-config.xml</value>
- </option>
- </options>
- </identity-store-mapping>
- </identity-store-mappings>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>Sample Portal Repository DB+LDAP</id>
- <class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
- <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>DIVISION</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>USER</identity-object-type>
- <identity-object-type>DEPARTMENT</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-types>
- <options>
- <option>
- <name>cache</name>
- <value>true</value>
- </option>
- <option>
- <name>cache.provider.class</name>
- <value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheSupportImpl</value>
- </option>
- <option>
- <name>cache.config-file</name>
- <value>src/test/resources/jboss-cache-config.xml</value>
- </option>
- </options>
- </identity-store-mapping>
- </identity-store-mappings>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- </repositories>
- <stores>
- <attribute-stores/>
- <identity-stores>
- <identity-store>
- <id>Hibernate Identity Store</id>
- <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
- <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>USER</name>
- <relationships>
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>COMMUNITY</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>OFFICE</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>SECURITY</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>PROJECT</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>PEOPLE</identity-object-type-ref>-->
- <!--</relationship>-->
- </relationships>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- <attribute>
- <name>picture</name>
- <mapping>user.picture</mapping>
- <type>binary</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>email</name>
- <mapping>mail</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- <isUnique>true</isUnique>
- </attribute>
- </attributes>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DIVISION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION_UNIT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DIVISION</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>PEOPLE</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>PROJECT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>DIVISION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>DEPARTMENT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>PROJECT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>PEOPLE</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ADMINISTRATION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>COMMUNITY</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>OFFICE</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>SECURITY</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>SYSTEM</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>SECURITY</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>COMMUNITY</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- </supported-identity-object-types>
- <options>
- <option>
- <name>hibernateConfiguration</name>
- <value>hibernate-jboss-identity.cfg.xml</value>
- </option>
- <!--<option>-->
- <!--<name>hibernateSessionFactoryJNDIName</name>-->
- <!--<value>java:/jbossidentity/HibernateStoreSessionFactory</value>-->
- <!--</option>-->
- <option>
- <name>populateRelationshipTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>populateIdentityObjectTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- <option>
- <name>isRealmAware</name>
- <value>true</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </identity-store>
- <identity-store>
- <id>LDAP Identity Store</id>
- <class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
- <external-config/>
- <supported-relationship-types>
- <relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
- </supported-relationship-types>
- <supported-identity-object-types>
- <identity-object-type>
- <name>USER</name>
- <relationships/>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- <attribute>
- <name>phone</name>
- <mapping>telephoneNumber</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>email</name>
- <mapping>mail</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- <isUnique>true</isUnique>
- </attribute>
- <attribute>
- <name>description</name>
- <mapping>description</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>carLicense</name>
- <mapping>carLicense</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- </attributes>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeName</name>
- <value>userPassword</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>ORGANIZATION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=Organizations,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>ORGANIZATION_UNIT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=OrganizationUnits,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>DEPARTMENT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=Departments,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>OFFICE</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=Offices,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>
- </identity-stores>
- </stores>
-</jboss-identity>
\ No newline at end of file
Deleted: idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml 2009-06-11 20:28:06 UTC (rev 605)
+++ idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml 2009-06-12 10:09:20 UTC (rev 606)
@@ -1,818 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha identity-config.xsd">
- <realms>
- <realm>
- <id>realm://RedHat/DB</id>
- <repository-id-ref>RedHat Repository DB</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://portal/SamplePortal/DB</id>
- <repository-id-ref>Sample Portal Repository DB</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://RedHat/DB_LDAP</id>
- <repository-id-ref>RedHat Repository DB+LDAP</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- <realm>
- <id>realm://portal/SamplePortal/DB_LDAP</id>
- <repository-id-ref>Sample Portal Repository DB+LDAP</repository-id-ref>
- <identity-type-mappings>
- <user-mapping>USER</user-mapping>
- </identity-type-mappings>
- </realm>
- </realms>
- <repositories>
- <repository>
- <id>RedHat Repository DB</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity Store</default-attribute-store-id>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>Sample Portal Repository DB</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
- <external-config/>
- <default-identity-store-id>Hibernate Identity Store</default-identity-store-id>
- <default-attribute-store-id>Hibernate Identity Store</default-attribute-store-id>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>RedHat Repository DB+LDAP</id>
- <class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
- <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>DIVISION</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>USER</identity-object-type>
- <identity-object-type>ORGANIZATION</identity-object-type>
- <identity-object-type>ORGANIZATION_UNIT</identity-object-type>
- <identity-object-type>DEPARTMENT</identity-object-type>
- </identity-object-types>
- <options>
- <option>
- <name>cache</name>
- <value>false</value>
- </option>
- <option>
- <name>cache.provider.class</name>
- <value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheProviderImpl</value>
- </option>
- <option>
- <name>cache.config-file</name>
- <value>jboss-cache-config.xml</value>
- </option>
- </options>
- </identity-store-mapping>
- </identity-store-mappings>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- <repository>
- <id>Sample Portal Repository DB+LDAP</id>
- <class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
- <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>DIVISION</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>USER</identity-object-type>
- <identity-object-type>DEPARTMENT</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-types>
- <options>
- <option>
- <name>cache</name>
- <value>false</value>
- </option>
- <option>
- <name>cache.provider.class</name>
- <value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheProviderImpl</value>
- </option>
- <option>
- <name>cache.config-file</name>
- <value>jboss-cache-config.xml</value>
- </option>
- </options>
- </identity-store-mapping>
- </identity-store-mappings>
- <options>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </repository>
- </repositories>
- <stores>
- <attribute-stores/>
- <identity-stores>
- <identity-store>
- <id>Hibernate Identity Store</id>
- <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
- <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>USER</name>
- <relationships>
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>COMMUNITY</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>OFFICE</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>SECURITY</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>PROJECT</identity-object-type-ref>-->
- <!--</relationship>-->
- <!--<relationship>-->
- <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
- <!--<identity-object-type-ref>PEOPLE</identity-object-type-ref>-->
- <!--</relationship>-->
- </relationships>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- <attribute>
- <name>picture</name>
- <mapping>user.picture</mapping>
- <type>binary</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>email</name>
- <mapping>mail</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- <isUnique>true</isUnique>
- </attribute>
- </attributes>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DIVISION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ORGANIZATION_UNIT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DIVISION</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>PEOPLE</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>PROJECT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>DIVISION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>DEPARTMENT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>PROJECT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>PEOPLE</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>ADMINISTRATION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>COMMUNITY</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>OFFICE</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>SECURITY</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- <identity-object-type>
- <name>SYSTEM</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>SECURITY</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>COMMUNITY</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options/>
- </identity-object-type>
- </supported-identity-object-types>
- <options>
- <!--<option>-->
- <!--<name>hibernateConfiguration</name>-->
- <!--<value>hibernate-jboss-identity.cfg.xml</value>-->
- <!--</option>-->
- <option>
- <name>hibernateSessionFactoryJNDIName</name>
- <value>java:/jbossidentity/HibernateStoreSessionFactory</value>
- </option>
- <option>
- <name>populateRelationshipTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>populateIdentityObjectTypes</name>
- <value>true</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- <option>
- <name>isRealmAware</name>
- <value>true</value>
- </option>
- <option>
- <name>allowNotDefinedAttributes</name>
- <value>true</value>
- </option>
- </options>
- </identity-store>
- <identity-store>
- <id>LDAP Identity Store</id>
- <class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
- <external-config/>
- <supported-relationship-types>
- <relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
- </supported-relationship-types>
- <supported-identity-object-types>
- <identity-object-type>
- <name>USER</name>
- <relationships/>
- <credentials>
- <credential-type>PASSWORD</credential-type>
- </credentials>
- <attributes>
- <attribute>
- <name>phone</name>
- <mapping>telephoneNumber</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>description</name>
- <mapping>description</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>carLicense</name>
- <mapping>carLicense</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- </attribute>
- <attribute>
- <name>email</name>
- <mapping>mail</mapping>
- <type>text</type>
- <isRequired>false</isRequired>
- <isMultivalued>false</isMultivalued>
- <isReadOnly>false</isReadOnly>
- <isUnique>true</isUnique>
- </attribute>
- </attributes>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeName</name>
- <value>userPassword</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>ORGANIZATION</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=Organizations,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>ORGANIZATION_UNIT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>OFFICE</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=OrganizationUnits,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>DEPARTMENT</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
- </relationship>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=Departments,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>OFFICE</name>
- <relationships>
- <relationship>
- <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
- <identity-object-type-ref>USER</identity-object-type-ref>
- </relationship>
- </relationships>
- <credentials/>
- <attributes/>
- <options>
- <option>
- <name>idAttributeName</name>
- <value>cn</value>
- </option>
- <option>
- <name>ctxDNs</name>
- <value>ou=Offices,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>
- </identity-stores>
- </stores>
-</jboss-identity>
\ No newline at end of file
Copied: idm/trunk/idm-testsuite/src/test/resources/test-identity-config.xml (from rev 601, idm/trunk/idm-testsuite/src/test/resources/organization-test-jboss-unit-config.xml)
===================================================================
--- idm/trunk/idm-testsuite/src/test/resources/test-identity-config.xml (rev 0)
+++ idm/trunk/idm-testsuite/src/test/resources/test-identity-config.xml 2009-06-12 10:09:20 UTC (rev 606)
@@ -0,0 +1,818 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_alpha"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha identity-config.xsd">
+ <realms>
+ <realm>
+ <id>realm://RedHat/DB</id>
+ <repository-id-ref>RedHat Repository DB</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://portal/SamplePortal/DB</id>
+ <repository-id-ref>Sample Portal Repository DB</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://RedHat/DB_LDAP</id>
+ <repository-id-ref>RedHat Repository DB+LDAP</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ <realm>
+ <id>realm://portal/SamplePortal/DB_LDAP</id>
+ <repository-id-ref>Sample Portal Repository DB+LDAP</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>RedHat Repository DB</id>
+ <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity Store</default-attribute-store-id>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>Sample Portal Repository DB</id>
+ <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+ <default-identity-store-id>Hibernate Identity Store</default-identity-store-id>
+ <default-attribute-store-id>Hibernate Identity Store</default-attribute-store-id>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>RedHat Repository DB+LDAP</id>
+ <class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
+ <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>DIVISION</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>USER</identity-object-type>
+ <identity-object-type>ORGANIZATION</identity-object-type>
+ <identity-object-type>ORGANIZATION_UNIT</identity-object-type>
+ <identity-object-type>DEPARTMENT</identity-object-type>
+ </identity-object-types>
+ <options>
+ <option>
+ <name>cache</name>
+ <value>false</value>
+ </option>
+ <option>
+ <name>cache.provider.class</name>
+ <value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheProviderImpl</value>
+ </option>
+ <option>
+ <name>cache.config-file</name>
+ <value>jboss-cache-config.xml</value>
+ </option>
+ </options>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ <repository>
+ <id>Sample Portal Repository DB+LDAP</id>
+ <class>org.jboss.identity.idm.impl.repository.FallbackIdentityStoreRepository</class>
+ <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>DIVISION</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>USER</identity-object-type>
+ <identity-object-type>DEPARTMENT</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-types>
+ <options>
+ <option>
+ <name>cache</name>
+ <value>false</value>
+ </option>
+ <option>
+ <name>cache.provider.class</name>
+ <value>org.jboss.identity.idm.impl.cache.IdentityStoreCacheProviderImpl</value>
+ </option>
+ <option>
+ <name>cache.config-file</name>
+ <value>jboss-cache-config.xml</value>
+ </option>
+ </options>
+ </identity-store-mapping>
+ </identity-store-mappings>
+ <options>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>Hibernate Identity Store</id>
+ <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <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>USER</name>
+ <relationships>
+ <!--<relationship>-->
+ <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+ <!--<identity-object-type-ref>ORGANIZATION</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+ <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+ <!--<identity-object-type-ref>COMMUNITY</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+ <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+ <!--<identity-object-type-ref>OFFICE</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+ <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+ <!--<identity-object-type-ref>SECURITY</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+ <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+ <!--<identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+ <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+ <!--<identity-object-type-ref>PROJECT</identity-object-type-ref>-->
+ <!--</relationship>-->
+ <!--<relationship>-->
+ <!--<relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>-->
+ <!--<identity-object-type-ref>PEOPLE</identity-object-type-ref>-->
+ <!--</relationship>-->
+ </relationships>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes>
+ <attribute>
+ <name>picture</name>
+ <mapping>user.picture</mapping>
+ <type>binary</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>email</name>
+ <mapping>mail</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ <isUnique>true</isUnique>
+ </attribute>
+ </attributes>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>DIVISION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ORGANIZATION_UNIT</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>DIVISION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>PEOPLE</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>PROJECT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DIVISION</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>DEPARTMENT</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>PROJECT</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>PEOPLE</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>ADMINISTRATION</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>COMMUNITY</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>OFFICE</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>SECURITY</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>SYSTEM</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_ROLE</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>SECURITY</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>COMMUNITY</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <!--<option>-->
+ <!--<name>hibernateConfiguration</name>-->
+ <!--<value>hibernate-jboss-identity.cfg.xml</value>-->
+ <!--</option>-->
+ <option>
+ <name>hibernateSessionFactoryJNDIName</name>
+ <value>java:/jbossidentity/HibernateStoreSessionFactory</value>
+ </option>
+ <option>
+ <name>populateRelationshipTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>populateIdentityObjectTypes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>isRealmAware</name>
+ <value>true</value>
+ </option>
+ <option>
+ <name>allowNotDefinedAttributes</name>
+ <value>true</value>
+ </option>
+ </options>
+ </identity-store>
+ <identity-store>
+ <id>LDAP Identity Store</id>
+ <class>org.jboss.identity.idm.impl.store.ldap.LDAPIdentityStoreImpl</class>
+ <external-config/>
+ <supported-relationship-types>
+ <relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+ </supported-relationship-types>
+ <supported-identity-object-types>
+ <identity-object-type>
+ <name>USER</name>
+ <relationships/>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <attributes>
+ <attribute>
+ <name>phone</name>
+ <mapping>telephoneNumber</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>description</name>
+ <mapping>description</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>carLicense</name>
+ <mapping>carLicense</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ </attribute>
+ <attribute>
+ <name>email</name>
+ <mapping>mail</mapping>
+ <type>text</type>
+ <isRequired>false</isRequired>
+ <isMultivalued>false</isMultivalued>
+ <isReadOnly>false</isReadOnly>
+ <isUnique>true</isUnique>
+ </attribute>
+ </attributes>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>passwordAttributeName</name>
+ <value>userPassword</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>ORGANIZATION</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>ORGANIZATION</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+ <value>ou=Organizations,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>ORGANIZATION_UNIT</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>OFFICE</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+ <value>ou=OrganizationUnits,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>DEPARTMENT</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>DEPARTMENT</identity-object-type-ref>
+ </relationship>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>ORGANIZATION_UNIT</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+ <value>ou=Departments,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>OFFICE</name>
+ <relationships>
+ <relationship>
+ <relationship-type-ref>JBOSS_IDENTITY_MEMBERSHIP</relationship-type-ref>
+ <identity-object-type-ref>USER</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options>
+ <option>
+ <name>idAttributeName</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>ctxDNs</name>
+ <value>ou=Offices,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>
+ </identity-stores>
+ </stores>
+</jboss-identity>
\ No newline at end of file
14 years, 11 months
JBoss Identity SVN: r605 - in identity-doc/trunk: UserGuide/src/main/docbook and 1 other directory.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-06-11 16:28:06 -0400 (Thu, 11 Jun 2009)
New Revision: 605
Modified:
identity-doc/trunk/DeveloperGuide/src/main/docbook/DeveloperGuide.xml
identity-doc/trunk/UserGuide/src/main/docbook/UserGuide.xml
Log:
version change
Modified: identity-doc/trunk/DeveloperGuide/src/main/docbook/DeveloperGuide.xml
===================================================================
--- identity-doc/trunk/DeveloperGuide/src/main/docbook/DeveloperGuide.xml 2009-06-10 19:34:44 UTC (rev 604)
+++ identity-doc/trunk/DeveloperGuide/src/main/docbook/DeveloperGuide.xml 2009-06-11 20:28:06 UTC (rev 605)
@@ -13,7 +13,7 @@
xmlns:xi="http://www.w3.org/2001/XInclude" />
<releaseinfo>
- 1.0.0.alpha2.
+ 1.0.0.alpha3.
</releaseinfo>
</bookinfo>
@@ -182,6 +182,10 @@
<ulink
url="http://www.jboss.com/index.html?module=bb&c=32">JBoss Identity Design Forum</ulink>
</para>
+ <para>
+ <ulink
+ url="http://www.jboss.org/community/docs/DOC-13254">JBoss Identity Wiki</ulink>
+ </para>
</chapter>
</part>
</book>
Modified: identity-doc/trunk/UserGuide/src/main/docbook/UserGuide.xml
===================================================================
--- identity-doc/trunk/UserGuide/src/main/docbook/UserGuide.xml 2009-06-10 19:34:44 UTC (rev 604)
+++ identity-doc/trunk/UserGuide/src/main/docbook/UserGuide.xml 2009-06-11 20:28:06 UTC (rev 605)
@@ -14,7 +14,7 @@
xmlns:xi="http://www.w3.org/2001/XInclude" />
<releaseinfo>
- 1.0.0.alpha2.
+ 1.0.0.alpha3.
</releaseinfo>
@@ -255,7 +255,7 @@
<programlisting role="xml">
<Context>
<Valve
- className="org.jboss.identity.federation.bindings.tomcat.idp.IDPRedirectValve"
+ className="org.jboss.identity.federation.bindings.tomcat.idp.IDPWebBrowserSSOValve"
/>
</Context>
</programlisting>
14 years, 11 months
JBoss Identity SVN: r604 - identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-06-10 15:34:44 -0400 (Wed, 10 Jun 2009)
New Revision: 604
Modified:
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java
Log:
change to use JAXBUtil
Modified: identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java
===================================================================
--- identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java 2009-06-10 17:18:15 UTC (rev 603)
+++ identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/WSTrustJAXBFactory.java 2009-06-10 19:34:44 UTC (rev 604)
@@ -21,7 +21,6 @@
*/
package org.jboss.identity.federation.api.wstrust;
-import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
@@ -29,6 +28,7 @@
import javax.xml.bind.util.JAXBSource;
import javax.xml.transform.Source;
+import org.jboss.identity.federation.core.util.JAXBUtil;
import org.jboss.identity.federation.core.wstrust.BaseRequestSecurityToken;
import org.jboss.identity.federation.core.wstrust.BaseRequestSecurityTokenResponse;
import org.jboss.identity.federation.core.wstrust.RequestSecurityToken;
@@ -51,9 +51,11 @@
public class WSTrustJAXBFactory
{
private static final WSTrustJAXBFactory instance = new WSTrustJAXBFactory();
+
+ private Marshaller marshaller;
+
+ private Unmarshaller unmarshaller;
- private final JAXBContext context;
-
private final ObjectFactory factory;
/**
@@ -62,16 +64,10 @@
* </p>
*/
private WSTrustJAXBFactory()
- {
- StringBuffer packages = new StringBuffer();
- packages.append("org.jboss.identity.federation.ws.addressing");
- packages.append(":org.jboss.identity.federation.ws.policy");
- packages.append(":org.jboss.identity.federation.ws.trust");
- packages.append(":org.jboss.identity.federation.ws.wss.secext");
- packages.append(":org.jboss.identity.federation.ws.wss.utility");
+ {
try
- {
- this.context = JAXBContext.newInstance(packages.toString());
+ {
+ marshaller = JAXBUtil.getMarshaller(getPackage());
this.factory = new ObjectFactory();
}
catch (JAXBException e)
@@ -91,7 +87,18 @@
{
return instance;
}
-
+
+ public String getPackage()
+ {
+ StringBuilder packages = new StringBuilder();
+ packages.append("org.jboss.identity.federation.ws.addressing");
+ packages.append(":org.jboss.identity.federation.ws.policy");
+ packages.append(":org.jboss.identity.federation.ws.trust");
+ packages.append(":org.jboss.identity.federation.ws.wss.secext");
+ packages.append(":org.jboss.identity.federation.ws.wss.utility");
+ return packages.toString();
+ }
+
/**
* <p>
* Creates a {@code BaseRequestSecurityToken} from the specified XML source.
@@ -106,8 +113,7 @@
{
try
{
- Unmarshaller unmarshaller = this.context.createUnmarshaller();
- Object object = unmarshaller.unmarshal(request);
+ Object object = getUnmarshaller().unmarshal(request);
// check the type of the unmarshalled object.
if (object instanceof RequestSecurityTokenType)
@@ -148,8 +154,7 @@
{
try
{
- Unmarshaller unmarshaller = this.context.createUnmarshaller();
- Object object = unmarshaller.unmarshal(response);
+ Object object = getUnmarshaller().unmarshal(response);
// check the type of the response object.
if (object instanceof RequestSecurityTokenResponseType)
return new RequestSecurityTokenResponse((RequestSecurityTokenResponseType) object);
@@ -202,8 +207,7 @@
try
{
- Marshaller marshaller = this.context.createMarshaller();
- return new JAXBSource(marshaller, element);
+ return new JAXBSource(getMarshaller(), element);
}
catch (JAXBException je)
{
@@ -238,13 +242,27 @@
try
{
- Marshaller marshaller = this.context.createMarshaller();
- return new JAXBSource(marshaller, element);
+ return new JAXBSource(getMarshaller(), element);
}
catch (JAXBException je)
{
throw new RuntimeException("Failed to marshall security token request", je);
}
}
+
-}
+ private Unmarshaller getUnmarshaller() throws JAXBException
+ {
+ if(unmarshaller == null)
+ unmarshaller = JAXBUtil.getUnmarshaller(getPackage());
+ return unmarshaller;
+ }
+
+ private Marshaller getMarshaller() throws JAXBException
+ {
+ if(marshaller == null)
+ marshaller = JAXBUtil.getMarshaller(getPackage());
+ return marshaller;
+ }
+
+}
\ No newline at end of file
14 years, 11 months
JBoss Identity SVN: r603 - identity-federation/trunk/jboss-identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-06-10 13:18:15 -0400 (Wed, 10 Jun 2009)
New Revision: 603
Modified:
identity-federation/trunk/jboss-identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SignatureValidationUnitTestCase.java
Log:
comment out sys out
Modified: identity-federation/trunk/jboss-identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SignatureValidationUnitTestCase.java
===================================================================
--- identity-federation/trunk/jboss-identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SignatureValidationUnitTestCase.java 2009-06-10 17:17:42 UTC (rev 602)
+++ identity-federation/trunk/jboss-identity-fed-api/src/test/java/org/jboss/test/identity/federation/api/saml/v2/SignatureValidationUnitTestCase.java 2009-06-10 17:18:15 UTC (rev 603)
@@ -79,7 +79,7 @@
ss.setSignatureMethod(SignatureMethod.DSA_SHA1);
Document signedDoc = ss.sign(authnRequest, kp);
- System.out.println(DocumentUtil.getDocumentAsString(signedDoc));
+ //System.out.println(DocumentUtil.getDocumentAsString(signedDoc));
//Validate the signature
boolean isValid = XMLSignatureUtil.validate(signedDoc, kp.getPublic());
@@ -156,7 +156,7 @@
SAML2Signature ss = new SAML2Signature();
Document signedDoc = ss.sign(responseType, id, kp,referenceURI);
- System.out.println(DocumentUtil.getDocumentAsString(signedDoc));
+ //System.out.println(DocumentUtil.getDocumentAsString(signedDoc));
Node signedNode = DocumentUtil.getNodeWithAttribute(signedDoc,
"urn:oasis:names:tc:SAML:2.0:assertion",
14 years, 11 months
JBoss Identity SVN: r602 - in identity-federation/trunk: jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/plugins/saml and 1 other directories.
by jboss-identity-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2009-06-10 13:17:42 -0400 (Wed, 10 Jun 2009)
New Revision: 602
Modified:
identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/wstrust/SpecialTokenProvider.java
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/plugins/saml/SAMLUtil.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/DocumentUtil.java
Log:
JBID-128: DocumentBuilderFactory setXIncludeAware
Modified: identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/wstrust/SpecialTokenProvider.java
===================================================================
--- identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/wstrust/SpecialTokenProvider.java 2009-06-10 09:08:26 UTC (rev 601)
+++ identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/wstrust/SpecialTokenProvider.java 2009-06-10 17:17:42 UTC (rev 602)
@@ -24,8 +24,6 @@
import java.net.URI;
import java.net.URISyntaxException;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.jboss.identity.federation.api.wstrust.SecurityToken;
@@ -33,6 +31,7 @@
import org.jboss.identity.federation.api.wstrust.StandardSecurityToken;
import org.jboss.identity.federation.api.wstrust.WSTrustException;
import org.jboss.identity.federation.api.wstrust.WSTrustRequestContext;
+import org.jboss.identity.federation.core.saml.v2.util.DocumentUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -79,10 +78,8 @@
// we will use DOM to create the token.
try
- {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder docBuilder = factory.newDocumentBuilder();
- Document doc = docBuilder.newDocument();
+ {
+ Document doc = DocumentUtil.createDocument();
Element root = doc.createElementNS("http://www.tokens.org", "token:SpecialToken");
root.appendChild(doc.createTextNode("Principal:" + caller));
Modified: identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/plugins/saml/SAMLUtil.java
===================================================================
--- identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/plugins/saml/SAMLUtil.java 2009-06-10 09:08:26 UTC (rev 601)
+++ identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/wstrust/plugins/saml/SAMLUtil.java 2009-06-10 17:17:42 UTC (rev 602)
@@ -25,10 +25,10 @@
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.dom.DOMResult;
import org.jboss.identity.federation.api.wstrust.WSTrustConstants;
+import org.jboss.identity.federation.core.saml.v2.util.DocumentUtil;
import org.jboss.identity.federation.core.util.JAXBUtil;
import org.jboss.identity.federation.saml.v2.assertion.AssertionType;
import org.jboss.identity.federation.saml.v2.assertion.ObjectFactory;
@@ -63,8 +63,7 @@
*/
public static Document toDocument(AssertionType assertion) throws Exception
{
- Document document = null;
- document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+ Document document = DocumentUtil.createDocument();
DOMResult result = new DOMResult(document);
Marshaller marshaller = JAXBUtil.getMarshaller("org.jboss.identity.federation.saml.v2.assertion");
marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new DefaultPrefixMapper());
Modified: identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/DocumentUtil.java
===================================================================
--- identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/DocumentUtil.java 2009-06-10 09:08:26 UTC (rev 601)
+++ identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/util/DocumentUtil.java 2009-06-10 17:17:42 UTC (rev 602)
@@ -118,7 +118,7 @@
public static Document getDocument(Reader reader)
throws ParserConfigurationException, SAXException, IOException
{
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilderFactory factory = getDocumentBuilderFactory();
DocumentBuilder builder = factory.newDocumentBuilder();
return builder.parse(new InputSource(reader));
}
@@ -310,6 +310,7 @@
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
+ factory.setXIncludeAware(true);
return factory;
}
}
\ No newline at end of file
14 years, 11 months