Author: bdaw
Date: 2009-05-12 05:32:57 -0400 (Tue, 12 May 2009)
New Revision: 491
Added:
idm/trunk/example/auth/
idm/trunk/example/auth/build-deploy.xml
idm/trunk/example/auth/pom.xml
idm/trunk/example/auth/src/
idm/trunk/example/auth/src/main/
idm/trunk/example/auth/src/main/java/
idm/trunk/example/auth/src/main/resources/
idm/trunk/example/auth/src/main/resources/META-INF/
idm/trunk/example/auth/src/main/resources/META-INF/idm-example-auth-jboss-beans.xml
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/context.xml
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/jboss-web.xml
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/web.xml
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/index.jsp
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/login.jsp
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/protected/
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/protected/index.jsp
idm/trunk/example/auth/src/main/resources/jboss-idm.xml
idm/trunk/example/auth/src/main/resources/jboss.idm.hibernate.cfg.xml
idm/trunk/example/auth/src/main/resources/login-config.xml
idm/trunk/example/auth/src/main/resources/setup.txt
idm/trunk/example/auth/src/test/
idm/trunk/example/auth/src/test/java/
idm/trunk/example/auth/src/test/java/org/
idm/trunk/example/auth/src/test/java/org/jboss/
idm/trunk/example/auth/src/test/java/org/jboss/identity/
idm/trunk/example/auth/src/test/java/org/jboss/identity/idm/
idm/trunk/example/auth/src/test/resources/
Modified:
idm/trunk/distro/pom.xml
idm/trunk/example/simple/pom.xml
idm/trunk/idm-api/pom.xml
idm/trunk/idm-auth/pom.xml
idm/trunk/idm-auth/src/main/java/org/jboss/identity/idm/auth/JBossIdentityIDMLoginModule.java
idm/trunk/idm-cache/pom.xml
idm/trunk/idm-common/pom.xml
idm/trunk/idm-core/pom.xml
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryExecutorImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryExecutorImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryExecutorImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/context/IdentitySessionContextImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AttributesManagerImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java
idm/trunk/idm-hibernate/pom.xml
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredential.java
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java
idm/trunk/idm-ldap/pom.xml
idm/trunk/idm-spi/pom.xml
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStoreSessionFactory.java
idm/trunk/idm-testsuite/pom.xml
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateModelTestCase.java
idm/trunk/integration/jboss5/pom.xml
idm/trunk/integration/jboss5/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMService.java
idm/trunk/integration/pom.xml
idm/trunk/parent/pom.xml
idm/trunk/pom.xml
Log:
- Improvements in IDMService and JBossIdentityIDMLoginModule
- Example for JEE authentication
- Cleanup in poms formating
Modified: idm/trunk/distro/pom.xml
===================================================================
--- idm/trunk/distro/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/distro/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -1,102 +1,102 @@
<project
xmlns="http://maven.apache.org/POM/4.0.0"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
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>
- <artifactId>idm-distro</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>jar</packaging>
- <name>JBoss Identity IDM Distro </name>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>idm-distro</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>JBoss Identity IDM Distro </name>
- <parent>
- <groupId>org.jboss.identity</groupId>
- <artifactId>idm-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <relativePath>../parent</relativePath>
- </parent>
+ <parent>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
- <properties>
- <hibernate-commons-annotations>3.0.0.ga</hibernate-commons-annotations>
- <hibernate-tools-version>3.2.0.ga</hibernate-tools-version>
- <hsqldb-version>1.8.0.7</hsqldb-version>
- <idm.version>1.0.0-SNAPSHOT</idm.version>
- <apache.ant.version>1.7.0</apache.ant.version>
- <izpack.version>4.2.1</izpack.version>
- <mysql.connector.version>5.0.8</mysql.connector.version>
- <postgresql.version>8.3-603.jdbc3</postgresql.version>
- <jtds.version>1.2.2</jtds.version>
+ <properties>
+
<hibernate-commons-annotations>3.0.0.ga</hibernate-commons-annotations>
+ <hibernate-tools-version>3.2.0.ga</hibernate-tools-version>
+ <hsqldb-version>1.8.0.7</hsqldb-version>
+ <idm.version>1.0.0-SNAPSHOT</idm.version>
+ <apache.ant.version>1.7.0</apache.ant.version>
+ <izpack.version>4.2.1</izpack.version>
+ <mysql.connector.version>5.0.8</mysql.connector.version>
+ <postgresql.version>8.3-603.jdbc3</postgresql.version>
+ <jtds.version>1.2.2</jtds.version>
- </properties>
+ </properties>
- <dependencies>
- <dependency>
- <groupId>org.jboss.identity</groupId>
- <artifactId>idm</artifactId>
- <version>${idm.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.identity.integration</groupId>
- <artifactId>idm-jboss5</artifactId>
- <version>${idm.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.identity.integration</groupId>
- <artifactId>idm-jboss5</artifactId>
- <classifier>config</classifier>
- <type>zip</type>
- <version>${idm.version}</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-commons-annotations</artifactId>
- <version>${hibernate-commons-annotations}</version>
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>idm</artifactId>
+ <version>${idm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity.integration</groupId>
+ <artifactId>idm-jboss5</artifactId>
+ <version>${idm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity.integration</groupId>
+ <artifactId>idm-jboss5</artifactId>
+ <classifier>config</classifier>
+ <type>zip</type>
+ <version>${idm.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-commons-annotations</artifactId>
+ <version>${hibernate-commons-annotations}</version>
+ </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-tools</artifactId>
- <version>${hibernate-tools-version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-tools</artifactId>
+ <version>${hibernate-tools-version}</version>
+ </dependency>
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>${hsqldb-version}</version>
- </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>${hsqldb-version}</version>
+ </dependency>
- <dependency>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant</artifactId>
- <version>${apache.ant.version}</version>
- </dependency>
- <dependency>
- <groupId>izpack</groupId>
- <artifactId>standalone-compiler</artifactId>
- <version>${izpack.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>${apache.ant.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>izpack</groupId>
+ <artifactId>standalone-compiler</artifactId>
+ <version>${izpack.version}</version>
+ </dependency>
- <!-- Database Drivers -->
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>${mysql.connector.version}</version>
- </dependency>
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>${postgresql.version}</version>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.jtds</groupId>
- <artifactId>jtds</artifactId>
- <version>${jtds.version}</version>
- </dependency>
+ <!-- Database Drivers -->
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>${mysql.connector.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>${postgresql.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.jtds</groupId>
+ <artifactId>jtds</artifactId>
+ <version>${jtds.version}</version>
+ </dependency>
- </dependencies>
+ </dependencies>
- <build>
- <finalName>jboss-identity</finalName>
- <plugins>
- <!-- plugin>
+ <build>
+ <finalName>jboss-identity</finalName>
+ <plugins>
+ <!-- plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
@@ -119,60 +119,60 @@
</execution>
</executions>
</plugin-->
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-2</version>
- <executions>
- <execution>
- <id>prepare-files-for-installer</id>
- <phase>process-resources</phase>
- <goals>
- <goal>directory-single</goal>
- </goals>
- <configuration>
- <finalName>deploy-artifacts</finalName>
- <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors>
-
<descriptor>scripts/assembly-deploy-artifacts.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-2</version>
+ <executions>
+ <execution>
+ <id>prepare-files-for-installer</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>directory-single</goal>
+ </goals>
+ <configuration>
+ <finalName>deploy-artifacts</finalName>
+
<ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+
<descriptor>scripts/assembly-deploy-artifacts.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>izpack</id>
- <phase>package</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <property name="maven.test.classpath"
refid="maven.test.classpath" />
- <property name="maven.runtime.classpath"
refid="maven.runtime.classpath" />
- <property name="maven.compile.classpath"
refid="maven.compile.classpath" />
- <property name="database" value="${database}"
/>
- <property name="jboss.home" value="${jboss.home}"
/>
- <property name="jboss500.home"
value="${jboss500.home}" />
- <property name="jbpm.target.container"
value="${jbpm.target.container}" />
- <property name="product.name"
value="${project.name}" />
- <property name="product.short.name"
value="${artifactId}" />
- <property name="product.version"
value="${project.version}" />
- <property name="user.home" value="${user.home}"
/>
- <property name="user.dir" value="${user.dir}"
/>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>izpack</id>
+ <phase>package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="maven.test.classpath"
refid="maven.test.classpath" />
+ <property name="maven.runtime.classpath"
refid="maven.runtime.classpath" />
+ <property name="maven.compile.classpath"
refid="maven.compile.classpath" />
+ <property name="database"
value="${database}" />
+ <property name="jboss.home"
value="${jboss.home}" />
+ <property name="jboss500.home"
value="${jboss500.home}" />
+ <property name="jbpm.target.container"
value="${jbpm.target.container}" />
+ <property name="product.name"
value="${project.name}" />
+ <property name="product.short.name"
value="${artifactId}" />
+ <property name="product.version"
value="${project.version}" />
+ <property name="user.home"
value="${user.home}" />
+ <property name="user.dir"
value="${user.dir}" />
- <ant antfile="scripts/antrun-installer.xml"
target="build-installer" inheritRefs="true"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
+ <ant antfile="scripts/antrun-installer.xml"
target="build-installer" inheritRefs="true"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Added: idm/trunk/example/auth/build-deploy.xml
===================================================================
--- idm/trunk/example/auth/build-deploy.xml (rev 0)
+++ idm/trunk/example/auth/build-deploy.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<project name="deploy">
+
+ <target name="deploy">
+
+ <condition property="DEPLOY" value="${env.DEPLOY}">
+ <and>
+ <isset property="env.DEPLOY"/>
+ <not>
+ <isset property="DEPLOY"/>
+ </not>
+ </and>
+ </condition>
+
+ <antcall target="_deploy"/>
+
+ </target>
+
+ <target name="_deploy" if="DEPLOY"
depends="evaluate_properties">
+
+
+ <fail message="Please set the environment variable JBOSS_HOME">
+ <condition>
+ <and>
+ <not>
+ <isset property="JBOSS_HOME"/>
+ </not>
+ </and>
+ </condition>
+ </fail>
+
+ <property name="toDir"
value="${JBOSS_HOME}/server/default/deploy/"/>
+
+ <echo message="Copy artifact: ${artifact.to.copy} to ${toDir}"/>
+
+ <mkdir dir="${toDir}"/>
+
+ <copy todir="${toDir}" flatten="true"
+ file="${artifact.to.copy}" />
+ <!--<copy todir="${toDir}/${toArtifact}">-->
+ <!--<fileset dir="${artifact.to.copy}"/>-->
+ <!--</copy>-->
+
+ </target>
+
+
+
+
+
+
+
+ <target name="evaluate_properties">
+
+ <property environment="env"/>
+
+ <!--If properties are not in command line check if they are set in env-->
+ <condition property="JBOSS_HOME"
value="${env.JBOSS_HOME}">
+ <and>
+ <isset property="env.JBOSS_HOME"/>
+ <not>
+ <isset property="JBOSS_HOME"/>
+ </not>
+ </and>
+ </condition>
+
+ </target>
+
+
+
+</project>
\ No newline at end of file
Added: idm/trunk/example/auth/pom.xml
===================================================================
--- idm/trunk/example/auth/pom.xml (rev 0)
+++ idm/trunk/example/auth/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -0,0 +1,161 @@
+<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>
+ <groupId>org.jboss.identity.idm.example</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <artifactId>example-auth</artifactId>
+ <packaging>jar</packaging>
+ <name>Example - JEE authentication</name>
+ <
url>http://labs.jboss.org/portal/jbosssecurity/</url>
+ <description>Example maven2 project using JBoss Identity IDM
component.</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <
url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <
url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <layout>default</layout>
+ <
url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.identity.idm.integration</groupId>
+ <artifactId>idm-jboss5</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-auth</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-hibernate</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <!--<version>2.4.3</version>-->
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <target>1.5</target>
+ <source>1.5</source>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+
<outputDirectory>${project.build.directory}/classes/</outputDirectory>
+ <overWriteReleases>true</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
+ <artifactId>maven-antrun-extended-plugin</artifactId>
+ <version>1.13</version>
+ <dependencies/>
+ <executions>
+ <execution>
+ <id>install</id>
+ <phase>install</phase>
+ <configuration>
+ <tasks>
+
+ <!-- Exploded -->
+ <copy
todir="${basedir}/target/idm-example-auth-exploded.sar">
+ <fileset dir="${basedir}/target/classes"/>
+ </copy>
+
+
+
+ <!-- Packed -->
+
+ <jar
destfile="${basedir}/target/idm-example-auth.war"
+
basedir="${basedir}/target/classes/idm-example-auth.war"
+ />
+
+ <jar
destfile="${basedir}/target/idm-example-auth.sar">
+ <fileset dir="${basedir}/target/classes/"
+ excludes="idm-example-auth.war/**"/>
+ <fileset dir="${basedir}/target/"
+ includes="idm-example-auth.war"/>
+ </jar>
+
+ <!--<property name="artifact.to.copy"-->
+
<!--value="${basedir}/target/idm-example-auth-exploded.sar"/>-->
+ <!--<property name="toArtifact"-->
+
<!--value="idm-example-auth.sar-exploded"/>-->
+
+ <property name="artifact.to.copy"
+
value="${basedir}/target/idm-example-auth.sar"/>
+
+
+ <ant antfile="${basedir}/build-deploy.xml">
+ <target name="deploy"/>
+ </ant>
+
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added:
idm/trunk/example/auth/src/main/resources/META-INF/idm-example-auth-jboss-beans.xml
===================================================================
--- idm/trunk/example/auth/src/main/resources/META-INF/idm-example-auth-jboss-beans.xml
(rev 0)
+++
idm/trunk/example/auth/src/main/resources/META-INF/idm-example-auth-jboss-beans.xml 2009-05-12
09:32:57 UTC (rev 491)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!--
+ IDM Service
+ -->
+ <bean name="idm.example.auth.IDMService"
+ class="org.jboss.identity.idm.integration.jboss5.IDMService">
+ <constructor>
+ <parameter>jboss-idm.xml</parameter>
+ </constructor>
+ <property name="doChecking">true</property>
+ <property name="setupLocation">setup.txt</property>
+ <property
name="idmSessionFactoryJNDI">java:/IdentitySessionFactory</property>
+ <property
name="hibernateSessionFactoryRegistryName">hibernateSessionFactory</property>
+ <property
name="hibernateConfigLocation">jboss.idm.hibernate.cfg.xml</property>
+
+
+ <depends>TransactionManager</depends>
+ </bean>
+
+ <application-policy xmlns="urn:jboss:security-beans:1.0"
name="ExampleJBossIdentityIDMSecurityRealm">
+ <authentication>
+ <login-module code =
"org.jboss.identity.idm.auth.JBossIdentityIDMLoginModule"
+ flag = "required">
+ <module-option
name="identitySessionFactoryJNDIName">java:/IdentitySessionFactory</module-option>
+ <module-option
name="realmName">realm://JBossIdentity</module-option>
+ <module-option
name="roleGroupTypeName">GROUP</module-option>
+ <module-option
name="additionalRole">Authenticated</module-option>
+ <module-option
name="transactionAware">true</module-option>
+ <!--<module-option
name="userEnabledAttributeName"></module-option>-->
+ <!--<module-option
name="associatedGroupType"></module-option>-->
+ <!--<module-option
name="associatedGroupName"></module-option>-->
+ <!--<module-option
name="validateUserNameCase"></module-option>-->
+ <!--<module-option
name="userNameToLowerCase"></module-option>-->
+ </login-module>
+ </authentication>
+ </application-policy>
+
+
+
+</deployment>
\ No newline at end of file
Added: idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/context.xml
===================================================================
--- idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/context.xml
(rev 0)
+++
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/context.xml 2009-05-12
09:32:57 UTC (rev 491)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<Context>
+
+</Context>
\ No newline at end of file
Added:
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/jboss-web.xml
===================================================================
--- idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/jboss-web.xml
(rev 0)
+++
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/jboss-web.xml 2009-05-12
09:32:57 UTC (rev 491)
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 5.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
+<jboss-web>
+ <security-domain>ExampleJBossIdentityIDMSecurityRealm</security-domain>
+ <context-root>idm-example-auth</context-root>
+</jboss-web>
\ No newline at end of file
Added: idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/web.xml
===================================================================
--- idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/web.xml
(rev 0)
+++
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/WEB-INF/web.xml 2009-05-12
09:32:57 UTC (rev 491)
@@ -0,0 +1,29 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd" >
+
+<web-app>
+ <display-name>Simple Secured Application</display-name>
+
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Authenticated</web-resource-name>
+ <url-pattern>/protected/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>Authenticated</role-name>
+ </auth-constraint>
+ </security-constraint>
+ <login-config>
+ <auth-method>FORM</auth-method>
+ <form-login-config>
+ <form-login-page>/login.jsp</form-login-page>
+ <form-error-page>/login.jsp</form-error-page>
+ </form-login-config>
+ </login-config>
+ <security-role>
+ <role-name>Authenticated</role-name>
+ </security-role>
+
+</web-app>
Added: idm/trunk/example/auth/src/main/resources/idm-example-auth.war/index.jsp
===================================================================
--- idm/trunk/example/auth/src/main/resources/idm-example-auth.war/index.jsp
(rev 0)
+++ idm/trunk/example/auth/src/main/resources/idm-example-auth.war/index.jsp 2009-05-12
09:32:57 UTC (rev 491)
@@ -0,0 +1,31 @@
+<%@ page import="java.security.Principal" %>
+<html>
+<body>
+<h2>Hello World!</h2>
+<p>
+ Try to login with default users: user/user or admin/admin
+</p>
+<a href="./protected/">protected content</a>
+
+<%
+ String logout = request.getParameter("logout");
+ if (logout != null && logout.equals("true"))
+ {
+ request.getSession().invalidate();
+ }
+%>
+</br>
+<%
+ Principal principal = request.getUserPrincipal();
+ if (principal != null)
+ {
+%>
+Logged in user:
+<%
+ out.println(principal.getName());
+ }
+%>
+</br>
+<a href="./index.jsp?logout=true">Logout!</a>
+</body>
+</html>
Added: idm/trunk/example/auth/src/main/resources/idm-example-auth.war/login.jsp
===================================================================
--- idm/trunk/example/auth/src/main/resources/idm-example-auth.war/login.jsp
(rev 0)
+++ idm/trunk/example/auth/src/main/resources/idm-example-auth.war/login.jsp 2009-05-12
09:32:57 UTC (rev 491)
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="http://www.facebook.com/2008/fbml">
+<META HTTP-EQUIV = "Pragma" CONTENT="no-cache">
+<title>Security Login Page </title>
+<body>
+<h2>Form Login</h2>
+<FORM METHOD=POST ACTION="j_security_check">
+<p>
+<strong> Enter user ID and password: </strong>
+<BR>
+<strong> User ID</strong> <input type="text" size="20"
name="j_username">
+<strong> Password </strong> <input type="password"
size="20" name="j_password">
+<BR>
+<BR>
+<strong> And then click this button: </strong>
+<input type="submit" name="login" value="Login">
+</p>
+
+</form>
+</body>
+</html>
\ No newline at end of file
Added: idm/trunk/example/auth/src/main/resources/idm-example-auth.war/protected/index.jsp
===================================================================
--- idm/trunk/example/auth/src/main/resources/idm-example-auth.war/protected/index.jsp
(rev 0)
+++
idm/trunk/example/auth/src/main/resources/idm-example-auth.war/protected/index.jsp 2009-05-12
09:32:57 UTC (rev 491)
@@ -0,0 +1,58 @@
+<%@ page import="java.security.Principal" %>
+<%@ page import="javax.naming.Context" %>
+<%@ page import="javax.naming.InitialContext" %>
+<%@ page import="org.jboss.identity.idm.api.IdentitySessionFactory" %>
+<%@ page import="javax.naming.NamingException" %>
+<%@ page import="org.jboss.identity.idm.api.Group" %>
+<%@ page import="java.util.Collection" %>
+<%@ page import="org.jboss.identity.idm.api.IdentitySession" %>
+<%@ page language="java" contentType="text/html; charset=utf-8"
+ pageEncoding="utf-8"%>
+<%@ page import="java.security.Principal" %>
+<html>
+<body>
+<h2>Protected page!</h2>
+</br>
+Secured content. Logged in user:
+<%
+ Principal principal = request.getUserPrincipal();
+ if (principal != null)
+ {
+ out.println(principal.getName());
+ }
+%>
+
+</br>
+</br>
+<%
+ Context ctx = new InitialContext();
+ try
+ {
+ IdentitySessionFactory ids =
(IdentitySessionFactory)ctx.lookup("java:/IdentitySessionFactory");
+ IdentitySession is =
ids.getCurrentIdentitySession("realm://JBossIdentity");
+ is.beginTransaction();
+
+ Collection<Group> groups =
is.getRelationshipManager().findAssociatedGroups(principal.getName(), "GROUP",
null);
+
+ out.println("Groups associated with user: ");
+
+ for (Group group : groups)
+ {
+ out.println(group.getName());
+ }
+
+
+ }
+ catch (NamingException e)
+ {
+ out.println("Failed to obtain IdentitySessionFactory: ");
+ e.printStackTrace();
+ }
+
+%>
+
+</br>
+</br>
+<a href="../index.jsp?logout=true">Logout!</a>
+</body>
+</html>
\ No newline at end of file
Added: idm/trunk/example/auth/src/main/resources/jboss-idm.xml
===================================================================
--- idm/trunk/example/auth/src/main/resources/jboss-idm.xml (rev
0)
+++ idm/trunk/example/auth/src/main/resources/jboss-idm.xml 2009-05-12 09:32:57 UTC (rev
491)
@@ -0,0 +1,119 @@
+<?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>hibernateSessionFactoryRegistryName</name>
+ <value>hibernateSessionFactory</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/example/auth/src/main/resources/jboss.idm.hibernate.cfg.xml
===================================================================
--- idm/trunk/example/auth/src/main/resources/jboss.idm.hibernate.cfg.xml
(rev 0)
+++ idm/trunk/example/auth/src/main/resources/jboss.idm.hibernate.cfg.xml 2009-05-12
09:32:57 UTC (rev 491)
@@ -0,0 +1,79 @@
+<?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="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.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+
+
+ <!--<property
name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbid</property>-->
+ <!--<property
name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>-->
+ <!--<property
name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>-->
+ <!--<property
name="hibernate.connection.username">root</property>-->
+ <!--<property
name="hibernate.connection.password"></property>-->
+
+ <!--<property
name="transaction.auto_close_session">true</property>-->
+ <!--<property
name="transaction.flush_before_completion">true</property>-->
+ <!--<property
name="hibernate.transaction.flush_before_completion">true</property>-->
+ <!--<property
name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>-->
+ <!--<property
name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>-->
+
+ <!--<property
name="hibernate.hbm2ddl.auto">create-drop</property>-->
+
+ <!--<property
name="connection.datasource"></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
Added: idm/trunk/example/auth/src/main/resources/login-config.xml
===================================================================
--- idm/trunk/example/auth/src/main/resources/login-config.xml
(rev 0)
+++ idm/trunk/example/auth/src/main/resources/login-config.xml 2009-05-12 09:32:57 UTC
(rev 491)
@@ -0,0 +1,23 @@
+<?xml version='1.0'?>
+<!DOCTYPE policy PUBLIC
+ "-//JBoss//DTD JBOSS Security Config 3.0//EN"
+ "http://www.jboss.org/j2ee/dtd/security_config.dtd">
+
+<!--<policy>-->
+ <!--<application-policy name =
"java:/jaas/ExampleJBossIdentityIDMSecurityRealm">-->
+ <!--<authentication>-->
+ <!--<login-module code =
"org.jboss.identity.idm.auth.xxxJBossIdentityIDMLoginModule"-->
+ <!--flag = "required">-->
+ <!--<module-option
name="identitySessionFactoryJNDIName">java:/IdentitySessionFactory</module-option>-->
+ <!--<module-option
name="realmName">realm://JBossIdentity</module-option>-->
+ <!--<module-option
name="roleGroupTypeName">GROUP</module-option>-->
+ <!--<module-option
name="additionalRole">Authenticated</module-option>-->
+ <!--<module-option
name="userEnabledAttributeName"></module-option>-->
+ <!--<module-option
name="associatedGroupType"></module-option>-->
+ <!--<module-option
name="associatedGroupName"></module-option>-->
+ <!--<module-option
name="validateUserNameCase"></module-option>-->
+ <!--<module-option
name="userNameToLowerCase"></module-option>-->
+ <!--</login-module>-->
+ <!--</authentication>-->
+ <!--</application-policy>-->
+<!--</policy>-->
Added: idm/trunk/example/auth/src/main/resources/setup.txt
===================================================================
--- idm/trunk/example/auth/src/main/resources/setup.txt (rev 0)
+++ idm/trunk/example/auth/src/main/resources/setup.txt 2009-05-12 09:32:57 UTC (rev 491)
@@ -0,0 +1,95 @@
+import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship;
+import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateRealm;
+import org.jboss.identity.idm.impl.api.PasswordCredential;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.common.util.Tools;
+
+
+try
+{
+ session = SessionFactory.openSession();
+ tx = session.beginTransaction();
+
+ HibernateRealm realm = new HibernateRealm("realm://JBossIdentity");
+ session.save(realm);
+
+ HibernateIdentityObjectType typeUser = new
HibernateIdentityObjectType("USER");
+ HibernateIdentityObjectType typeGroup = new
HibernateIdentityObjectType("GROUP");
+
+ session.save(typeUser);
+ session.save(typeGroup);
+
+ HibernateIdentityObject userUserObject = new HibernateIdentityObject("user",
typeUser, realm);
+ HibernateIdentityObject userGroupObject = new
HibernateIdentityObject("User", typeGroup, realm);
+ HibernateIdentityObject adminUserObject = new
HibernateIdentityObject("admin", typeUser, realm);
+ HibernateIdentityObject adminGroupObject = new
HibernateIdentityObject("Admin", typeGroup, realm);
+
+ session.save(userUserObject);
+ session.save(userGroupObject);
+ session.save(adminUserObject);
+ session.save(adminGroupObject);
+
+ HibernateIdentityObjectCredentialType passwordType = new
HibernateIdentityObjectCredentialType("PASSWORD");
+
+ session.save(passwordType);
+
+ HibernateIdentityObjectCredential pass1 = new HibernateIdentityObjectCredential();
+ PasswordCredential passwordValue = new PasswordCredential("user");
+ pass1.setType(passwordType);
+ pass1.setTextValue(passwordValue.getEncodedValue().toString());
+ userUserObject.addCredential(pass1);
+
+ session.save(pass1);
+
+ HibernateIdentityObjectCredential pass2 = new HibernateIdentityObjectCredential();
+ passwordValue = new PasswordCredential("admin");
+ pass2.setType(passwordType);
+ pass2.setTextValue(passwordValue.getEncodedValue().toString());
+ adminUserObject.addCredential(pass2);
+
+
+ session.save(pass2);
+
+ HibernateIdentityObjectRelationshipType membership = new
HibernateIdentityObjectRelationshipType("JBOSS_IDENTITY_MEMBERSHIP");
+
+ session.save(membership);
+
+ HibernateIdentityObjectRelationship rel1 = new
HibernateIdentityObjectRelationship(membership, adminGroupObject, adminUserObject);
+ HibernateIdentityObjectRelationship rel2 = new
HibernateIdentityObjectRelationship(membership, userGroupObject, adminUserObject);
+ HibernateIdentityObjectRelationship rel3 = new
HibernateIdentityObjectRelationship(membership, userGroupObject, userUserObject);
+
+ session.save(rel1);
+ session.save(rel2);
+ session.save(rel3);
+
+ session.flush();
+
+ tx.commit();
+}
+finally
+{
+ IOTools.safeClose(session);
+}
+
+
+//IdentitySession identitySession =
identitySessionFactory.getCurrentIdentitySession("realm://JBossIdentity");
+//identitySession.beginTransaction();
+//
+//User user = identitySession.getPersistenceManager().createUser("user");
+//User admin = identitySession.getPersistenceManager().createUser("admin");
+//
+//identitySession.getAttributesManager().updatePassword(user, "user");
+//identitySession.getAttributesManager().updatePassword(admin, "admin");
+//
+//Group userGroup = identitySession.getPersistenceManager().createGroup("User",
"GROUP");
+//Group adminGroup =
identitySession.getPersistenceManager().createGroup("Admin",
"GROUP");
+//
+//identitySession.getRelationshipManager().associateUser(adminGroup, admin);
+//identitySession.getRelationshipManager().associateUser(userGroup, admin);
+//identitySession.getRelationshipManager().associateUser(userGroup, user);
+//identitySession.getTransaction().commit();
\ No newline at end of file
Modified: idm/trunk/example/simple/pom.xml
===================================================================
--- idm/trunk/example/simple/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/example/simple/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -1,118 +1,118 @@
<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>
- <groupId>org.jboss.identity.idm.example</groupId>
- <version>1.0.0-SNAPSHOT</version>
- <artifactId>example-simple</artifactId>
- <packaging>jar</packaging>
- <name>Simple JBoss Identity IDM Maven2 example project</name>
- <
url>http://labs.jboss.org/portal/jbosssecurity/</url>
- <description>Example maven2 project using JBoss Identity IDM
component.</description>
- <licenses>
- <license>
- <name>lgpl</name>
- <
url>http://repository.jboss.com/licenses/lgpl.txt</url>
- </license>
- </licenses>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.identity.idm.example</groupId>
+ <version>1.0.0-SNAPSHOT</version>
+ <artifactId>example-simple</artifactId>
+ <packaging>jar</packaging>
+ <name>Example - Simple JBoss Identity IDM Maven2 project</name>
+ <
url>http://labs.jboss.org/portal/jbosssecurity/</url>
+ <description>Example maven2 project using JBoss Identity IDM
component.</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <
url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <
url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <
url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshots Repository</name>
- <layout>default</layout>
- <
url>http://snapshots.jboss.org/maven2/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </repository>
- </repositories>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <layout>default</layout>
+ <
url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
- <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>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>1.8.0.7</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>sun-opends</groupId>
- <artifactId>OpenDS</artifactId>
- <version>1.0.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>berkeleydb</groupId>
- <artifactId>je</artifactId>
- <version>3.2.76</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <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>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>sun-opends</groupId>
+ <artifactId>OpenDS</artifactId>
+ <version>1.0.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>berkeleydb</groupId>
+ <artifactId>je</artifactId>
+ <version>3.2.76</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <target>1.5</target>
- <source>1.5</source>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <printSummary>true</printSummary>
- <disableXmlReport>false</disableXmlReport>
- <testFailureIgnore>false</testFailureIgnore>
- <includes>
- <include>**/*TestCase.java</include>
- </includes>
- <forkMode>pertest</forkMode>
- <argLine>${surefire.jvm.args}</argLine>
- <useFile>false</useFile>
- <trimStackTrace>false</trimStackTrace>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <target>1.5</target>
+ <source>1.5</source>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <printSummary>true</printSummary>
+ <disableXmlReport>false</disableXmlReport>
+ <testFailureIgnore>false</testFailureIgnore>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ <forkMode>pertest</forkMode>
+ <argLine>${surefire.jvm.args}</argLine>
+ <useFile>false</useFile>
+ <trimStackTrace>false</trimStackTrace>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: idm/trunk/idm-api/pom.xml
===================================================================
--- idm/trunk/idm-api/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/idm-api/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -40,32 +40,32 @@
</dependencies>
<reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <doclet>org.jboss.apiviz.APIviz</doclet>
- <docletArtifact>
- <groupId>org.jboss.apiviz</groupId>
- <artifactId>apiviz</artifactId>
- <version>1.2.5.GA</version>
- </docletArtifact>
- <additionalparam>
- -charset UTF-8
- -docencoding UTF-8
- -version
- -author
- -breakiterator
- -windowtitle "${project.name} ${project.version} API Reference"
- -doctitle "${project.name} ${project.version} API Reference"
- -bottom "Copyright © ${project.inceptionYear}-Present
${project.organization.name}. All Rights Reserved."
- -link
http://java.sun.com/javase/6/docs/api/
- -sourceclasspath ${project.build.outputDirectory}
- </additionalparam>
- <encoding>UTF-8</encoding>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <doclet>org.jboss.apiviz.APIviz</doclet>
+ <docletArtifact>
+ <groupId>org.jboss.apiviz</groupId>
+ <artifactId>apiviz</artifactId>
+ <version>1.2.5.GA</version>
+ </docletArtifact>
+ <additionalparam>
+ -charset UTF-8
+ -docencoding UTF-8
+ -version
+ -author
+ -breakiterator
+ -windowtitle "${project.name} ${project.version} API
Reference"
+ -doctitle "${project.name} ${project.version} API Reference"
+ -bottom "Copyright © ${project.inceptionYear}-Present
${project.organization.name}. All Rights Reserved."
+ -link
http://java.sun.com/javase/6/docs/api/
+ -sourceclasspath ${project.build.outputDirectory}
+ </additionalparam>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
Modified: idm/trunk/idm-auth/pom.xml
===================================================================
--- idm/trunk/idm-auth/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/idm-auth/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -1,4 +1,4 @@
- <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">
+<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">
<parent>
<groupId>org.jboss.identity.idm</groupId>
<artifactId>idm-parent</artifactId>
@@ -43,25 +43,25 @@
<version>1.0</version>
<scope>provided</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.security</groupId>
- <artifactId>jbosssx</artifactId>
- <version>2.0.2.GA</version>
- <scope>provided</scope>
- </dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>provided</scope>
</dependency>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
@@ -69,32 +69,32 @@
</dependencies>
<reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <doclet>org.jboss.apiviz.APIviz</doclet>
- <docletArtifact>
- <groupId>org.jboss.apiviz</groupId>
- <artifactId>apiviz</artifactId>
- <version>1.2.5.GA</version>
- </docletArtifact>
- <additionalparam>
- -charset UTF-8
- -docencoding UTF-8
- -version
- -author
- -breakiterator
- -windowtitle "${project.name} ${project.version} API Reference"
- -doctitle "${project.name} ${project.version} API Reference"
- -bottom "Copyright © ${project.inceptionYear}-Present
${project.organization.name}. All Rights Reserved."
- -link
http://java.sun.com/javase/6/docs/api/
- -sourceclasspath ${project.build.outputDirectory}
- </additionalparam>
- <encoding>UTF-8</encoding>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <doclet>org.jboss.apiviz.APIviz</doclet>
+ <docletArtifact>
+ <groupId>org.jboss.apiviz</groupId>
+ <artifactId>apiviz</artifactId>
+ <version>1.2.5.GA</version>
+ </docletArtifact>
+ <additionalparam>
+ -charset UTF-8
+ -docencoding UTF-8
+ -version
+ -author
+ -breakiterator
+ -windowtitle "${project.name} ${project.version} API
Reference"
+ -doctitle "${project.name} ${project.version} API Reference"
+ -bottom "Copyright © ${project.inceptionYear}-Present
${project.organization.name}. All Rights Reserved."
+ -link
http://java.sun.com/javase/6/docs/api/
+ -sourceclasspath ${project.build.outputDirectory}
+ </additionalparam>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
Modified:
idm/trunk/idm-auth/src/main/java/org/jboss/identity/idm/auth/JBossIdentityIDMLoginModule.java
===================================================================
---
idm/trunk/idm-auth/src/main/java/org/jboss/identity/idm/auth/JBossIdentityIDMLoginModule.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-auth/src/main/java/org/jboss/identity/idm/auth/JBossIdentityIDMLoginModule.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -30,6 +30,7 @@
import org.jboss.identity.idm.common.transaction.Transactions;
import org.jboss.identity.idm.common.transaction.TransactionManagerProvider;
import org.jboss.identity.idm.common.exception.NoSuchUserException;
+import org.apache.log4j.Logger;
import javax.security.auth.Subject;
import javax.security.auth.login.LoginException;
@@ -40,11 +41,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.transaction.TransactionManager;
import java.util.Map;
-import java.util.Set;
-import java.util.Iterator;
import java.util.Collection;
-import java.util.logging.Logger;
-import java.util.logging.Level;
import java.security.acl.Group;
import java.security.Principal;
@@ -76,6 +73,8 @@
protected String userNameToLowerCase;
+ protected String manageTransaction;
+
private IdentitySessionFactory identitySessionFactory;
public void initialize(Subject subject, CallbackHandler callbackHandler, Map
sharedState, Map options)
@@ -92,17 +91,19 @@
associatedGroupName = (String) options.get("associatedGroupName");
validateUserNameCase = (String) options.get("validateUserNameCase");
userNameToLowerCase = (String) options.get("userNameToLowerCase");
+ manageTransaction = (String) options.get("transactionAware");
// Some info
- if (log.isLoggable(Level.FINEST))
- log.finest("identitySessionFactoryJNDIName = " +
identitySessionFactoryJNDIName);
- log.finest("realmName = " + realmName);
- log.finest("groupTypeName = " + roleGroupTypeName);
- log.finest("userEnabledAttributeName = " + userEnabledAttributeName);
- log.finest("additionalRole = " + additionalRole);
- log.finest("havingRole = " + associatedGroupName);
- log.finest("validateUserNameCase = " + validateUserNameCase);
- log.finest("userNameToLowerCase = " + userNameToLowerCase);
+ if (log.isDebugEnabled())
+ log.debug("identitySessionFactoryJNDIName = " +
identitySessionFactoryJNDIName);
+ log.debug("realmName = " + realmName);
+ log.debug("groupTypeName = " + roleGroupTypeName);
+ log.debug("userEnabledAttributeName = " + userEnabledAttributeName);
+ log.debug("additionalRole = " + additionalRole);
+ log.debug("havingRole = " + associatedGroupName);
+ log.debug("validateUserNameCase = " + validateUserNameCase);
+ log.debug("userNameToLowerCase = " + userNameToLowerCase);
+ log.debug("transactionAware = " + manageTransaction);
}
protected String getUsersPassword() throws LoginException
@@ -165,17 +166,17 @@
}
else
{
- log.fine("Unexpected error while logging in");
+ log.info("Unexpected error while logging in");
return false;
} }
catch (Exception e)
{
- log.fine("Error when validating password: " + e);
+ log.info("Error when validating password: ",e);
}
}
catch (Exception e)
{
- log.finer("Failed to validate password: " + e);
+ log.info("Failed to validate password: ", e);
}
}
return false;
@@ -183,149 +184,199 @@
protected UserStatus getUserStatus(final String inputPassword)
{
- UserStatus result = UserStatus.OK;
+ UserStatus result = null;
- try {
- TransactionManager tm =
TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager();
- UserStatus tmp = (UserStatus)Transactions.required(tm, new
Transactions.Runnable()
- {
- public Object run() throws Exception
+ try {
+ TransactionManager tm =
TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager();
+ UserStatus tmp = (UserStatus)Transactions.required(tm, new
Transactions.Runnable()
{
- try
+ public Object run() throws Exception
{
IdentitySession ids =
getIdentitySessionFactory().getCurrentIdentitySession(realmName);
+ ids.beginTransaction();
- User user = ids.getPersistenceManager().findUser(getUsername());
-
- // in case module implementation doesn't throw proper
- // exception...
- if (user == null)
+ if (manageTransaction != null &&
manageTransaction.equals("true"))
{
- throw new NoSuchUserException("UserModule returned null user
object");
+ ids.beginTransaction();
}
- //This is because LDAP binds can be non case sensitive
- if (validateUserNameCase != null &&
validateUserNameCase.equalsIgnoreCase("true")
- && !getUsername().equals(user.getId()))
+ UserStatus status = _getUserStatus(inputPassword);
+
+ if (manageTransaction != null &&
manageTransaction.equals("true"))
{
- return UserStatus.UNEXISTING;
+ ids.getTransaction().commit();
}
- //Enabled
- if (userEnabledAttributeName != null)
- {
+ return status;
+ }
+ });
+ if (tmp != null)
+ {
+ result = tmp;
+ }
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ return result;
- boolean enabled = false;
- try {
- Object enabledS;
- enabledS = ids.getAttributesManager().getAttribute(user,
userEnabledAttributeName);
- if (enabledS != null) {
- enabled = new Boolean(enabledS.toString());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- if (!enabled) {
- return UserStatus.DISABLE;
- }
- }
- if (associatedGroupName != null && associatedGroupType !=
null)
- {
- boolean hasTheGroup = false;
+ }
- org.jboss.identity.idm.api.Group associatedGroup =
- ids.getPersistenceManager().findGroup(associatedGroupName,
associatedGroupType);
- if (associatedGroup != null)
- {
- hasTheGroup =
ids.getRelationshipManager().isAssociated(associatedGroup, user);
- }
+ protected UserStatus _getUserStatus(final String inputPassword) throws Exception
+ {
+ try
+ {
+ IdentitySession ids =
getIdentitySessionFactory().getCurrentIdentitySession(realmName);
- if (!hasTheGroup)
- {
- return UserStatus.NOTASSIGNEDTOROLE;
- }
- }
+ User user = ids.getPersistenceManager().findUser(getUsername());
- if (!ids.getAttributesManager().validatePassword(user, inputPassword))
- {
- return UserStatus.WRONGPASSWORD;
- }
+ // in case module implementation doesn't throw proper
+ // exception...
+ if (user == null)
+ {
+ throw new NoSuchUserException("UserModule returned null user
object");
+ }
+ //This is because LDAP binds can be non case sensitive
+ if (validateUserNameCase != null &&
validateUserNameCase.equalsIgnoreCase("true")
+ && !getUsername().equals(user.getId()))
+ {
+ return UserStatus.UNEXISTING;
+ }
+
+ //Enabled
+ if (userEnabledAttributeName != null)
+ {
+
+ boolean enabled = false;
+ try {
+ Object enabledS;
+ enabledS = ids.getAttributesManager().getAttribute(user,
userEnabledAttributeName);
+ if (enabledS != null) {
+ enabled = new Boolean(enabledS.toString());
}
- catch (NoSuchUserException e1)
- {
- return UserStatus.UNEXISTING;
- }
- catch (Exception e)
- {
- throw new LoginException(e.toString());
- }
- return null;
+ } catch (Exception e) {
+ e.printStackTrace();
}
- });
- if (tmp != null)
+ if (!enabled) {
+ return UserStatus.DISABLE;
+ }
+ }
+
+ if (associatedGroupName != null && associatedGroupType != null)
{
- result = tmp;
+ boolean hasTheGroup = false;
+
+ org.jboss.identity.idm.api.Group associatedGroup =
+ ids.getPersistenceManager().findGroup(associatedGroupName,
associatedGroupType);
+
+ if (associatedGroup != null)
+ {
+ hasTheGroup = ids.getRelationshipManager().isAssociated(associatedGroup,
user);
+ }
+
+ if (!hasTheGroup)
+ {
+ return UserStatus.NOTASSIGNEDTOROLE;
+ }
}
- } catch (Exception e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
+
+ if (!ids.getAttributesManager().validatePassword(user, inputPassword))
+ {
+ return UserStatus.WRONGPASSWORD;
+ }
+
}
- return result;
+ catch (NoSuchUserException e1)
+ {
+ return UserStatus.UNEXISTING;
+ }
+ catch (Exception e)
+ {
+ throw new LoginException(e.toString());
+ }
+ return UserStatus.OK;
}
protected Group[] getRoleSets() throws LoginException
{
try {
- TransactionManager tm =
TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager();
- return (Group[]) Transactions.required(tm, new Transactions.Runnable()
- {
- public Object run() throws Exception
+ TransactionManager tm =
TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager();
+ return (Group[]) Transactions.required(tm, new Transactions.Runnable()
{
- Group rolesGroup = new SimpleGroup("Roles");
+ public Object run() throws Exception
+ {
+ IdentitySession ids =
getIdentitySessionFactory().getCurrentIdentitySession(realmName);
+ ids.beginTransaction();
- //
- if (additionalRole != null) {
- rolesGroup.addMember(createIdentity(additionalRole));
+ if (manageTransaction != null &&
manageTransaction.equals("true"))
+ {
+ ids.beginTransaction();
+ }
+
+ Group[] result = _getRoleSets();
+
+ if (manageTransaction != null &&
manageTransaction.equals("true"))
+ {
+ ids.getTransaction().commit();
+ }
+
+
+ return result;
}
+ });
+ } catch (Exception e) {
+ Throwable cause = e.getCause();
+ throw new LoginException(cause.toString());
+ }
- try {
- IdentitySession ids =
getIdentitySessionFactory().getCurrentIdentitySession(realmName);
+ }
- User user = ids.getPersistenceManager().findUser(getUsername());
- Collection<org.jboss.identity.idm.api.Group> userGroups =
- ids.getRelationshipManager().findAssociatedGroups(user,
roleGroupTypeName);
+ protected Group[] _getRoleSets() throws Exception
+ {
+ Group rolesGroup = new SimpleGroup("Roles");
- //
- for (org.jboss.identity.idm.api.Group userGroup : userGroups)
- {
- String roleName = userGroup.getName();
+ //
+ if (additionalRole != null) {
+ rolesGroup.addMember(createIdentity(additionalRole));
+ }
- try {
- Principal p = createIdentity(roleName);
- rolesGroup.addMember(p);
- } catch (Exception e) {
- log.finer("Failed to create principal " + roleName +
" " + e);
- }
+ try {
- }
-
- } catch (Exception e) {
- throw new LoginException(e.toString());
- }
- //
- return new Group[] { rolesGroup };
+ IdentitySession ids =
getIdentitySessionFactory().getCurrentIdentitySession(realmName);
+
+
+ User user = ids.getPersistenceManager().findUser(getUsername());
+ Collection<org.jboss.identity.idm.api.Group> userGroups =
+ ids.getRelationshipManager().findAssociatedGroups(user, roleGroupTypeName);
+
+ //
+ for (org.jboss.identity.idm.api.Group userGroup : userGroups)
+ {
+ String roleName = userGroup.getName();
+
+ try {
+ Principal p = createIdentity(roleName);
+ rolesGroup.addMember(p);
+ } catch (Exception e) {
+ log.info("Failed to create principal " + roleName, e);
}
- });
+
+ }
+
} catch (Exception e) {
- Throwable cause = e.getCause();
- throw new LoginException(cause.toString());
+ throw new LoginException(e.toString());
}
+ //
+ return new Group[] { rolesGroup };
+
}
+
+
/** Subclass to use the PortalPrincipal to make the username easier to retrieve by the
portal. */
protected Principal createIdentity(String username) throws Exception
{
Modified: idm/trunk/idm-cache/pom.xml
===================================================================
--- idm/trunk/idm-cache/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/idm-cache/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -45,28 +45,28 @@
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <systemProperties>
- <property>
- <name>dataSourceName</name>
- <value>${dataSourceName}</value>
- </property>
- <property>
- <name>directoryName</name>
- <value>${directoryName}</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>dataSourceName</name>
+ <value>${dataSourceName}</value>
+ </property>
+ <property>
+ <name>directoryName</name>
+ <value>${directoryName}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
- </plugins>
- </build>
+ </plugins>
+ </build>
</project>
Modified: idm/trunk/idm-common/pom.xml
===================================================================
--- idm/trunk/idm-common/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/idm-common/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -33,46 +33,46 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
</dependencies>
<reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <doclet>org.jboss.apiviz.APIviz</doclet>
- <docletArtifact>
- <groupId>org.jboss.apiviz</groupId>
- <artifactId>apiviz</artifactId>
- <version>1.2.5.GA</version>
- </docletArtifact>
- <additionalparam>
- -charset UTF-8
- -docencoding UTF-8
- -version
- -author
- -breakiterator
- -windowtitle "${project.name} ${project.version} API Reference"
- -doctitle "${project.name} ${project.version} API Reference"
- -bottom "Copyright © ${project.inceptionYear}-Present
${project.organization.name}. All Rights Reserved."
- -link
http://java.sun.com/javase/6/docs/api/
- -sourceclasspath ${project.build.outputDirectory}
- </additionalparam>
- <encoding>UTF-8</encoding>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <doclet>org.jboss.apiviz.APIviz</doclet>
+ <docletArtifact>
+ <groupId>org.jboss.apiviz</groupId>
+ <artifactId>apiviz</artifactId>
+ <version>1.2.5.GA</version>
+ </docletArtifact>
+ <additionalparam>
+ -charset UTF-8
+ -docencoding UTF-8
+ -version
+ -author
+ -breakiterator
+ -windowtitle "${project.name} ${project.version} API
Reference"
+ -doctitle "${project.name} ${project.version} API Reference"
+ -bottom "Copyright © ${project.inceptionYear}-Present
${project.organization.name}. All Rights Reserved."
+ -link
http://java.sun.com/javase/6/docs/api/
+ -sourceclasspath ${project.build.outputDirectory}
+ </additionalparam>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
Modified: idm/trunk/idm-core/pom.xml
===================================================================
--- idm/trunk/idm-core/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/idm-core/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -40,14 +40,14 @@
</dependency>
<dependency>
<groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-spi</artifactId>
- <version>${project.version}</version>
+ <artifactId>idm-spi</artifactId>
+ <version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.1.8</version>
- </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.8</version>
+ </dependency>
<dependency>
<groupId>junit</groupId>
@@ -71,40 +71,40 @@
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <systemProperties>
- <property>
- <name>dataSourceName</name>
- <value>${dataSourceName}</value>
- </property>
- <property>
- <name>directoryName</name>
- <value>${directoryName}</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>dataSourceName</name>
+ <value>${dataSourceName}</value>
+ </property>
+ <property>
+ <name>directoryName</name>
+ <value>${directoryName}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
- </plugins>
- </build>
+ </plugins>
+ </build>
</project>
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryExecutorImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryExecutorImpl.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryExecutorImpl.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -32,13 +32,15 @@
import java.util.Collection;
import java.util.List;
import java.util.LinkedList;
+import java.io.Serializable;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public class GroupQueryExecutorImpl extends AbstractQueryExecutor
+public class GroupQueryExecutorImpl extends AbstractQueryExecutor implements
Serializable
{
+ private static final long serialVersionUID = -6202216015171375769L;
public GroupQueryExecutorImpl(IdentitySession identitySession)
{
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryExecutorImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryExecutorImpl.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryExecutorImpl.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -32,13 +32,16 @@
import java.util.Collection;
import java.util.List;
import java.util.LinkedList;
+import java.io.Serializable;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public class RoleQueryExecutorImpl extends AbstractQueryExecutor
+public class RoleQueryExecutorImpl extends AbstractQueryExecutor implements Serializable
{
+ private static final long serialVersionUID = -5943827542621450235L;
+
public RoleQueryExecutorImpl(IdentitySession identitySession)
{
super(identitySession);
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryExecutorImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryExecutorImpl.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryExecutorImpl.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -32,13 +32,16 @@
import java.util.Collection;
import java.util.List;
import java.util.LinkedList;
+import java.io.Serializable;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public class UserQueryExecutorImpl extends AbstractQueryExecutor
+public class UserQueryExecutorImpl extends AbstractQueryExecutor implements Serializable
{
+ private static final long serialVersionUID = -4196998772910705233L;
+
public UserQueryExecutorImpl(IdentitySession identitySession)
{
super(identitySession);
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/context/IdentitySessionContextImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/context/IdentitySessionContextImpl.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/context/IdentitySessionContextImpl.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -28,19 +28,23 @@
import org.jboss.identity.idm.impl.api.session.mapper.IdentityObjectTypeMapper;
import
org.jboss.identity.idm.impl.api.session.context.IdentityStoreInvocationContextResolver;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public class IdentitySessionContextImpl implements IdentitySessionContext
+public class IdentitySessionContextImpl implements IdentitySessionContext, Serializable
{
private final IdentityStoreRepository identityStoreRepository;
private final IdentityObjectTypeMapper identityObjectTypeMapper;
- private final IdentityStoreInvocationContextResolver contextResolver;
+ private final IdentityStoreInvocationContextResolver contextResolver;
+ private static final long serialVersionUID = 6968037075942357128L;
+
public IdentitySessionContextImpl(IdentityStoreRepository identityStoreRepository,
IdentityObjectTypeMapper identityObjectTypeMapper, IdentityStoreInvocationContextResolver
contextResolver)
{
this.identityStoreRepository = identityStoreRepository;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -46,11 +46,13 @@
import org.jboss.identity.idm.impl.api.SimpleAttribute;
import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public abstract class AbstractManager
+public abstract class AbstractManager implements Serializable
{
protected final IdentitySession identitySession;
@@ -95,6 +97,7 @@
protected User createUserFromId(String name)
{
+
return new SimpleUser(name);
}
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AttributesManagerImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AttributesManagerImpl.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AttributesManagerImpl.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -42,13 +42,15 @@
import java.util.Set;
import java.util.Map;
import java.util.HashMap;
+import java.io.Serializable;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public class AttributesManagerImpl extends AbstractManager implements AttributesManager
+public class AttributesManagerImpl extends AbstractManager implements AttributesManager,
Serializable
{
+ private static final long serialVersionUID = 1285532201632609092L;
public AttributesManagerImpl(IdentitySession session)
{
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -40,15 +40,18 @@
import java.util.List;
import java.util.LinkedList;
import java.util.Iterator;
+import java.io.Serializable;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public class PersistenceManagerImpl extends AbstractManager implements
PersistenceManager
+public class PersistenceManagerImpl extends AbstractManager implements
PersistenceManager, Serializable
{
private final PersistenceManagerFeaturesDescription featuresDescription;
+
+ private static final long serialVersionUID = -4691446225503953920L;
public PersistenceManagerImpl(IdentitySession session)
@@ -199,7 +202,13 @@
{
checkNotNullArgument(name, "User name");
- return createUser(getRepository().findIdentityObject(getInvocationContext(), name,
getUserObjectType()));
+ IdentityObject io = getRepository().findIdentityObject(getInvocationContext(),
name, getUserObjectType());
+
+ if (io != null)
+ {
+ return createUser(io);
+ }
+ return null;
}
public Collection<User> findUser(IdentitySearchCriteria criteria) throws
IdentityException
@@ -223,13 +232,26 @@
checkNotNullArgument(name, "Group name");
checkNotNullArgument(groupType, "Group type");
- return createGroup(getRepository().findIdentityObject(getInvocationContext(), name,
getIdentityObjectType(groupType)));
+ IdentityObject io = getRepository().findIdentityObject(getInvocationContext(),
name, getIdentityObjectType(groupType));
+
+ if (io != null)
+ {
+ return createGroup(io);
+ }
+ return null;
}
public Group findGroupById(String id) throws IdentityException
{
checkNotNullArgument(id, "Group id");
- return createGroup(getRepository().findIdentityObject(getInvocationContext(),
id));
+
+ IdentityObject io = getRepository().findIdentityObject(getInvocationContext(),
id);
+
+ if (io != null)
+ {
+ return createGroup(io);
+ }
+ return null;
}
public Collection<Group> findGroup(String groupType, IdentitySearchCriteria
criteria) throws IdentityException
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -46,12 +46,13 @@
import java.util.Set;
import java.util.HashSet;
import java.util.Arrays;
+import java.io.Serializable;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public class RelationshipManagerImpl extends AbstractManager implements
RelationshipManager
+public class RelationshipManagerImpl extends AbstractManager implements
RelationshipManager, Serializable
{
RelationshipManagerFeaturesDescription featuresDescription;
@@ -62,6 +63,8 @@
return "JBOSS_IDENTITY_MEMBERSHIP";
}
};
+
+ private static final long serialVersionUID = -1054805796187123311L;
public RelationshipManagerImpl(IdentitySession session)
{
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -50,12 +50,13 @@
import java.util.LinkedList;
import java.util.Map;
import java.util.HashMap;
+import java.io.Serializable;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public class RoleManagerImpl extends AbstractManager implements RoleManager
+public class RoleManagerImpl extends AbstractManager implements RoleManager,
Serializable
{
public static final IdentityObjectRelationshipType ROLE = new
IdentityObjectRelationshipType()
{
@@ -66,6 +67,8 @@
};
private final RoleManagerFeaturesDescription featuresDescription;
+
+ private static final long serialVersionUID = 7246982831145808636L;
public RoleManagerImpl(IdentitySession session)
{
Modified: idm/trunk/idm-hibernate/pom.xml
===================================================================
--- idm/trunk/idm-hibernate/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/idm-hibernate/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -34,42 +34,42 @@
<version>${project.version}</version>
</dependency>
- <!-- hibernate -->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>3.3.1.GA</version>
- </dependency>
- <dependency>
+ <!-- hibernate -->
+ <dependency>
<groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.3.1.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
- <!--Javassist as Hibernate's bytecode provider-->
- <dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>3.4.GA</version>
- </dependency>
+ <!--Javassist as Hibernate's bytecode provider-->
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.4.GA</version>
+ </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-cglib-repack</artifactId>
- <version>2.1_3</version>
- </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-cglib-repack</artifactId>
+ <version>2.1_3</version>
+ </dependency>
- <!-- Hibernate logging set up -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.2</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
+ <!-- Hibernate logging set up -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.2</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
<dependency>
@@ -88,28 +88,28 @@
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <systemProperties>
- <property>
- <name>dataSourceName</name>
- <value>${dataSourceName}</value>
- </property>
- <property>
- <name>directoryName</name>
- <value>${directoryName}</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>dataSourceName</name>
+ <value>${dataSourceName}</value>
+ </property>
+ <property>
+ <name>directoryName</name>
+ <value>${directoryName}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
- </plugins>
- </build>
+ </plugins>
+ </build>
-
+
</project>
Modified:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredential.java
===================================================================
---
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredential.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObjectCredential.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -58,7 +58,7 @@
private Long id;
@ManyToOne(fetch = FetchType.EAGER)
- @JoinColumn(name = "IDENTITY_OBJECT_TYPE", nullable = false)
+ @JoinColumn(name = "CREDENTIAL_TYPE", nullable = false)
private HibernateIdentityObjectCredentialType type;
@ManyToOne(fetch = FetchType.EAGER)
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-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -153,6 +153,8 @@
// <IdentityObjectType name, <Attribute store mapping, Attribute name>
private Map<String, Map<String, String>> reverseAttributeMappings = new
HashMap<String, Map<String, String>>();
+
+ private static final long serialVersionUID = -130355852189832805L;
static {
// List all supported criteria classes
Modified: idm/trunk/idm-ldap/pom.xml
===================================================================
--- idm/trunk/idm-ldap/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/idm-ldap/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -37,7 +37,7 @@
<dependency>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit</artifactId>
- <version>1.2.2</version>
+ <version>1.2.2</version>
<scope>test</scope>
</dependency>
@@ -45,29 +45,29 @@
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <systemProperties>
- <property>
- <name>dataSourceName</name>
- <value>${dataSourceName}</value>
- </property>
- <property>
- <name>directoryName</name>
- <value>${directoryName}</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>dataSourceName</name>
+ <value>${dataSourceName}</value>
+ </property>
+ <property>
+ <name>directoryName</name>
+ <value>${directoryName}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
- </plugins>
- </build>
+ </plugins>
+ </build>
-
+
</project>
Modified: idm/trunk/idm-spi/pom.xml
===================================================================
--- idm/trunk/idm-spi/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/idm-spi/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -40,32 +40,32 @@
</dependencies>
<reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <doclet>org.jboss.apiviz.APIviz</doclet>
- <docletArtifact>
- <groupId>org.jboss.apiviz</groupId>
- <artifactId>apiviz</artifactId>
- <version>1.2.5.GA</version>
- </docletArtifact>
- <additionalparam>
- -charset UTF-8
- -docencoding UTF-8
- -version
- -author
- -breakiterator
- -windowtitle "${project.name} ${project.version} API Reference"
- -doctitle "${project.name} ${project.version} API Reference"
- -bottom "Copyright © ${project.inceptionYear}-Present
${project.organization.name}. All Rights Reserved."
- -link
http://java.sun.com/javase/6/docs/api/
- -sourceclasspath ${project.build.outputDirectory}
- </additionalparam>
- <encoding>UTF-8</encoding>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <doclet>org.jboss.apiviz.APIviz</doclet>
+ <docletArtifact>
+ <groupId>org.jboss.apiviz</groupId>
+ <artifactId>apiviz</artifactId>
+ <version>1.2.5.GA</version>
+ </docletArtifact>
+ <additionalparam>
+ -charset UTF-8
+ -docencoding UTF-8
+ -version
+ -author
+ -breakiterator
+ -windowtitle "${project.name} ${project.version} API
Reference"
+ -doctitle "${project.name} ${project.version} API Reference"
+ -bottom "Copyright © ${project.inceptionYear}-Present
${project.organization.name}. All Rights Reserved."
+ -link
http://java.sun.com/javase/6/docs/api/
+ -sourceclasspath ${project.build.outputDirectory}
+ </additionalparam>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
Modified:
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java
===================================================================
---
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -43,7 +43,7 @@
* @author Anil.Saldhana(a)redhat.com
* @since Jul 10, 2008
*/
-public interface IdentityStore extends AttributeStore
+public interface IdentityStore extends AttributeStore
{
/**
Modified:
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStoreSessionFactory.java
===================================================================
---
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStoreSessionFactory.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStoreSessionFactory.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -24,11 +24,13 @@
import org.jboss.identity.idm.common.exception.IdentityException;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
*/
-public interface IdentityStoreSessionFactory
+public interface IdentityStoreSessionFactory extends Serializable
{
/**
Modified: idm/trunk/idm-testsuite/pom.xml
===================================================================
--- idm/trunk/idm-testsuite/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/idm-testsuite/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -40,11 +40,11 @@
</dependency>
<dependency>
<groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-ldap</artifactId>
- <version>${project.version}</version>
+ <artifactId>idm-ldap</artifactId>
+ <version>${project.version}</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.jboss.identity.idm</groupId>
<artifactId>idm-core</artifactId>
<version>${project.version}</version>
@@ -76,87 +76,87 @@
<scope>test</scope>
</dependency>
- <!--JBoss Unit-->
+ <!--JBoss Unit-->
<dependency>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit</artifactId>
- <version>1.2.2</version>
+ <version>1.2.2</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.unit</groupId>
- <artifactId>portal-test</artifactId>
- <version>1.2.2</version>
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>portal-test</artifactId>
+ <version>1.2.2</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>hibernate</groupId>
- <artifactId>hibernate3</artifactId>
- </exclusion>
- <exclusion>
- <groupId>sun-opends</groupId>
- <artifactId>opends-core</artifactId>
- </exclusion>
- </exclusions>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>hibernate</groupId>
+ <artifactId>hibernate3</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>sun-opends</groupId>
+ <artifactId>opends-core</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
- <dependency>
- <groupId>jboss.jbossas.core-libs</groupId>
- <artifactId>jboss-local-jdbc</artifactId>
- <version>4.0.4.GA</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss.jbossas.core-libs</groupId>
- <artifactId>jboss-common-jdbc-wrapper</artifactId>
- <version>4.0.4.GA</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>2.0.2.GA</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-jdk</artifactId>
- <version>2.0.2.GA</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <version>2.0.2.GA</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>apache-log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+ <dependency>
+ <groupId>jboss.jbossas.core-libs</groupId>
+ <artifactId>jboss-local-jdbc</artifactId>
+ <version>4.0.4.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss.jbossas.core-libs</groupId>
+ <artifactId>jboss-common-jdbc-wrapper</artifactId>
+ <version>4.0.4.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-jdk</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>5.1.6</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>8.3-604.jdbc3</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>net.sourceforge.jtds</groupId>
- <artifactId>jtds</artifactId>
- <version>1.2.2</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.1.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>8.3-604.jdbc3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.jtds</groupId>
+ <artifactId>jtds</artifactId>
+ <version>1.2.2</version>
+ <scope>test</scope>
+ </dependency>
@@ -165,27 +165,27 @@
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <systemProperties>
- <property>
- <name>dataSourceName</name>
- <value>${dataSourceName}</value>
- </property>
- <property>
- <name>directoryName</name>
- <value>${directoryName}</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>dataSourceName</name>
+ <value>${dataSourceName}</value>
+ </property>
+ <property>
+ <name>directoryName</name>
+ <value>${directoryName}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
- </plugins>
- </build>
+ </plugins>
+ </build>
</project>
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateModelTestCase.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateModelTestCase.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateModelTestCase.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -28,13 +28,15 @@
import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship;
import org.jboss.identity.idm.impl.model.hibernate.HibernateRealm;
import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute;
+import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType;
+import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential;
import org.jboss.identity.idm.impl.IdentityTestPOJO;
+import org.jboss.identity.idm.impl.api.PasswordCredential;
import org.jboss.unit.api.pojo.annotations.Destroy;
import org.jboss.unit.api.pojo.annotations.Create;
import org.jboss.unit.api.pojo.annotations.Test;
import org.hibernate.Session;
import org.hibernate.Query;
-import static org.jboss.unit.api.Assert.*;
/**
@@ -68,9 +70,63 @@
Session session = getSessionFactory().getCurrentSession();
- HibernateRealm realm = new HibernateRealm("default");
- session.persist(realm);
+HibernateRealm realm = new HibernateRealm("realm://JBossIdentity");
+ session.save(realm);
+ HibernateIdentityObjectType typeUser = new
HibernateIdentityObjectType("USER");
+ HibernateIdentityObjectType typeGroup = new
HibernateIdentityObjectType("GROUP");
+
+ session.save(typeUser);
+ session.save(typeGroup);
+
+ HibernateIdentityObject userUserObject = new HibernateIdentityObject("user",
typeUser, realm);
+ HibernateIdentityObject userGroupObject = new
HibernateIdentityObject("User", typeGroup, realm);
+ HibernateIdentityObject adminUserObject = new
HibernateIdentityObject("admin", typeUser, realm);
+ HibernateIdentityObject adminGroupObject = new
HibernateIdentityObject("Admin", typeGroup, realm);
+
+ session.save(userUserObject);
+ session.save(userGroupObject);
+ session.save(adminUserObject);
+ session.save(adminGroupObject);
+
+ HibernateIdentityObjectCredentialType passwordType = new
HibernateIdentityObjectCredentialType("PASSWORD");
+
+ session.save(passwordType);
+
+ HibernateIdentityObjectCredential pass1 = new HibernateIdentityObjectCredential();
+ PasswordCredential passwordValue = new PasswordCredential("user");
+ pass1.setType(passwordType);
+ pass1.setTextValue(passwordValue.getEncodedValue().toString());
+ userUserObject.addCredential(pass1);
+
+ session.save(pass1);
+
+ HibernateIdentityObjectCredential pass2 = new HibernateIdentityObjectCredential();
+ passwordValue = new PasswordCredential("admin");
+ pass2.setType(passwordType);
+ pass2.setTextValue(passwordValue.getEncodedValue().toString());
+ adminUserObject.addCredential(pass2);
+
+
+ session.save(pass2);
+
+ HibernateIdentityObjectRelationshipType membership = new
HibernateIdentityObjectRelationshipType("JBOSS_IDENTITY_MEMBERSHIP");
+
+ session.save(membership);
+
+ HibernateIdentityObjectRelationship rel1 = new
HibernateIdentityObjectRelationship(membership, adminGroupObject, adminUserObject);
+ HibernateIdentityObjectRelationship rel2 = new
HibernateIdentityObjectRelationship(membership, userGroupObject, adminUserObject);
+ HibernateIdentityObjectRelationship rel3 = new
HibernateIdentityObjectRelationship(membership, userGroupObject, userUserObject);
+
+ session.save(rel1);
+ session.save(rel2);
+ session.save(rel3);
+
+
+
+ HibernateRealm defaultRealm = new HibernateRealm("default");
+ session.persist(defaultRealm);
+
//
HibernateIdentityObjectType iot = new HibernateIdentityObjectType();
@@ -82,7 +138,7 @@
HibernateIdentityObject io = new HibernateIdentityObject();
io.setName("John Kowalski");
- io.setRealm(realm);
+ io.setRealm(defaultRealm);
io.setIdentityType(iot);
session.persist(io);
Modified: idm/trunk/integration/jboss5/pom.xml
===================================================================
--- idm/trunk/integration/jboss5/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/integration/jboss5/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -1,108 +1,163 @@
<?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>
+ <modelVersion>4.0.0</modelVersion>
- <name>JBoss Identity IDM Integration JBoss5</name>
- <description>JBoss Identity IDM JBoss5</description>
+ <name>JBoss Identity IDM Integration JBoss5</name>
+ <description>JBoss Identity IDM JBoss5</description>
- <groupId>org.jboss.identity.integration</groupId>
- <artifactId>idm-jboss5</artifactId>
- <packaging>jar</packaging>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.jboss.identity.idm.integration</groupId>
+ <artifactId>idm-jboss5</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>
+ <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>
+ <properties>
+ <jboss.version>5.0.0.GA</jboss.version>
+ </properties>
- <dependencies>
+ <dependencies>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-core</artifactId>
- <version>${version}</version>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-core</artifactId>
+ <version>${version}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-hibernate</artifactId>
- <version>${version}</version>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-hibernate</artifactId>
+ <version>${version}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-ldap</artifactId>
- <version>${version}</version>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-ldap</artifactId>
+ <version>${version}</version>
</dependency>
+ <!--<dependency>-->
+ <!--<groupId>org.jboss.identity.idm</groupId>-->
+ <!--<artifactId>idm-cache</artifactId>-->
+ <!--<version>${version}</version>-->
+ <!--</dependency>-->
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-cache</artifactId>
- <version>${version}</version>
+ <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.portal.common</groupId>
- <artifactId>common-common</artifactId>
- <version>1.2.3</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
+ <groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-system-jmx</artifactId>
<version>${jboss.version}</version>
<scope>provided</scope>
- </dependency>
+ </dependency>
<dependency>
- <groupId>bsh</groupId>
+ <groupId>bsh</groupId>
<artifactId>bsh</artifactId>
<version>1.3.0</version>
- </dependency>
+ </dependency>
- </dependencies>
+ </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/idm-service-jboss-beans.xml</exclude>
- <exclude>*.xml</exclude>
- </excludes>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
+ <!-- Build -->
+ <build>
+
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <finalName>idm-service.sar</finalName>
- <appendAssemblyId>true</appendAssemblyId>
- <descriptors>
- <descriptor>src/main/resources/assembly.xml</descriptor>
- </descriptors>
+ <source>1.5</source>
+ <target>1.5</target>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <optimize>true</optimize>
</configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <finalName>idm-service.sar</finalName>
+
+
+ <appendAssemblyId>true</appendAssemblyId>
+ <descriptors>
+
<descriptor>src/main/resources/assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Modified:
idm/trunk/integration/jboss5/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMService.java
===================================================================
---
idm/trunk/integration/jboss5/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMService.java 2009-05-11
11:57:05 UTC (rev 490)
+++
idm/trunk/integration/jboss5/src/main/java/org/jboss/identity/idm/integration/jboss5/IDMService.java 2009-05-12
09:32:57 UTC (rev 491)
@@ -12,18 +12,22 @@
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.DatabaseMetaData;
-import java.util.logging.Logger;
import java.util.Iterator;
import java.util.Collection;
import java.lang.reflect.Method;
+import java.security.acl.Group;
import javax.naming.InitialContext;
+import javax.naming.NamingException;
import javax.sql.DataSource;
+import javax.transaction.TransactionManager;
import org.jboss.aop.microcontainer.aspects.jmx.JMX;
import org.jboss.identity.idm.api.IdentitySessionFactory;
import org.jboss.identity.idm.api.cfg.IdentityConfiguration;
import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
+import org.jboss.identity.idm.common.transaction.TransactionManagerProvider;
+import org.jboss.identity.idm.common.transaction.Transactions;
import org.jboss.portal.common.util.LoaderResource;
import org.jboss.portal.common.util.CLResourceLoader;
import org.jboss.portal.common.io.IOTools;
@@ -31,6 +35,7 @@
import org.hibernate.Session;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
+import org.hibernate.HibernateException;
import org.hibernate.dialect.DialectFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.AnnotationConfiguration;
@@ -39,6 +44,7 @@
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
import org.hibernate.exception.SQLGrammarException;
import org.hibernate.metadata.ClassMetadata;
+import org.apache.log4j.Logger;
import bsh.Interpreter;
import bsh.EvalError;
@@ -186,8 +192,10 @@
InitialContext context = new InitialContext();
- IdentityConfiguration identityConfiguration = new
IdentityConfigurationImpl().configure(getIdmConfigFile());
+ int check = RESULT_NONE;
+ final IdentityConfiguration identityConfiguration = new
IdentityConfigurationImpl().configure(getIdmConfigFile());
+
// If hibernate config is present than create SessionFactory manually and register
it into identity config
if (hibernateConfigLocation != null)
{
@@ -206,10 +214,17 @@
createHibernateSessionFactory();
-// if (getHibernateSessionFactoryJNDIName() != null)
-// {
-// context.bind(getHibernateSessionFactoryJNDIName(),
hibernateSessionFactory);
-// }
+ if (getHibernateSessionFactoryJNDIName() != null)
+ {
+ try
+ {
+ context.bind(getHibernateSessionFactoryJNDIName(),
hibernateSessionFactory);
+ }
+ catch (NamingException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File |
Settings | File Templates.
+ }
+ }
if (getHibernateSessionFactoryRegistryName() != null)
{
@@ -217,37 +232,41 @@
register(hibernateSessionFactory,
getHibernateSessionFactoryRegistryName());
}
- identitySessionFactory = identityConfiguration.buildIdentitySessionFactory();
- }
+ if (doChecking)
+ {
+ //check the schema
+ check = doCheck();
+ switch (check)
+ {
+ case RESULT_NONE:
+ break;
+ case RESULT_UPDATE:
+ updateSchema();
+ break;
+ case RESULT_CREATE:
+ createSchema();
+ createContent();
- int check = RESULT_NONE;
-
- if (doChecking)
- {
- //check the schema
- check = doCheck();
- switch (check)
- {
- case RESULT_NONE:
- break;
- case RESULT_UPDATE:
- updateSchema();
- break;
- case RESULT_CREATE:
- createSchema();
- break;
+ break;
+ }
}
}
- identitySessionFactory = identityConfiguration.buildIdentitySessionFactory();
+ try {
+ TransactionManager tm =
TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager();
+ Transactions.required(tm, new Transactions.Runnable()
+ {
+ public Object run() throws Exception
+ {
+ identitySessionFactory =
identityConfiguration.buildIdentitySessionFactory();
+ return null;
+ }
+ });
+ } catch (Exception e) {
- // If schema was created than
- if (check == RESULT_CREATE)
- {
- createContent();
+ throw new Exception("Cannot create IdentitySessionFactory", e);
}
-
context.bind(getIdmSessionFactoryJNDI(), identitySessionFactory);
logger.info("Started the JBoss Identity Management Service");
}
@@ -259,18 +278,41 @@
}
public void destroy() throws Exception {
- identitySessionFactory.close();
- InitialContext context = new InitialContext();
- context.unbind(getIdmSessionFactoryJNDI());
+
+ InitialContext context = new InitialContext();
+
+ try
+ {
+ if (identitySessionFactory != null)
+ {
+ identitySessionFactory.close();
+ if (getIdmSessionFactoryJNDI() != null)
+ {
+ context.unbind(getIdmSessionFactoryJNDI());
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ logger.info(e); //To change body of catch statement use File | Settings | File
Templates.
+ }
+
if (hibernateSessionFactory != null)
{
- if (getHibernateSessionFactoryJNDIName() != null)
+ try
{
- context.unbind(getHibernateSessionFactoryJNDIName());
+ if (getHibernateSessionFactoryJNDIName() != null)
+ {
+ context.unbind(getHibernateSessionFactoryJNDIName());
+ }
+
+ hibernateSessionFactory.close();
}
-
- hibernateSessionFactory.close();
+ catch (Exception e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings
| File Templates.
+ }
}
logger.info("Stopped the JBoss Identity Management Service");
@@ -406,7 +448,7 @@
if (dialectName == null)
{
String dataSourceJNDI = config.getProperty(Environment.DATASOURCE);
- logger.finer("Detecting dialect with datasource " + dataSourceJNDI +
" ...");
+ logger.debug("Detecting dialect with datasource " + dataSourceJNDI +
" ...");
DataSource ds = (DataSource)new InitialContext().lookup(dataSourceJNDI);
Connection conn = null;
try
@@ -417,14 +459,14 @@
int databaseMajorVersion = getDatabaseMajorVersion(meta);
dialectName = DialectFactory.determineDialect(databaseName,
databaseMajorVersion).getClass().getName();
config.setProperty(Environment.DIALECT, dialectName);
- logger.finer("Detected dialect " + dialectName + ", database
is (" + databaseName + "," + databaseMajorVersion + ")");
+ logger.debug("Detected dialect " + dialectName + ", database
is (" + databaseName + "," + databaseMajorVersion + ")");
}
finally
{
IOTools.safeClose(conn);
}
}
- logger.finer("Using dialect " + dialectName);
+ logger.debug("Using dialect " + dialectName);
if ("org.hibernate.dialect.HSQLDialect".equals(dialectName))
{
logger.info("You are using the file based HSQL database, this is not
recommended on a production environment and will not work properly on a clustered
environment.");
@@ -480,14 +522,14 @@
// There was no sql grammar exception - schema is ok!
if (bad == 0)
{
- logger.finer("The schema was checked as valid");
+ logger.debug("The schema was checked as valid");
//do nothing
return RESULT_NONE;
}
// There is no existing valid schema;
else if (bad == numOfChecks)
{
- logger.finer("The schema was checked as not exists");
+ logger.debug("The schema was checked as not exists");
// Totaly invalid schema
return RESULT_CREATE;
}
@@ -495,19 +537,19 @@
else if (bad < numOfChecks)
{
// Schema needs updates;
- logger.finer("The schema was checked as need updates");
+ logger.debug("The schema was checked as need updates");
return RESULT_UPDATE;
}
// If here something gone wrong...
- logger.finer("The schema was checked as need to be created");
+ logger.debug("The schema was checked as need to be created");
return RESULT_CREATE;
}
public void createSchema()
{
- logger.finer("Creating database schema");
+ logger.debug("Creating database schema");
try
{
SchemaExport export = new SchemaExport(config);
@@ -515,13 +557,13 @@
}
catch (Exception e)
{
- logger.fine("Cannot create schema: " + e);
+ logger.debug("Cannot create schema: ", e);
}
}
public void destroySchema()
{
- logger.finer("Destroying database schema");
+ logger.debug("Destroying database schema");
try
{
SchemaExport export = new SchemaExport(config);
@@ -529,7 +571,7 @@
}
catch (Exception e)
{
- logger.finer("Cannot destroy schema:" + e);
+ logger.debug("Cannot destroy schema:", e);
}
}
@@ -550,29 +592,41 @@
{
try
{
- logger.fine("Creating database content");
- String script = setupResource.asString("UTF-8");
+ logger.info("Creating database content");
+ final String script = setupResource.asString("UTF-8");
// Create an interpreter and configures it
- Interpreter interpreter = new Interpreter();
+ final Interpreter interpreter = new Interpreter();
interpreter.setClassLoader(Thread.currentThread().getContextClassLoader());
interpreter.setOut(System.out);
- interpreter.set("hibernateSessionFactory",
hibernateSessionFactory);
- interpreter.set("identitySessionFactory",
identitySessionFactory);
- interpreter.eval(script);
+ interpreter.set("SessionFactory", hibernateSessionFactory);
+
+ 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.finer("Error in the bsh script:" + e);
+ logger.info("Error in the bsh script:", e);
}
catch (IllegalStateException e)
{
- logger.finer("Cannot load setup script:" + e);
+ logger.info("Cannot load setup script:", e);
}
+ catch (Exception e)
+ {
+ logger.info("Error in bsh script execution:", e);
+ }
}
else
{
- logger.fine("There is a setup URL but the not valid " +
setupResource);
+ logger.info("There is a setup URL but the not valid " +
setupResource);
}
}
}
@@ -581,7 +635,7 @@
public void updateSchema()
{
- logger.finer("Updating database schema");
+ logger.info("Updating database schema");
SchemaUpdate update = new SchemaUpdate(config);
update.execute(false, true);
}
@@ -600,7 +654,7 @@
}
catch (Throwable t)
{
- logger.finer("could not get database version from JDBC metadata");
+ logger.info("could not get database version from JDBC metadata");
return 0;
}
}
Modified: idm/trunk/integration/pom.xml
===================================================================
--- idm/trunk/integration/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/integration/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -1,40 +1,40 @@
<?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>
+ <modelVersion>4.0.0</modelVersion>
- <name>JBoss Identity IDM Integration</name>
- <description>JBoss Identity IDM Integration</description>
+ <name>JBoss Identity IDM Integration</name>
+ <description>JBoss Identity IDM Integration</description>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-integration</artifactId>
- <packaging>pom</packaging>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-integration</artifactId>
+ <packaging>pom</packaging>
- <!-- Parent -->
- <parent>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
- </parent>
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
- <modules>
- <module>jboss5</module>
- </modules>
+ <modules>
+ <module>jboss5</module>
+ </modules>
- <!-- Plugins -->
- <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>
- </plugins>
- </build>
+ <!-- Plugins -->
+ <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>
+ </plugins>
+ </build>
</project>
Modified: idm/trunk/parent/pom.xml
===================================================================
--- idm/trunk/parent/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/parent/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -1,191 +1,191 @@
<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">
- <parent>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-parent</artifactId>
- <version>3</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-parent</artifactId>
- <packaging>pom</packaging>
- <version>1.0.0-SNAPSHOT</version>
- <name>JBoss Identity IDM- Parent</name>
- <
url>http://labs.jboss.org/portal/jbosssecurity/</url>
- <description>JBoss Identity is a cross-cutting project that handles identity
needs for the JEMS projects</description>
- <licenses>
- <license>
- <name>lgpl</name>
- <
url>http://repository.jboss.com/licenses/lgpl.txt</url>
- </license>
- </licenses>
- <organization>
- <name>JBoss Inc.</name>
- <url>http://www.jboss.org</url>
- </organization>
- <scm>
-
<
connection>scm:svn:http://anonsvn.jboss.org/repos/jbossidentity/idm/tr...
-
<
developerConnection>scm:svn:https://svn.jboss.org/repos/jbossidentity/...
- </scm>
+ <parent>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-parent</artifactId>
+ <version>3</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-parent</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0.0-SNAPSHOT</version>
+ <name>JBoss Identity IDM- Parent</name>
+ <
url>http://labs.jboss.org/portal/jbosssecurity/</url>
+ <description>JBoss Identity is a cross-cutting project that handles identity
needs for the JEMS projects</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <
url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss Inc.</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/jbossidentity/idm/tr...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/jbossidentity/...
+ </scm>
- <build>
- <plugins>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+
<
tagBase>https://svn.jboss.org/repos/jbossidentity/tags</tagBase>
+ </configuration>
+ </plugin>
+ <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>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
<plugin>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
-
<
tagBase>https://svn.jboss.org/repos/jbossidentity/tags</tagBase>
- </configuration>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <printSummary>true</printSummary>
+ <disableXmlReport>false</disableXmlReport>
+ <testFailureIgnore>false</testFailureIgnore>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ <forkMode>pertest</forkMode>
+ <argLine>${surefire.jvm.args}</argLine>
+ <useFile>false</useFile>
+ <trimStackTrace>false</trimStackTrace>
+ <systemProperties>
+ <property>
+ <name>java.util.logging.config.file</name>
+ <value>../parent/logging.properties</value>
+ </property>
+ </systemProperties>
+ </configuration>
</plugin>
- <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>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- </plugins>
- <pluginManagement>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <!-- Profiles -->
+ <profiles>
+
+ <profile>
+ <id>distro</id>
+ <modules>
+ <module>../distro</module>
+ </modules>
+ <properties>
+ <skipTests>true</skipTests>
+ </properties>
+ <build>
<plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.4.3</version>
- <configuration>
- <printSummary>true</printSummary>
- <disableXmlReport>false</disableXmlReport>
- <testFailureIgnore>false</testFailureIgnore>
- <includes>
- <include>**/*TestCase.java</include>
- </includes>
- <forkMode>pertest</forkMode>
- <argLine>${surefire.jvm.args}</argLine>
- <useFile>false</useFile>
- <trimStackTrace>false</trimStackTrace>
- <systemProperties>
- <property>
- <name>java.util.logging.config.file</name>
- <value>../parent/logging.properties</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
- </pluginManagement>
- </build>
-
- <!-- Profiles -->
- <profiles>
-
- <profile>
- <id>distro</id>
- <modules>
- <module>../distro</module>
- </modules>
- <properties>
- <skipTests>true</skipTests>
- </properties>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>provided-jdbc-driver</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>provided-jdbc-driver2</id>
- <dependencies>
- <dependency>
- <groupId>privided</groupId>
- <artifactId>jdbc-driver2</artifactId>
- <version>NA</version>
- <scope>system</scope>
- <systemPath>${provided.jdbc.driver.path2}</systemPath>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <
url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
-
- <repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshots Repository</name>
- <layout>default</layout>
- <
url>http://snapshots.jboss.org/maven2/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </repository>
- </repositories>
-
- <dependencyManagement>
- <dependencies>
+ </build>
+ </profile>
+ <profile>
+ <id>provided-jdbc-driver</id>
+ <dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path}</systemPath>
</dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>provided-jdbc-driver2</id>
+ <dependencies>
<dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
+ <groupId>privided</groupId>
+ <artifactId>jdbc-driver2</artifactId>
+ <version>NA</version>
+ <scope>system</scope>
+ <systemPath>${provided.jdbc.driver.path2}</systemPath>
</dependency>
- </dependencies>
- </dependencyManagement>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <
url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <layout>default</layout>
+ <
url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
</project>
Modified: idm/trunk/pom.xml
===================================================================
--- idm/trunk/pom.xml 2009-05-11 11:57:05 UTC (rev 490)
+++ idm/trunk/pom.xml 2009-05-12 09:32:57 UTC (rev 491)
@@ -1,4 +1,5 @@
-<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">
+<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">
<parent>
<groupId>org.jboss.identity.idm</groupId>
<artifactId>idm-parent</artifactId>
@@ -14,19 +15,20 @@
<description>JBoss Identity is the identity project for JEMS
projects</description>
<modules>
- <module>parent</module>
- <module>idm-common</module>
- <module>idm-spi</module>
- <module>idm-api</module>
- <module>idm-core</module>
- <module>idm-hibernate</module>
- <module>idm-ldap</module>
- <module>idm-cache</module>
- <module>idm-auth</module>
- <module>idm-testsuite</module>
- <module>integration</module>
- <module>assembly</module>
- <module>example/simple</module>
+ <module>parent</module>
+ <module>idm-common</module>
+ <module>idm-spi</module>
+ <module>idm-api</module>
+ <module>idm-core</module>
+ <module>idm-hibernate</module>
+ <module>idm-ldap</module>
+ <module>idm-cache</module>
+ <module>idm-auth</module>
+ <module>idm-testsuite</module>
+ <module>integration</module>
+ <module>assembly</module>
+ <module>example/simple</module>
+ <module>example/auth</module>
</modules>