Author: jeff.yuchang
Date: 2009-05-21 11:58:33 -0400 (Thu, 21 May 2009)
New Revision: 503
Added:
idm/trunk/integration/deployer/
idm/trunk/integration/deployer/pom.xml
idm/trunk/integration/deployer/src/
idm/trunk/integration/deployer/src/main/
idm/trunk/integration/deployer/src/main/java/
idm/trunk/integration/deployer/src/main/java/org/
idm/trunk/integration/deployer/src/main/java/org/jboss/
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/
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/IDMConfigParsingDeployer.java
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/IDMMetadata.java
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/JAXB2IdentityDeployerConfiguration.java
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/SQLPopulator.java
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/HibernateInitializerType.java
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/InitializerType.java
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/JbossIDMDeployerType.java
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/ObjectFactory.java
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/OptionType.java
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/OptionsType.java
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/SqlInitializerType.java
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/package-info.java
idm/trunk/integration/deployer/src/main/resources/
idm/trunk/integration/deployer/src/main/resources/META-INF/
idm/trunk/integration/deployer/src/main/resources/META-INF/default-jboss-idm.xml
idm/trunk/integration/deployer/src/main/resources/META-INF/idm-deployer-jboss-beans.xml
idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml
idm/trunk/integration/deployer/src/main/resources/identity-deployer.xsd
idm/trunk/integration/deployer/src/main/resources/idm-assembly.xml
idm/trunk/integration/deployer/src/main/resources/jbidm-hsqldb-ds.xml
idm/trunk/integration/deployer/src/main/resources/jboss.idm.cfg.xml
idm/trunk/integration/deployer/src/main/resources/jboss.idm.hibernate.cfg.xml
idm/trunk/integration/deployer/src/test/
idm/trunk/integration/deployer/src/test/java/
idm/trunk/integration/deployer/src/test/resources/
Log:
* Add the jboss5 deployer for the idm.
Added: idm/trunk/integration/deployer/pom.xml
===================================================================
--- idm/trunk/integration/deployer/pom.xml (rev 0)
+++ idm/trunk/integration/deployer/pom.xml 2009-05-21 15:58:33 UTC (rev 503)
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBoss Identity IDM Integration JBoss5 deployer</name>
+ <description>JBoss Identity IDM JBoss5 deployer</description>
+
+ <groupId>org.jboss.identity.idm.integration</groupId>
+ <artifactId>idm-jboss5-deployer</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0.0-SNAPSHOT</version>
+
+ <parent>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-integration</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <properties>
+ <jboss.version>5.0.0.GA</jboss.version>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-hibernate</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity.idm</groupId>
+ <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>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-system-jmx</artifactId>
+ <version>${jboss.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>bsh</groupId>
+ <artifactId>bsh</artifactId>
+ <version>1.3.0</version>
+ </dependency>
+
+ </dependencies>
+
+ <!-- Build -->
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <optimize>true</optimize>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>META-INF/*.xml</exclude>
+ <exclude>*.xml</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>deployer</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>idm-deployer</finalName>
+ <appendAssemblyId>true</appendAssemblyId>
+ <descriptors>
+
<descriptor>src/main/resources/deployer-assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ <execution>
+ <id>config</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>idm.config</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>src/main/resources/idm-assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
Added:
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
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/HibernatePopulator.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,304 @@
+/**
+ *
+ */
+package org.jboss.identity.idm.integration.jboss5;
+
+import java.net.URL;
+import java.util.Collection;
+import java.util.Iterator;
+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.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;
+
+/**
+ *
+ * Using the Hibernate built-in SchemaExport.
+ *
+ * @author Jeff Yu
+ * @author Boleslaw Dawidowicz
+ * @author Julien Viet
+ *
+ */
+public class HibernatePopulator {
+
+ private static Logger logger = Logger.getLogger(HibernatePopulator.class.getName());
+
+ /** doCheck result - schema ok */
+ private static final int RESULT_NONE = 0;
+
+ /** doCheck result - schema need updates */
+ private static final int RESULT_UPDATE = 1;
+
+ /** 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 IdentityConfiguration identityConfiguration;
+
+
+ public HibernatePopulator(HibernateInitializerType type, IdentityConfiguration
identityConfig) {
+ this.type = type;
+ this.identityConfiguration = identityConfig;
+ }
+
+
+ public void populateSchema() throws Exception {
+
+ // 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();
+ }
+ }
+
+ }
+
+
+ private int doCheck()
+ {
+ Session session = null;
+ int numOfChecks = 0;
+ int bad = 0;
+ try
+ {
+ session = sessionFactory.openSession();
+ Collection<ClassMetadata> values =
sessionFactory.getAllClassMetadata().values();
+ numOfChecks = values.size();
+ for (Iterator<ClassMetadata> i = values.iterator(); i.hasNext();)
+ {
+ ClassMetadata cmd = (ClassMetadata)i.next();
+ Query query = session.createQuery("from " + cmd.getEntityName());
+ query.setFirstResult(0);
+ query.setMaxResults(0);
+ try
+ {
+ query.list();
+ }
+ catch (SQLGrammarException e)
+ {
+ // We consider that exception means that the schema does not exist
+ bad++;
+ }
+ }
+ }
+ finally
+ {
+ sessionFactory.close();
+ }
+ // There was no sql grammar exception - schema is ok!
+ if (bad == 0)
+ {
+ logger.fine("The schema was checked as valid");
+ //do nothing
+ return RESULT_NONE;
+ }
+ // There is no existing valid schema;
+ else if (bad == numOfChecks)
+ {
+ logger.fine("The schema was checked as not exists");
+ // Totaly invalid schema
+ return RESULT_CREATE;
+ }
+ // Schema is partialy corrupted
+ else if (bad < numOfChecks)
+ {
+ // Schema needs updates;
+ logger.fine("The schema was checked as need updates");
+ return RESULT_UPDATE;
+ }
+
+ // If here something gone wrong...
+ logger.fine("The schema was checked as need to be created");
+ return RESULT_CREATE;
+ }
+
+ private void createSchema()
+ {
+ logger.fine("Creating database schema");
+ SchemaExport export = new SchemaExport(config);
+ export.create(false, true);
+ }
+
+ private void destroySchema()
+ {
+ logger.fine("Destroying database schema");
+ SchemaExport export = new SchemaExport(config);
+ export.drop(false, true);
+ }
+
+ private void updateSchema()
+ {
+ logger.fine("Updating database schema");
+ 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
+ {
+ logger.info("Creating database content");
+ final String script = setupResource.asString("UTF-8");
+
+ // 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()
+ {
+ public Object run() throws Exception
+ {
+ interpreter.eval(script);
+ return null;
+ }
+ });
+ }
+ catch (EvalError e)
+ {
+ logger.info("Error in the bsh script: " + e);
+ }
+ catch (IllegalStateException e)
+ {
+ logger.info("Cannot load setup script: " + e);
+ }
+ catch (Exception e)
+ {
+ logger.info("Error in bsh script execution: " + e);
+ }
+ }
+ else
+ {
+ logger.info("There is a setup URL but the not valid " +
setupResource);
+ }
+ }
+ }
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMConfigParsingDeployer.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMConfigParsingDeployer.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMConfigParsingDeployer.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,43 @@
+/**
+ *
+ */
+package org.jboss.identity.idm.integration.jboss5;
+
+import java.util.logging.Logger;
+
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.identity.idm.integration.jboss5.jaxb2.JbossIDMDeployerType;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * IDMConfigParsingDeployer is picking up the *-jboss-idm.xml files, produce the {@link
IDMMetadata} Object, which will be used in the
+ * IDMDeployer. This parsing deployer is in the 'Parse' phase of JBoss Deployment
framework.
+ *
+ * @author Jeff Yu
+ *
+ */
+public class IDMConfigParsingDeployer extends
AbstractVFSParsingDeployer<IDMMetadata>{
+
+ private static final Logger logger =
Logger.getLogger(IDMConfigParsingDeployer.class.getName());
+
+ public IDMConfigParsingDeployer() {
+ super(IDMMetadata.class);
+ }
+
+ @Override
+ protected IDMMetadata parse(VFSDeploymentUnit deploymentUnit, VirtualFile file,
IDMMetadata metadata) throws Exception {
+ logger.fine("Parsing IDM deployer file");
+
+ IDMMetadata metaData = new IDMMetadata();
+ metaData.setDeployerFileName(file.getPathName());
+
+ JbossIDMDeployerType deployerMetadata =
JAXB2IdentityDeployerConfiguration.createDeployerConfiguration(file.openStream());
+ metaData.setDeploperType(deployerMetadata);
+
+
+ logger.fine("the configuration file path name is: [" + file.getPathName() +
"]");
+ return metaData;
+ }
+
+}
Added:
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
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMDeployer.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,170 @@
+/**
+ *
+ */
+package org.jboss.identity.idm.integration.jboss5;
+
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.util.logging.Logger;
+
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+import javax.transaction.TransactionManager;
+
+import org.hibernate.dialect.Dialect;
+import org.hibernate.dialect.DialectFactory;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+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.configuration.IdentityConfigurationImpl;
+import org.jboss.identity.idm.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
+import org.jboss.identity.idm.integration.jboss5.jaxb2.HibernateInitializerType;
+import org.jboss.identity.idm.integration.jboss5.jaxb2.JbossIDMDeployerType;
+import org.jboss.identity.idm.integration.jboss5.jaxb2.SqlInitializerType;
+import org.jboss.identity.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
+import
org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
+
+
+/**
+ *
+ *
+ * @author Jeff Yu
+ *
+ */
+public class IDMDeployer extends AbstractSimpleVFSRealDeployer<IDMMetadata> {
+
+ private static final Logger logger = Logger.getLogger(IDMDeployer.class.getName());
+
+ private static final String HIBERNATE_CONFIGFILE = "hibernateConfiguration";
+
+ private IdentitySessionFactory idSF;
+
+ public IDMDeployer() {
+ super(IDMMetadata.class);
+ }
+
+ @Override
+ public void deploy(VFSDeploymentUnit deploymentUnit, IDMMetadata metadata) throws
DeploymentException {
+ JbossIDMDeployerType config = metadata.getDeploperType();
+
+ try {
+
+ InputStream is =
deploymentUnit.getClassLoader().getResourceAsStream(config.getIdmConfigFile());
+ IdentityConfigurationMetaData identityMetadata =
JAXB2IdentityConfiguration.createConfigurationMetaData(is);
+ final IdentityConfiguration identityConfiguration = new
IdentityConfigurationImpl().configure(identityMetadata);
+
+ if (config.getInitializers() != null) {
+ logger.fine("starting to populate the schema into db");
+ String datasource = config.getInitializers().getDatasource();
+
+ checkTargetDB(config.getInitializers().getDatasource());
+
+ HibernateInitializerType hibernateInitializer =
config.getInitializers().getHibernateInitializer();
+ 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();
+ }
+ }
+
+ }else if (sqlInitializer != null) {
+ logger.fine("starting to populate the schema from script file [" +
sqlInitializer.getSqlFile() + "]");
+ SQLPopulator sqlPopulator = new SQLPopulator(datasource,
sqlInitializer.getSqlFile(), sqlInitializer.getExitSQL());
+ sqlPopulator.populateSchema();
+ }
+ }
+
+ try {
+ TransactionManager tm =
TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager();
+ Transactions.required(tm, new Transactions.Runnable()
+ {
+ public Object run() throws Exception
+ {
+ idSF = identityConfiguration.buildIdentitySessionFactory();
+ return null;
+ }
+ });
+ } catch (Exception e) {
+ throw new Exception("Cannot create IdentitySessionFactory", e);
+ }
+
+ InitialContext context = new InitialContext();
+ context.bind(config.getJNDIName(), idSF);
+ logger.info("Started the JBoss Identity Management Service");
+
+ } catch (Exception e) {
+ throw new DeploymentException(e);
+ }
+
+ }
+
+ @Override
+ public void undeploy(VFSDeploymentUnit deploymentUnit, IDMMetadata metadata) {
+ if (idSF != null) {
+ idSF.close();
+ }
+
+ try {
+ InitialContext context = new InitialContext();
+ context.unbind(metadata.getDeploperType().getJNDIName());
+ } catch (Exception e) {
+ logger.severe(e.getMessage());
+ throw new RuntimeException(e);
+ }
+
+ logger.info("Stopped the JBoss IDM Service");
+
+ }
+
+
+ private void checkTargetDB(String datasource) throws Exception{
+ DataSource ds = (DataSource)new InitialContext().lookup(datasource);
+ Connection conn = null;
+ Dialect dialectName = null;
+ try
+ {
+ conn = ds.getConnection();
+ DatabaseMetaData meta = conn.getMetaData();
+ String databaseName = meta.getDatabaseProductName();
+ int databaseMajorVersion = getDatabaseMajorVersion(meta);
+ dialectName = DialectFactory.determineDialect(databaseName,
databaseMajorVersion);
+ logger.fine("Detected dialect " + dialectName + ", database is
(" + databaseName + "," + databaseMajorVersion + ")");
+ }
+ finally
+ {
+ if (conn != null) {
+ conn.close();
+ }
+ }
+ }
+
+ private int getDatabaseMajorVersion(DatabaseMetaData meta)
+ {
+ try
+ {
+ Method gdbmvMethod =
DatabaseMetaData.class.getMethod("getDatabaseMajorVersion", (Class[])null);
+ return ((Integer)gdbmvMethod.invoke(meta, (Object[])null)).intValue();
+ }
+ catch (NoSuchMethodException nsme)
+ {
+ return 0;
+ }
+ catch (Throwable t)
+ {
+ logger.fine("could not get database version from JDBC metadata");
+ return 0;
+ }
+ }
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMMetadata.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMMetadata.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMMetadata.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,43 @@
+/**
+ *
+ */
+package org.jboss.identity.idm.integration.jboss5;
+
+import java.io.Serializable;
+
+import org.jboss.identity.idm.integration.jboss5.jaxb2.JbossIDMDeployerType;
+
+/**
+ *
+ *
+ * @author Jeff Yu
+ *
+ */
+public class IDMMetadata implements Serializable{
+
+ private static final long serialVersionUID = -3236524660920273677L;
+
+ private JbossIDMDeployerType deployerType;
+
+ private String deployerFileName;
+
+ public JbossIDMDeployerType getDeploperType() {
+ return deployerType;
+ }
+
+ public void setDeploperType(JbossIDMDeployerType deployerType) {
+ this.deployerType = deployerType;
+ }
+
+ public String getDeployerFileName() {
+ return deployerFileName;
+ }
+
+ public void setDeployerFileName(String deployerFileName) {
+ this.deployerFileName = deployerFileName;
+ }
+
+
+
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/JAXB2IdentityDeployerConfiguration.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/JAXB2IdentityDeployerConfiguration.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/JAXB2IdentityDeployerConfiguration.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,82 @@
+/**
+ *
+ */
+package org.jboss.identity.idm.integration.jboss5;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.util.logging.Logger;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+
+import org.jboss.identity.idm.common.exception.IdentityConfigurationException;
+import org.jboss.identity.idm.impl.helper.SecurityActions;
+import org.jboss.identity.idm.integration.jboss5.jaxb2.JbossIDMDeployerType;
+
+/**
+ * @author Jeff Yu
+ *
+ */
+public class JAXB2IdentityDeployerConfiguration {
+
+ private static final Logger logger =
Logger.getLogger(JAXB2IdentityDeployerConfiguration.class.getName());
+
+ @SuppressWarnings({"unchecked"})
+ public static JbossIDMDeployerType createDeployerConfiguration(InputStream inputStream)
throws Exception {
+ if (inputStream == null) {
+ throw new NullPointerException("deployer configuration is null");
+ }
+
+ JAXBElement<JbossIDMDeployerType> deployerType = null;
+
+ try {
+ JAXBContext jaxbContext =
JAXBContext.newInstance("org.jboss.identity.idm.integration.jboss5.jaxb2");
+ Unmarshaller unMarshaller = jaxbContext.createUnmarshaller();
+ deployerType =
(JAXBElement<JbossIDMDeployerType>)unMarshaller.unmarshal(inputStream);
+
+ }catch (JAXBException e) {
+ logger.severe(e.getMessage());
+ throw new IdentityConfigurationException("Cannot unmarshal idm deployer
configuration: ", e);
+ }
+
+ if (deployerType != null) {
+ return deployerType.getValue();
+ }
+ return null;
+ }
+
+
+ public static JbossIDMDeployerType createDeployerConfiguration(File file) throws
Exception {
+ if (file == null)
+ {
+ throw new NullPointerException("Identity deployer file is null");
+ }
+
+ InputStream inputStream;
+ try
+ {
+ inputStream = new FileInputStream(file);
+ } catch (FileNotFoundException e)
+ {
+ throw new IllegalArgumentException("Identity deployer file
"+file.getAbsolutePath()+" does not exist");
+ }
+ return createDeployerConfiguration(inputStream);
+ }
+
+
+ public static JbossIDMDeployerType createDeployerConfiguration(String file) throws
Exception {
+ ClassLoader classLoader = SecurityActions.getContextClassLoader();
+ InputStream inputStream = classLoader.getResourceAsStream(file);
+ if (inputStream == null)
+ {
+ throw new NullPointerException("Resource "+file+" does not
exist");
+ }
+ return createDeployerConfiguration(inputStream);
+ }
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/SQLPopulator.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/SQLPopulator.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/SQLPopulator.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,120 @@
+/**
+ *
+ */
+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.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.logging.Logger;
+
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+
+/**
+ *
+ * It uses datasource to populate the sqlscript file into target database.
+ *
+ * @author Jeff Yu
+ *
+ */
+public class SQLPopulator {
+
+ private static Logger logger = Logger.getLogger(SQLPopulator.class.getName());
+
+ private String SQLScript;
+
+ private String exitSQL;
+
+ private String datasource;
+
+ public SQLPopulator(String datasource, String SQLScript, String exitSQL) {
+ this.SQLScript = SQLScript;
+ this.exitSQL = exitSQL;
+ this.datasource = datasource;
+ }
+
+ public void populateSchema() throws Exception {
+ DataSource ds = (DataSource)new InitialContext().lookup(datasource);
+ Connection conn = ds.getConnection();
+ boolean load = false;
+
+ Statement st = conn.createStatement();
+ ResultSet rs = null;
+ try
+ {
+ rs = st.executeQuery(exitSQL.trim());
+ rs.close();
+ }
+ catch (SQLException e)
+ {
+ load = true;
+ }
+ st.close();
+ if (!load)
+ {
+ logger.info(datasource + " datasource is already initialized");
+ return;
+ }
+
+ logger.info("Initializing " + datasource + " from listed sql
files");
+
+ String[] list = SQLScript.split(",");
+ for (String sql : list)
+ {
+ executeSql(sql.trim(), conn);
+ }
+ }
+
+ private void executeSql(String resource, Connection conn) throws Exception
+ {
+ URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
+ String sql = new String(readStream(url.openStream()) , "UTF-8");
+ sql = sql.replaceAll("(?m)^--([^\n]+)?$", ""); // Remove all
commented lines
+ final String[] statements ;
+ statements = sql.split(";");
+
+ for (String statement : statements)
+ {
+ if ((statement == null) || ("".equals(statement.trim()))) {
+ } else {
+ Statement sqlStatement = conn.createStatement();
+ try
+ {
+ sqlStatement.executeUpdate(statement);
+ }
+ finally
+ {
+ sqlStatement.close();
+ }
+ }
+ }
+ }
+
+
+ private byte[] readStream(InputStream stream) {
+ if(stream == null) {
+ throw new IllegalArgumentException("null 'stream' arg passed in method
call.");
+ }
+
+ ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
+ byte[] buffer = new byte[256];
+ int readCount = 0;
+
+ try {
+ while((readCount = stream.read(buffer)) != -1) {
+ outBuffer.write(buffer, 0, readCount);
+ }
+ } catch (IOException e) {
+ throw new IllegalStateException("Error reading stream.", e);
+ }
+
+ return outBuffer.toByteArray();
+ }
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/HibernateInitializerType.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/HibernateInitializerType.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/HibernateInitializerType.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,144 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-619
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.05.20 at 03:35:46 PM CST
+//
+
+
+package org.jboss.identity.idm.integration.jboss5.jaxb2;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for hibernateInitializerType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="hibernateInitializerType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="doChecking"
type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ * <element name="setupLocation"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="hibernateSessionFactoryRegistryName"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="hibernateConfigLocation"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "hibernateInitializerType", propOrder = {
+ "doChecking",
+ "setupLocation",
+ "hibernateSessionFactoryRegistryName",
+ "hibernateConfigLocation"
+})
+public class HibernateInitializerType {
+
+ protected boolean doChecking;
+ @XmlElement(required = true)
+ protected String setupLocation;
+ @XmlElement(required = true)
+ protected String hibernateSessionFactoryRegistryName;
+ @XmlElement(required = true)
+ protected String hibernateConfigLocation;
+
+ /**
+ * Gets the value of the doChecking property.
+ *
+ */
+ public boolean isDoChecking() {
+ return doChecking;
+ }
+
+ /**
+ * Sets the value of the doChecking property.
+ *
+ */
+ public void setDoChecking(boolean value) {
+ this.doChecking = value;
+ }
+
+ /**
+ * Gets the value of the setupLocation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSetupLocation() {
+ return setupLocation;
+ }
+
+ /**
+ * Sets the value of the setupLocation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSetupLocation(String value) {
+ this.setupLocation = value;
+ }
+
+ /**
+ * Gets the value of the hibernateSessionFactoryRegistryName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getHibernateSessionFactoryRegistryName() {
+ return hibernateSessionFactoryRegistryName;
+ }
+
+ /**
+ * Sets the value of the hibernateSessionFactoryRegistryName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setHibernateSessionFactoryRegistryName(String value) {
+ this.hibernateSessionFactoryRegistryName = value;
+ }
+
+ /**
+ * Gets the value of the hibernateConfigLocation property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getHibernateConfigLocation() {
+ return hibernateConfigLocation;
+ }
+
+ /**
+ * Sets the value of the hibernateConfigLocation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setHibernateConfigLocation(String value) {
+ this.hibernateConfigLocation = value;
+ }
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/InitializerType.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/InitializerType.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/InitializerType.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,125 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-619
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.05.20 at 03:35:46 PM CST
+//
+
+
+package org.jboss.identity.idm.integration.jboss5.jaxb2;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for initializerType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="initializerType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="datasource"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <choice>
+ * <element name="sqlInitializer"
type="{urn:jboss:identity:idm:deployer:v1_0_alpha}sqlInitializerType"/>
+ * <element name="hibernateInitializer"
type="{urn:jboss:identity:idm:deployer:v1_0_alpha}hibernateInitializerType"/>
+ * </choice>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "initializerType", propOrder = {
+ "datasource",
+ "sqlInitializer",
+ "hibernateInitializer"
+})
+public class InitializerType {
+
+ @XmlElement(required = true)
+ protected String datasource;
+ protected SqlInitializerType sqlInitializer;
+ protected HibernateInitializerType hibernateInitializer;
+
+ /**
+ * Gets the value of the datasource property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDatasource() {
+ return datasource;
+ }
+
+ /**
+ * Sets the value of the datasource property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDatasource(String value) {
+ this.datasource = value;
+ }
+
+ /**
+ * Gets the value of the sqlInitializer property.
+ *
+ * @return
+ * possible object is
+ * {@link SqlInitializerType }
+ *
+ */
+ public SqlInitializerType getSqlInitializer() {
+ return sqlInitializer;
+ }
+
+ /**
+ * Sets the value of the sqlInitializer property.
+ *
+ * @param value
+ * allowed object is
+ * {@link SqlInitializerType }
+ *
+ */
+ public void setSqlInitializer(SqlInitializerType value) {
+ this.sqlInitializer = value;
+ }
+
+ /**
+ * Gets the value of the hibernateInitializer property.
+ *
+ * @return
+ * possible object is
+ * {@link HibernateInitializerType }
+ *
+ */
+ public HibernateInitializerType getHibernateInitializer() {
+ return hibernateInitializer;
+ }
+
+ /**
+ * Sets the value of the hibernateInitializer property.
+ *
+ * @param value
+ * allowed object is
+ * {@link HibernateInitializerType }
+ *
+ */
+ public void setHibernateInitializer(HibernateInitializerType value) {
+ this.hibernateInitializer = value;
+ }
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/JbossIDMDeployerType.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/JbossIDMDeployerType.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/JbossIDMDeployerType.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,213 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-619
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.05.20 at 03:35:46 PM CST
+//
+
+
+package org.jboss.identity.idm.integration.jboss5.jaxb2;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for jbossIDMDeployerType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="jbossIDMDeployerType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="JNDIName"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="idmConfigFile"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="jmxObjectName"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="initializers"
type="{urn:jboss:identity:idm:deployer:v1_0_alpha}initializerType"
minOccurs="0"/>
+ * <element name="options"
type="{urn:jboss:identity:idm:deployer:v1_0_alpha}optionsType"
minOccurs="0"/>
+ * <element name="depends"
type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"
minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "jbossIDMDeployerType", propOrder = {
+ "jndiName",
+ "idmConfigFile",
+ "jmxObjectName",
+ "initializers",
+ "options",
+ "depends"
+})
+public class JbossIDMDeployerType {
+
+ @XmlElement(name = "JNDIName", required = true)
+ protected String jndiName;
+ @XmlElement(required = true)
+ protected String idmConfigFile;
+ @XmlElement(required = true)
+ protected String jmxObjectName;
+ protected InitializerType initializers;
+ protected OptionsType options;
+ protected List<String> depends;
+
+ /**
+ * Gets the value of the jndiName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getJNDIName() {
+ return jndiName;
+ }
+
+ /**
+ * Sets the value of the jndiName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setJNDIName(String value) {
+ this.jndiName = value;
+ }
+
+ /**
+ * Gets the value of the idmConfigFile property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIdmConfigFile() {
+ return idmConfigFile;
+ }
+
+ /**
+ * Sets the value of the idmConfigFile property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIdmConfigFile(String value) {
+ this.idmConfigFile = value;
+ }
+
+ /**
+ * Gets the value of the jmxObjectName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getJmxObjectName() {
+ return jmxObjectName;
+ }
+
+ /**
+ * Sets the value of the jmxObjectName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setJmxObjectName(String value) {
+ this.jmxObjectName = value;
+ }
+
+ /**
+ * Gets the value of the initializers property.
+ *
+ * @return
+ * possible object is
+ * {@link InitializerType }
+ *
+ */
+ public InitializerType getInitializers() {
+ return initializers;
+ }
+
+ /**
+ * Sets the value of the initializers property.
+ *
+ * @param value
+ * allowed object is
+ * {@link InitializerType }
+ *
+ */
+ public void setInitializers(InitializerType value) {
+ this.initializers = value;
+ }
+
+ /**
+ * Gets the value of the options property.
+ *
+ * @return
+ * possible object is
+ * {@link OptionsType }
+ *
+ */
+ public OptionsType getOptions() {
+ return options;
+ }
+
+ /**
+ * Sets the value of the options property.
+ *
+ * @param value
+ * allowed object is
+ * {@link OptionsType }
+ *
+ */
+ public void setOptions(OptionsType value) {
+ this.options = value;
+ }
+
+ /**
+ * Gets the value of the depends property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the depends
property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getDepends().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link String }
+ *
+ *
+ */
+ public List<String> getDepends() {
+ if (depends == null) {
+ depends = new ArrayList<String>();
+ }
+ return this.depends;
+ }
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/ObjectFactory.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/ObjectFactory.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/ObjectFactory.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,100 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-619
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.05.20 at 03:35:46 PM CST
+//
+
+
+package org.jboss.identity.idm.integration.jboss5.jaxb2;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.identity.idm.integration.jboss5.jaxb2 package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _JbossIdmDeployer_QNAME = new
QName("urn:jboss:identity:idm:deployer:v1_0_alpha",
"jboss-idm-deployer");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema
derived classes for package: org.jboss.identity.idm.integration.jboss5.jaxb2
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link InitializerType }
+ *
+ */
+ public InitializerType createInitializerType() {
+ return new InitializerType();
+ }
+
+ /**
+ * Create an instance of {@link OptionsType }
+ *
+ */
+ public OptionsType createOptionsType() {
+ return new OptionsType();
+ }
+
+ /**
+ * Create an instance of {@link SqlInitializerType }
+ *
+ */
+ public SqlInitializerType createSqlInitializerType() {
+ return new SqlInitializerType();
+ }
+
+ /**
+ * Create an instance of {@link HibernateInitializerType }
+ *
+ */
+ public HibernateInitializerType createHibernateInitializerType() {
+ return new HibernateInitializerType();
+ }
+
+ /**
+ * Create an instance of {@link JbossIDMDeployerType }
+ *
+ */
+ public JbossIDMDeployerType createJbossIDMDeployerType() {
+ return new JbossIDMDeployerType();
+ }
+
+ /**
+ * Create an instance of {@link OptionType }
+ *
+ */
+ public OptionType createOptionType() {
+ return new OptionType();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link JbossIDMDeployerType
}{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:jboss:identity:idm:deployer:v1_0_alpha",
name = "jboss-idm-deployer")
+ public JAXBElement<JbossIDMDeployerType>
createJbossIdmDeployer(JbossIDMDeployerType value) {
+ return new JAXBElement<JbossIDMDeployerType>(_JbossIdmDeployer_QNAME,
JbossIDMDeployerType.class, null, value);
+ }
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/OptionType.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/OptionType.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/OptionType.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,97 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-619
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.05.20 at 03:35:46 PM CST
+//
+
+
+package org.jboss.identity.idm.integration.jboss5.jaxb2;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for optionType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="optionType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="name"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="value"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "optionType", propOrder = {
+ "name",
+ "value"
+})
+public class OptionType {
+
+ @XmlElement(required = true)
+ protected String name;
+ @XmlElement(required = true)
+ protected String value;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/OptionsType.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/OptionsType.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/OptionsType.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,76 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-619
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.05.20 at 03:35:46 PM CST
+//
+
+
+package org.jboss.identity.idm.integration.jboss5.jaxb2;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for optionsType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="optionsType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="option"
type="{urn:jboss:identity:idm:deployer:v1_0_alpha}optionType"
maxOccurs="unbounded"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "optionsType", propOrder = {
+ "option"
+})
+public class OptionsType {
+
+ @XmlElement(required = true)
+ protected List<OptionType> option;
+
+ /**
+ * Gets the value of the option property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the option
property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getOption().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link OptionType }
+ *
+ *
+ */
+ public List<OptionType> getOption() {
+ if (option == null) {
+ option = new ArrayList<OptionType>();
+ }
+ return this.option;
+ }
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/SqlInitializerType.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/SqlInitializerType.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/SqlInitializerType.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,97 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-619
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.05.20 at 03:35:46 PM CST
+//
+
+
+package org.jboss.identity.idm.integration.jboss5.jaxb2;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for sqlInitializerType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="sqlInitializerType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="sqlFile"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="exitSQL"
type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sqlInitializerType", propOrder = {
+ "sqlFile",
+ "exitSQL"
+})
+public class SqlInitializerType {
+
+ @XmlElement(required = true)
+ protected String sqlFile;
+ @XmlElement(required = true)
+ protected String exitSQL;
+
+ /**
+ * Gets the value of the sqlFile property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSqlFile() {
+ return sqlFile;
+ }
+
+ /**
+ * Sets the value of the sqlFile property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSqlFile(String value) {
+ this.sqlFile = value;
+ }
+
+ /**
+ * Gets the value of the exitSQL property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getExitSQL() {
+ return exitSQL;
+ }
+
+ /**
+ * Sets the value of the exitSQL property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setExitSQL(String value) {
+ this.exitSQL = value;
+ }
+
+}
Added:
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/package-info.java
===================================================================
---
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/package-info.java
(rev 0)
+++
idm/trunk/integration/deployer/src/main/java/org/jboss/identity/idm/integration/jboss5/jaxb2/package-info.java 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,9 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-619
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.05.20 at 03:35:46 PM CST
+//
+
+(a)javax.xml.bind.annotation.XmlSchema(namespace =
"urn:jboss:identity:idm:deployer:v1_0_alpha", elementFormDefault =
javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.jboss.identity.idm.integration.jboss5.jaxb2;
Added: idm/trunk/integration/deployer/src/main/resources/META-INF/default-jboss-idm.xml
===================================================================
--- idm/trunk/integration/deployer/src/main/resources/META-INF/default-jboss-idm.xml
(rev 0)
+++
idm/trunk/integration/deployer/src/main/resources/META-INF/default-jboss-idm.xml 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-idm-deployer xmlns="urn:jboss:identity:idm:deployer:v1_0_alpha"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:identity:idm:deployer:v1_0_alpha
identity-deployer.xsd">
+ <JNDIName>java:/IdentitySessionFactory</JNDIName>
+ <idmConfigFile>jboss.idm.cfg.xml</idmConfigFile>
+</jboss-idm-deployer>
Added:
idm/trunk/integration/deployer/src/main/resources/META-INF/idm-deployer-jboss-beans.xml
===================================================================
---
idm/trunk/integration/deployer/src/main/resources/META-INF/idm-deployer-jboss-beans.xml
(rev 0)
+++
idm/trunk/integration/deployer/src/main/resources/META-INF/idm-deployer-jboss-beans.xml 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!--
+ The JBoss IDM Meta Data Deployer
+ -->
+ <bean name="org.jboss.identity.idm:service=MetaDataDeployer"
+
class="org.jboss.identity.idm.integration.jboss5.IDMConfigParsingDeployer">
+
+ <property name="suffix">-jboss-idm.xml</property>
+ <property name="allowMultipleFiles">true</property>
+ </bean>
+
+ <!--
+ The actual IDM Deployer
+ -->
+ <bean name="org.jboss.identity.idm:service=Deployer"
+
class="org.jboss.identity.idm.integration.jboss5.IDMDeployer"/>
+
+</deployment>
\ No newline at end of file
Added: idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml
===================================================================
--- idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml
(rev 0)
+++ idm/trunk/integration/deployer/src/main/resources/deployer-assembly.xml 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,34 @@
+<assembly
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+ <id></id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>true</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${project.build.outputDirectory}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>META-INF/idm-deployer-jboss-beans.xml</include>
+ <include>identity-deployer.xsd</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+
<include>org.jboss.identity.idm.integration:idm-jboss5-deployer</include>
+ <include>org.jboss.identity.idm:idm-ldap</include>
+ <include>org.jboss.identity.idm:idm-hibernate</include>
+ <include>org.jboss.identity.idm:idm-core</include>
+ <include>org.jboss.identity.idm:idm-api</include>
+ <include>org.jboss.identity.idm:idm-common</include>
+ <include>org.jboss.identity.idm:idm-spi</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+
+</assembly>
Added: idm/trunk/integration/deployer/src/main/resources/identity-deployer.xsd
===================================================================
--- idm/trunk/integration/deployer/src/main/resources/identity-deployer.xsd
(rev 0)
+++ idm/trunk/integration/deployer/src/main/resources/identity-deployer.xsd 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="urn:jboss:identity:idm:deployer:v1_0_alpha"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="jboss-idm-deployer"
type="urn:jbossIDMDeployerType"
xmlns:urn="urn:jboss:identity:idm:deployer:v1_0_alpha">
+ <xs:annotation>
+
<
xs:documentation><xs:schemaattributeFormDefault="unqualifi...
+ </xs:annotation>
+ </xs:element>
+
+ <xs:complexType name="jbossIDMDeployerType">
+ <xs:sequence>
+ <xs:element name="JNDIName" type="xs:string" />
+ <xs:element name="idmConfigFile" type="xs:string" />
+ <xs:element name="jmxObjectName" type="xs:string"/>
+ <xs:element name="initializers" minOccurs="0"
type="urn:initializerType"
xmlns:urn="urn:jboss:identity:idm:deployer:v1_0_alpha"/>
+ <xs:element name="options" minOccurs="0"
type="urn:optionsType"
xmlns:urn="urn:jboss:identity:idm:deployer:v1_0_alpha"/>
+ <xs:element name="depends" type="xs:string"
minOccurs="0" maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="initializerType">
+ <xs:sequence>
+ <xs:element name="datasource" type="xs:string" />
+ <xs:choice>
+ <xs:element name="sqlInitializer"
type="urn:sqlInitializerType"
xmlns:urn="urn:jboss:identity:idm:deployer:v1_0_alpha" />
+ <xs:element name="hibernateInitializer"
type="urn:hibernateInitializerType"
xmlns:urn="urn:jboss:identity:idm:deployer:v1_0_alpha" />
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="sqlInitializerType">
+ <xs:sequence>
+ <xs:element name="sqlFile" type="xs:string" />
+ <xs:element name="exitSQL" type="xs:string" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="hibernateInitializerType">
+ <xs:sequence>
+ <xs:element name="doChecking" type="xs:boolean" />
+ <xs:element name="setupLocation" type="xs:string" />
+ <xs:element name="hibernateSessionFactoryRegistryName"
type="xs:string" />
+ <xs:element name="hibernateConfigLocation" type="xs:string"
/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="optionsType">
+ <xs:sequence>
+ <xs:element name="option" type="urn:optionType"
xmlns:urn="urn:jboss:identity:idm:deployer:v1_0_alpha"
maxOccurs="unbounded" />
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="optionType">
+ <xs:sequence>
+ <xs:element type="xs:string" name="name"/>
+ <xs:element type="xs:string" name="value"/>
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
\ No newline at end of file
Added: idm/trunk/integration/deployer/src/main/resources/idm-assembly.xml
===================================================================
--- idm/trunk/integration/deployer/src/main/resources/idm-assembly.xml
(rev 0)
+++ idm/trunk/integration/deployer/src/main/resources/idm-assembly.xml 2009-05-21 15:58:33
UTC (rev 503)
@@ -0,0 +1,21 @@
+<assembly
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+ <id></id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>true</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${project.build.outputDirectory}</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>jboss.idm.cfg.xml</include>
+ <include>jboss.idm.hibernate.cfg.xml</include>
+ <include>jbidm-hsqldb-ds.xml</include>
+ <include>META-INF/default-jboss-idm.xml</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+</assembly>
\ No newline at end of file
Added: idm/trunk/integration/deployer/src/main/resources/jbidm-hsqldb-ds.xml
===================================================================
--- idm/trunk/integration/deployer/src/main/resources/jbidm-hsqldb-ds.xml
(rev 0)
+++ idm/trunk/integration/deployer/src/main/resources/jbidm-hsqldb-ds.xml 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+
+ <local-tx-datasource>
+ <jndi-name>jbossidmDS</jndi-name>
+
+
<connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}jbossidm</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+
+ <!-- connection pool parameters -->
+ <min-pool-size>1</min-pool-size>
+ <max-pool-size>5</max-pool-size>
+
+ <!-- disable idle connection removal, hsqldb does not reap threads on closed
connections -->
+ <idle-timeout-minutes>0</idle-timeout-minutes>
+ <!-- check all statements are closed when the connection is returned to the pool
-->
+ <track-statements />
+ <!-- hsqldb benefits from prepared statement caching -->
+ <prepared-statement-cache-size>32</prepared-statement-cache-size>
+
+ <!-- corresponding type-mapping in conf/standardjbosscmp-jdbc.xml -->
+ <metadata>
+ <type-mapping>Hypersonic SQL</type-mapping>
+ </metadata>
+
+ <!-- ensure the datasource is not initialized before the database itself -->
+ <depends>jboss:service=Hypersonic,database=jbossidm</depends>
+ </local-tx-datasource>
+
+ <mbean code="org.jboss.jdbc.HypersonicDatabase"
name="jboss:service=Hypersonic,database=jbossidm">
+ <attribute name="Database">jbossidm</attribute>
+ <attribute name="InProcessMode">true</attribute>
+ </mbean>
+
+</datasources>
\ No newline at end of file
Added: idm/trunk/integration/deployer/src/main/resources/jboss.idm.cfg.xml
===================================================================
--- idm/trunk/integration/deployer/src/main/resources/jboss.idm.cfg.xml
(rev 0)
+++ idm/trunk/integration/deployer/src/main/resources/jboss.idm.cfg.xml 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,115 @@
+<?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://JBossIdentity</id>
+ <repository-id-ref>JBoss_Identity_Repository</repository-id-ref>
+ <identity-type-mappings>
+ <user-mapping>USER</user-mapping>
+ </identity-type-mappings>
+ </realm>
+ </realms>
+ <repositories>
+ <repository>
+ <id>JBoss_Identity_Repository</id>
+
<class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <external-config/>
+
<default-identity-store-id>Identity_DB_Store</default-identity-store-id>
+
<default-attribute-store-id>Identity_DB_Store</default-attribute-store-id>
+ </repository>
+ </repositories>
+ <stores>
+ <attribute-stores/>
+ <identity-stores>
+ <identity-store>
+ <id>Identity_DB_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>GROUP</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials>
+ <credential-type>PASSWORD</credential-type>
+ </credentials>
+ <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>GROUP</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ <identity-object-type>
+ <name>GROUP</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>GROUP</identity-object-type-ref>
+ </relationship>
+ </relationships>
+ <credentials/>
+ <attributes/>
+ <options/>
+ </identity-object-type>
+ </supported-identity-object-types>
+ <options>
+ <option>
+ <name>hibernateConfiguration</name>
+ <value>jboss.idm.hibernate.cfg.xml</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>
+ </options>
+ </identity-store>
+ </identity-stores>
+ </stores>
+</jboss-identity>
Added: idm/trunk/integration/deployer/src/main/resources/jboss.idm.hibernate.cfg.xml
===================================================================
--- idm/trunk/integration/deployer/src/main/resources/jboss.idm.hibernate.cfg.xml
(rev 0)
+++
idm/trunk/integration/deployer/src/main/resources/jboss.idm.hibernate.cfg.xml 2009-05-21
15:58:33 UTC (rev 503)
@@ -0,0 +1,62 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="show_sql">false</property>
+ <property
name="cache.use_second_level_cache">true</property>
+ <property name="cache.use_query_cache">false</property>
+
+ <property
name="current_session_context_class">thread</property>
+
+ <!--<property
name="connection.datasource"></property>-->
+
+ <property
name="hibernate.connection.url">jdbc:hsqldb:mem:jbossidm</property>
+ <property
name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property
name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property
name="hibernate.hbm2ddl.auto">create-drop</property>
+ <property
name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+
+ <!-- Mapping classes -->
+ <!-- all nessesary mappings are added programatically to the configuration
-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateRealm"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"/>-->
+ <!--<mapping
class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"/>-->
+
+ </session-factory>
+</hibernate-configuration>
\ No newline at end of file