Author: bdaw
Date: 2009-05-10 15:15:26 -0400 (Sun, 10 May 2009)
New Revision: 489
Added:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/NoSuchUserException.java
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/p3p/
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/NestedException.java
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/TransactionException.java
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/TransactionManagerProvider.java
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/Transactions.java
Removed:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/exception/
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/p3p/
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/AttributesManager.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySession.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySessionFactory.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RealmManager.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/cfg/IdentityConfiguration.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/cfg/IdentityConfigurationRegistry.java
idm/trunk/idm-auth/pom.xml
idm/trunk/idm-auth/src/main/java/org/jboss/identity/idm/auth/JBossIdentityIDMLoginModule.java
idm/trunk/idm-common/pom.xml
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/FeatureNotSupportedException.java
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/IdentityConfigurationException.java
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/IdentityException.java
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/PolicyValidationException.java
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/p3p/P3PConstants.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySessionFactoryImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/IdentitySessionImpl.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-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAttributeStoreWrapper.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/RepositoryIdentityStoreSessionImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/types/SimpleIdentityObject.java
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/opends/OpenDSService.java
idm/trunk/idm-hibernate/pom.xml
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObject.java
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/HibernateIdentityStoreSessionImpl.java
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/model/ldap/LDAPIdentityObjectImpl.java
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreSessionImpl.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/configuration/IdentityConfigurationContextRegistry.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/exception/IdentityTypeNotSupportedException.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/exception/OperationNotSupportedException.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/model/IdentityObject.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/repository/IdentityStoreRepository.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/AttributeStore.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java
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/IdentityStoreSession.java
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStoreSessionFactory.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreTestCase.java
Log:
Initial LoginModule code and some small refactorings
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/AttributesManager.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/AttributesManager.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/AttributesManager.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,7 +22,7 @@
package org.jboss.identity.idm.api;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import java.util.Set;
import java.util.Map;
@@ -77,7 +77,7 @@
/**
* @param identityType
* @return names of supported attributes
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Set<String> getSupportedAttributeNames(IdentityType identityType)
throws IdentityException;
@@ -85,7 +85,7 @@
/**
* @param id - IdentityType id
* @return names of supported attributes
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Set<String> getSupportedAttributeNames(String id)
throws IdentityException;
@@ -95,7 +95,7 @@
*
* @param identity
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Map<String, Attribute> getAttributes(IdentityType identity) throws
IdentityException;
@@ -104,7 +104,7 @@
*
* @param id
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Map<String, Attribute> getAttributes(String id) throws IdentityException;
@@ -114,7 +114,7 @@
* @param identity
* @param attributeName
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Attribute getAttribute(IdentityType identity, String attributeName) throws
IdentityException;
@@ -124,7 +124,7 @@
* @param id
* @param attributeName
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Attribute getAttribute(String id, String attributeName) throws IdentityException;
@@ -134,7 +134,7 @@
*
* @param identity
* @param attributes
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void updateAttributes(IdentityType identity, Attribute[] attributes)
throws IdentityException;
@@ -145,7 +145,7 @@
*
* @param id
* @param attributes
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void updateAttributes(String id, Attribute[] attributes)
throws IdentityException;
@@ -156,7 +156,7 @@
*
* @param identity
* @param attributes
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void addAttributes(IdentityType identity, Attribute[] attributes)
throws IdentityException;
@@ -167,7 +167,7 @@
*
* @param id
* @param attributes
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void addAttributes(String id, Attribute[] attributes)
throws IdentityException;
@@ -179,7 +179,7 @@
* @param identity
* @param attributeName
* @param values
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void addAttribute(IdentityType identity, String attributeName, Object[] values)
throws IdentityException;
@@ -191,7 +191,7 @@
* @param id
* @param attributeName
* @param values
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void addAttribute(String id, String attributeName, Object[] values)
throws IdentityException;
@@ -203,7 +203,7 @@
* @param identity
* @param attributeName
* @param value
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void addAttribute(IdentityType identity, String attributeName, Object value)
throws IdentityException;
@@ -215,7 +215,7 @@
* @param id
* @param attributeName
* @param value
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void addAttribute(String id, String attributeName, Object value)
throws IdentityException;
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySession.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySession.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySession.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,8 +22,8 @@
package org.jboss.identity.idm.api;
-import org.jboss.identity.idm.exception.IdentityException;
-import org.jboss.identity.idm.exception.FeatureNotSupportedException;
+import org.jboss.identity.idm.common.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.FeatureNotSupportedException;
import org.jboss.identity.idm.api.query.RoleQuery;
import org.jboss.identity.idm.api.query.GroupQuery;
import org.jboss.identity.idm.api.query.UserQuery;
@@ -53,19 +53,19 @@
/**
* Close this session
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void close() throws IdentityException;
/**
* Save all pending changes
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void save() throws IdentityException;
/**
* Clear this session
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void clear() throws IdentityException;
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySessionFactory.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySessionFactory.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySessionFactory.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,7 +22,7 @@
package org.jboss.identity.idm.api;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
/**
* Creates IdentitySession objects for a given Realm.
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,7 +22,7 @@
package org.jboss.identity.idm.api;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import java.util.Collection;
@@ -87,7 +87,7 @@
* @param user
* @param force - if true all present relationships will be removed, if false any
present relationship will cause
* removal to fail
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void removeUser(User user, boolean force) throws IdentityException;
@@ -97,7 +97,7 @@
* @param id
* @param force - if true all present relationships will be removed, if false any
present relationship will cause
* removal to fail
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void removeUser(String id, boolean force) throws IdentityException;
@@ -107,7 +107,7 @@
* @param group
* @param force - if true all present relationships will be removed, if false any
present relationship will cause
* removal to fail
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void removeGroup(Group group, boolean force) throws IdentityException;
@@ -117,7 +117,7 @@
* @param groupId
* @param force - if true all present relationships will be removed, if false any
present relationship will cause
* removal to fail
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void removeGroup(String groupId, boolean force) throws IdentityException;
@@ -125,7 +125,7 @@
/**
* @return a number of stored identities
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
int getUserCount()
throws IdentityException;
@@ -133,7 +133,7 @@
/**
* @param groupType
* @return a number of stored groups with a given type
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
int getGroupTypeCount(String groupType)
throws IdentityException;
@@ -143,7 +143,7 @@
*
* @param name
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
User findUser(String name) throws IdentityException;
@@ -163,7 +163,7 @@
* @param name
* @param groupType
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Group findGroup(String name, String groupType) throws IdentityException;
@@ -172,7 +172,7 @@
*
* @param id
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Group findGroupById(String id) throws IdentityException;
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RealmManager.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RealmManager.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RealmManager.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,7 +22,7 @@
package org.jboss.identity.idm.api;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import java.io.InputStream;
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,7 +22,7 @@
package org.jboss.identity.idm.api;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import java.util.Collection;
@@ -57,7 +57,7 @@
* <p>Associate groups</p>
* @param parents
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateGroups(Collection<Group> parents, Collection<Group>
members)
throws IdentityException;
@@ -66,7 +66,7 @@
* <p>Associate groups</p>
* @param parent
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateGroups(Group parent, Collection<Group> members)
throws IdentityException;
@@ -75,7 +75,7 @@
* <p>Associate groups</p>
* @param parentIds
* @param memberIds
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateGroupsByIds(Collection<String> parentIds, Collection<String>
memberIds)
throws IdentityException;
@@ -84,7 +84,7 @@
* <p>Associate groups</p>
* @param parentId
* @param memberIds
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateGroupsByIds(String parentId, Collection<String> memberIds)
throws IdentityException;
@@ -93,7 +93,7 @@
* <p>Associate groups</p>
* @param parent
* @param member
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateGroups(Group parent, Group member)
throws IdentityException;
@@ -102,7 +102,7 @@
* <p>Associate groups</p>
* @param parentId
* @param memberId
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateGroupsByIds(String parentId, String memberId)
throws IdentityException;
@@ -111,7 +111,7 @@
* <p>Associate identities to groups</p>
* @param parents
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateUsers(Collection<Group> parents, Collection<User> members)
throws IdentityException;
@@ -120,7 +120,7 @@
* <p>Associate identities to group</p>
* @param parent
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateUser(Group parent, Collection<User> members)
throws IdentityException;
@@ -129,7 +129,7 @@
* <p>Associate identities to groups</p>
* @param parents
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateUsersByIds(Collection<String> parents, Collection<String>
members)
throws IdentityException;
@@ -138,7 +138,7 @@
* <p>Associate identities to groups</p>
* @param parentId
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateUsersByIds(String parentId, Collection<String> members)
throws IdentityException;
@@ -147,7 +147,7 @@
* <p>Associate identities to groups</p>
* @param parents
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateUser(Group parents, User members)
throws IdentityException;
@@ -156,7 +156,7 @@
* <p>Associate identities to groups</p>
* @param parentGroupId
* @param memberid
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void associateUserByIds(String parentGroupId, String memberid)
throws IdentityException;
@@ -165,7 +165,7 @@
* <p>Disassociate groups</p>
* @param parents
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void disassociateGroups(Collection<Group> parents, Collection<Group>
members)
throws IdentityException;
@@ -174,7 +174,7 @@
* <p>Disassociate groups</p>
* @param parent
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void disassociateGroups(Group parent, Collection<Group> members)
throws IdentityException;
@@ -183,7 +183,7 @@
* <p>Disassociate groups</p>
* @param parents
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void disassociateGroupsByIds(Collection<String> parents,
Collection<String> members)
throws IdentityException;
@@ -192,7 +192,7 @@
* <p>Disassociate groups</p>
* @param parent
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void disassociateGroupsByIds(String parent, Collection<String> members)
throws IdentityException;
@@ -201,7 +201,7 @@
* <p>Disassociate identities from groups</p>
* @param parents
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void disassociateUsers(Collection<Group> parents, Collection<User>
members)
throws IdentityException;
@@ -210,7 +210,7 @@
* <p>Disassociate identities from groups</p>
* @param parent
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void disassociateUsers(Group parent, Collection<User> members)
throws IdentityException;
@@ -219,7 +219,7 @@
* <p>Disassociate identities from groups</p>
* @param parents
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void disassociateUsersByIds(Collection<String> parents, Collection<String>
members)
throws IdentityException;
@@ -228,7 +228,7 @@
* <p>Disassociate identities from groups</p>
* @param parent
* @param members
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void disassociateUsersByIds(String parent, Collection<String> members)
throws IdentityException;
@@ -238,7 +238,7 @@
* @param parents
* @param members
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
<G extends IdentityType, I extends IdentityType> boolean
isAssociated(Collection<G> parents, Collection<I> members)
throws IdentityException;
@@ -248,7 +248,7 @@
* @param parents
* @param members
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
boolean isAssociatedByIds(Collection<String> parents, Collection<String>
members)
throws IdentityException;
@@ -258,7 +258,7 @@
* @param parent
* @param member
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
<G extends IdentityType, I extends IdentityType> boolean isAssociated(G parent,
I member)
throws IdentityException;
@@ -268,7 +268,7 @@
* @param parent
* @param member
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
boolean isAssociatedByIds(String parent, String member)
throws IdentityException;
@@ -287,7 +287,7 @@
* @param cascade if true also identities from subgroubs will be retreived. Matters
only when parent is set to true.
* Default is false
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(Group group,
String groupType,
@@ -306,7 +306,7 @@
* @param cascade if true also identities from subgroubs will be retreived. Matters
only when parent is set to true.
* Default is false
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(Group group,
String groupType,
@@ -326,7 +326,7 @@
* @param cascade if true also identities from subgroubs will be retreived. Matters
only when parent is set to true.
* Default is false
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(String groupId,
String groupType,
@@ -339,7 +339,7 @@
* @param user child identity
* @param groupType can be null
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(User user,
String groupType) throws IdentityException;
@@ -350,7 +350,7 @@
* @param user child identity
* @param groupType can be null
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(User user,
String groupType,
@@ -362,7 +362,7 @@
* @param userId - id of associated user
* @param groupType can be null
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(String userId,
String groupType,
@@ -373,7 +373,7 @@
*
* @param user child identity
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(User user,
IdentitySearchCriteria criteria) throws
IdentityException;
@@ -383,7 +383,7 @@
*
* @param userId
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(String userId,
IdentitySearchCriteria criteria) throws
IdentityException;
@@ -393,7 +393,7 @@
*
* @param user child identity
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<Group> findAssociatedGroups(User user) throws IdentityException;
@@ -403,7 +403,7 @@
* @param group parent group
* @param cascade if true also identities from subgroubs will be retrieved. Default is
false
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<User> findAssociatedUsers(Group group,
boolean cascade) throws IdentityException;
@@ -414,7 +414,7 @@
* @param group parent group
* @param cascade if true also identities from subgroubs will be retrieved. Default is
false
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<User> findAssociatedUsers(Group group,
boolean cascade,
@@ -426,7 +426,7 @@
* @param groupId parent group id
* @param cascade if true also identities from subgroubs will be retrieved. Default is
false
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<User> findAssociatedUsers(String groupId,
boolean cascade,
@@ -439,7 +439,7 @@
* @param user child identity
* @param groupType can be null
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<Group> findRelatedGroups(User user,
String groupType,
@@ -451,7 +451,7 @@
* @param userId
* @param groupType can be null
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<Group> findRelatedGroups(String userId,
String groupType,
@@ -462,7 +462,7 @@
*
* @param group parent group
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<User> findRelatedUsers(Group group, IdentitySearchCriteria criteria)
throws IdentityException;
@@ -471,7 +471,7 @@
*
* @param groupId parent group id
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Collection<User> findRelatedUsers(String groupId, IdentitySearchCriteria
criteria) throws IdentityException;
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java 2009-05-09
21:28:54 UTC (rev 488)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,8 +22,7 @@
package org.jboss.identity.idm.api;
-import org.jboss.identity.idm.exception.IdentityException;
-import org.jboss.identity.idm.api.query.RoleQuery;
+import org.jboss.identity.idm.common.exception.IdentityException;
import java.util.Collection;
import java.util.Map;
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/cfg/IdentityConfiguration.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/cfg/IdentityConfiguration.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/cfg/IdentityConfiguration.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -23,7 +23,7 @@
package org.jboss.identity.idm.api.cfg;
import org.jboss.identity.idm.api.*;
-import org.jboss.identity.idm.exception.IdentityConfigurationException;
+import org.jboss.identity.idm.common.exception.IdentityConfigurationException;
import java.io.File;
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/cfg/IdentityConfigurationRegistry.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/cfg/IdentityConfigurationRegistry.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/cfg/IdentityConfigurationRegistry.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,7 +22,7 @@
package org.jboss.identity.idm.api.cfg;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
@@ -35,7 +35,7 @@
* Retister object in context
* @param object representing object
* @param name to map object
- * @throws org.jboss.identity.idm.exception.IdentityException thrown if such object is
already registered or operation fail.
+ * @throws org.jboss.identity.idm.common.exception.IdentityException thrown if such
object is already registered or operation fail.
*/
public void register(Object object, String name) throws IdentityException;
@@ -49,7 +49,7 @@
* Retrieve registered object
* @param name
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException thrown if no such object
exists in context
+ * @throws org.jboss.identity.idm.common.exception.IdentityException thrown if no such
object exists in context
*/
public Object getObject(String name) throws IdentityException;
Modified: idm/trunk/idm-auth/pom.xml
===================================================================
--- idm/trunk/idm-auth/pom.xml 2009-05-09 21:28:54 UTC (rev 488)
+++ idm/trunk/idm-auth/pom.xml 2009-05-10 19:15:26 UTC (rev 489)
@@ -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</groupId>
<artifactId>idm-parent</artifactId>
@@ -29,7 +29,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.identity</groupId>
- <artifactId>idm-common</artifactId>
+ <artifactId>idm-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -38,14 +38,28 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>jboss.jbossas.core-libs</groupId>
- <artifactId>jbosssx</artifactId>
- <version>4.0.4.GA</version>
+ <groupId>javax.security</groupId>
+ <artifactId>jacc</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
</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>apache-tomcat</groupId>
- <artifactId>catalina</artifactId>
- <version>5.5.12</version>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
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-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-auth/src/main/java/org/jboss/identity/idm/auth/JBossIdentityIDMLoginModule.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -1,325 +1,367 @@
-///*
-//* JBoss, a division of Red Hat
-//* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-//* by the @authors tag. See the copyright.txt in the distribution for a
-//* full listing of individual contributors.
-//*
-//* This is free software; you can redistribute it and/or modify it
-//* under the terms of the GNU Lesser General Public License as
-//* published by the Free Software Foundation; either version 2.1 of
-//* the License, or (at your option) any later version.
-//*
-//* This software is distributed in the hope that it will be useful,
-//* but WITHOUT ANY WARRANTY; without even the implied warranty of
-//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-//* Lesser General Public License for more details.
-//*
-//* You should have received a copy of the GNU Lesser General Public
-//* License along with this software; if not, write to the Free
-//* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-//* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-//*/
-//
-//package org.jboss.identity.idm.auth;
-//
-//import org.jboss.security.SimpleGroup;
-//import org.jboss.security.auth.spi.UsernamePasswordLoginModule;
-//
-//import javax.security.auth.Subject;
-//import javax.security.auth.login.LoginException;
-//import javax.security.auth.callback.CallbackHandler;
-//import javax.naming.NamingException;
-//import javax.naming.InitialContext;
-//import java.util.Map;
-//import java.util.Set;
-//import java.util.Iterator;
-//import java.security.acl.Group;
-//import java.security.Principal;
-//
-///**
-// * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
-// * @version : 0.1 $
-// */
-//public class JBossIdentityIDMLoginModule extends UsernamePasswordLoginModule
-//{
-//
-// protected String userModuleJNDIName;
-//
-// protected String roleModuleJNDIName;
-//
-// protected String userProfileModuleJNDIName;
-//
-// protected String membershipModuleJNDIName;
-//
-// protected String additionalRole;
-//
-// protected String havingRole;
-//
-// protected String validateUserNameCase;
-//
-// protected String userNameToLowerCase;
-//
-// public void initialize(Subject subject, CallbackHandler callbackHandler, Map
sharedState, Map options)
-// {
-// super.initialize(subject, callbackHandler, sharedState, options);
-//
-// // Get data
-// userModuleJNDIName = (String) options.get("userModuleJNDIName");
-// roleModuleJNDIName = (String) options.get("roleModuleJNDIName");
-// userProfileModuleJNDIName = (String) options
-// .get("userProfileModuleJNDIName");
-// membershipModuleJNDIName = (String) options
-// .get("membershipModuleJNDIName");
-// additionalRole = (String) options.get("additionalRole");
-// havingRole = (String) options.get("havingRole");
-// validateUserNameCase = (String) options.get("validateUserNameCase");
-// userNameToLowerCase = (String) options.get("userNameToLowerCase");
-//
-//// // Some info
-//// log.trace("userModuleJNDIName = " + userModuleJNDIName);
-//// log.trace("roleModuleJNDIName = " + roleModuleJNDIName);
-//// log.trace("userProfileModuleJNDIName = " +
userProfileModuleJNDIName);
-//// log.trace("membershipModuleJNDIName = " + membershipModuleJNDIName);
-//// log.trace("additionalRole = " + additionalRole);
-//// log.trace("havingRole = " + havingRole);
-//// log.trace("validateUserNameCase = " + validateUserNameCase);
-//// log.trace("userNameToLowerCase = " + userNameToLowerCase);
-// }
-//
-// protected String getUsersPassword() throws LoginException
-// {
-// return "";
-// }
-//
-// protected boolean validatePassword(final String inputPassword, String
expectedPassword)
-// {
-//
-// HttpServletRequest request = null;
-// try
-// {
-// request = (HttpServletRequest)
PolicyContext.getContext("javax.servlet.http.HttpServletRequest");
-// }
-// catch(Exception e)
-// {
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.auth;
+
+import org.jboss.security.auth.spi.UsernamePasswordLoginModule;
+import org.jboss.security.SimpleGroup;
+import org.jboss.identity.idm.api.IdentitySessionFactory;
+import org.jboss.identity.idm.api.User;
+import org.jboss.identity.idm.api.IdentitySession;
+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 javax.security.auth.Subject;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.jacc.PolicyContext;
+import javax.naming.NamingException;
+import javax.naming.InitialContext;
+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;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class JBossIdentityIDMLoginModule extends UsernamePasswordLoginModule
+{
+
+ private static Logger log =
Logger.getLogger(JBossIdentityIDMLoginModule.class.getName());
+
+
+ protected String identitySessionFactoryJNDIName;
+
+ protected String realmName;
+
+ protected String roleGroupTypeName;
+
+ protected String userEnabledAttributeName;
+
+ protected String additionalRole;
+
+ protected String associatedGroupType;
+
+ protected String associatedGroupName;
+
+ protected String validateUserNameCase;
+
+ protected String userNameToLowerCase;
+
+ private IdentitySessionFactory identitySessionFactory;
+
+ public void initialize(Subject subject, CallbackHandler callbackHandler, Map
sharedState, Map options)
+ {
+ super.initialize(subject, callbackHandler, sharedState, options);
+
+ // Get data
+ identitySessionFactoryJNDIName = (String)
options.get("identitySessionFactoryJNDIName");
+ realmName = (String) options.get("realmName");
+ roleGroupTypeName = (String) options.get("roleGroupTypeName");
+ userEnabledAttributeName = (String)
options.get("userEnabledAttributeName");
+ additionalRole = (String) options.get("additionalRole");
+ associatedGroupType = (String) options.get("associatedGroupType");
+ associatedGroupName = (String) options.get("associatedGroupName");
+ validateUserNameCase = (String) options.get("validateUserNameCase");
+ userNameToLowerCase = (String) options.get("userNameToLowerCase");
+
+ // 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);
+ }
+
+ protected String getUsersPassword() throws LoginException
+ {
+ return "";
+ }
+
+ protected boolean validatePassword(final String inputPassword, String
expectedPassword)
+ {
+
+ HttpServletRequest request = null;
+ try
+ {
+ request = (HttpServletRequest)
PolicyContext.getContext("javax.servlet.http.HttpServletRequest");
+ }
+ catch(Exception e)
+ {
// log.error(this,e);
-// throw new RuntimeException(e);
-// }
-//
-// Object ssoSuccess = request.getAttribute("ssoSuccess");
-// if(ssoSuccess != null)
-// {
-// return true;
-// }
-//
-// if (inputPassword != null)
-// {
-// try
-// {
-// try
-// {
-//
-// UserStatus userStatus = getUserStatus(inputPassword);
-//
-// // Set the user Status in the request so that the login page can show an
error message accordingly
-// request.setAttribute("org.jboss.portal.userStatus",
userStatus);
-//
-// if (userStatus == UserStatus.DISABLE)
-// {
-// request.setAttribute("org.jboss.portal.loginError",
"Your account is disabled");
-// return false;
-// }
-// else if (userStatus == UserStatus.NOTASSIGNEDTOROLE)
-// {
-// request.setAttribute("org.jboss.portal.loginError",
"The user doesn't have the correct role");
-// return false;
-// }
-// else if ((userStatus == UserStatus.UNEXISTING) || userStatus ==
UserStatus.WRONGPASSWORD)
-// {
-// request.setAttribute("org.jboss.portal.loginError",
"The user doesn't exist or the password is incorrect");
-// return false;
-// }
-// else if (userStatus == UserStatus.OK)
-// {
-// return true;
-// }
-// else
-// {
-// log.error("Unexpected error while logging in");
-// return false;
-// } }
-// catch (Exception e)
-// {
-// log.error("Error when validating password", e);
-// }
-// }
-// catch (Exception e)
-// {
-// log.debug("Failed to validate password", e);
-// }
-// }
-// return false;
-// }
-//
-// protected UserStatus getUserStatus(final String inputPassword)
-// {
-// UserStatus result = UserStatus.OK;
-//
-//// try {
-//// TransactionManager tm = (TransactionManager)new
InitialContext().lookup("java:/TransactionManager");
-//// UserStatus tmp = (UserStatus)Transactions.required(tm, new
Transactions.Runnable()
-//// {
-//// public Object run() throws Exception
-//// {
-//// try
-//// {
-//// User user = getUserModule().findUserByUserName(getUsername());
-//// // 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.getUserName()))
-//// {
-//// return UserStatus.UNEXISTING;
-//// }
-////
-//// boolean enabled = false;
-//// try {
-//// Object enabledS;
-//// enabledS = getUserProfileModule().getProperty(user,
-//// User.INFO_USER_ENABLED);
-//// if (enabledS != null) {
-//// enabled = new Boolean(enabledS.toString());
-//// }
-//// } catch (Exception e) {
-//// e.printStackTrace();
-//// }
-//// if (!enabled) {
-//// return UserStatus.DISABLE;
-//// }
-//// if (havingRole != null)
-//// {
-//// boolean hasTheRole = false;
-//// Set roles = getMembershipModule().getRoles(user);
-//// for (Iterator i = roles.iterator(); i.hasNext();)
-//// {
-//// Role role = (Role)i.next();
-//// if (havingRole.equals(role.getName()))
-//// {
-//// hasTheRole = true;
-//// break;
-//// }
-//// }
-//// if (!hasTheRole)
-//// {
-//// return UserStatus.NOTASSIGNEDTOROLE;
-//// }
-//// }
-//// if (!user.validatePassword(inputPassword))
-//// {
-//// return UserStatus.WRONGPASSWORD;
-//// }
-//// }
-//// catch (NoSuchUserException e1)
-//// {
-//// return UserStatus.UNEXISTING;
-//// }
-//// catch (Exception e)
-//// {
-//// throw new LoginException(e.toString());
-//// }
-//// return null;
-//// }
-//// });
-//// if (tmp != null)
-//// {
-//// result = tmp;
-//// }
-//// } catch (NamingException e1) {
-//// // TODO Auto-generated catch block
-//// e1.printStackTrace();
-//// }
-//// return result;
-// }
-//
-// protected Group[] getRoleSets() throws LoginException
-// {
-//// try {
-//// TransactionManager tm = (TransactionManager) new InitialContext()
-//// .lookup("java:/TransactionManager");
-//// return (Group[]) Transactions.required(tm, new Transactions.Runnable()
-//// {
-//// public Object run() throws Exception
-//// {
-//// Group rolesGroup = new SimpleGroup("Roles");
-////
-//// //
-//// if (additionalRole != null) {
-//// rolesGroup.addMember(createIdentity(additionalRole));
-//// }
-////
-//// try {
-//// User user = getUserModule().findUserByUserName(getUsername());
-//// Set roles = getMembershipModule().getRoles(user);
-////
-//// //
-////
-//// for (Iterator iterator = roles.iterator(); iterator.hasNext();) {
-//// Role role = (Role) iterator.next();
-//// String roleName = role.getName();
-//// try {
-//// Principal p = createIdentity(roleName);
-//// rolesGroup.addMember(p);
-//// } catch (Exception e) {
-//// log.debug("Failed to create principal " + roleName,
e);
-//// }
-//// }
-////
-////
-//// } catch (Exception e) {
-//// throw new LoginException(e.toString());
-//// }
-//// //
-//// return new Group[] { rolesGroup };
-//// }
-//// });
-//// } catch (Exception e) {
-//// Throwable cause = e.getCause();
-//// throw new LoginException(cause.toString());
-//// }
-// }
-//
-// /** Subclass to use the PortalPrincipal to make the username easier to retrieve by
the portal. */
-// protected Principal createIdentity(String username) throws Exception
-// {
-// return new UserPrincipal(username);
-// }
-//
-// protected String getUsername()
-// {
-// if (userNameToLowerCase != null &&
userNameToLowerCase.equalsIgnoreCase("true"))
-// {
-// return super.getUsername().toLowerCase();
-// }
-// return super.getUsername();
-// }
-//
-// protected String[] getUsernameAndPassword() throws LoginException
-// {
-// String[] names = super.getUsernameAndPassword();
-//
-// if (userNameToLowerCase != null &&
userNameToLowerCase.equalsIgnoreCase("true"))
-// {
-// if (names[0] != null)
-// {
-// names[0] = names[0].toLowerCase();
-// }
-// }
-// return names;
-//
-// }
-//}
+ throw new RuntimeException(e);
+ }
+
+
+ // If attribute ssoSuccess is set just let user in
+ Object ssoSuccess = request.getAttribute("ssoSuccess");
+ if(ssoSuccess != null)
+ {
+ return true;
+ }
+
+ if (inputPassword != null)
+ {
+ try
+ {
+ try
+ {
+
+ UserStatus userStatus = getUserStatus(inputPassword);
+
+ // Set the user Status in the request so that the login page can show an
error message accordingly
+ request.setAttribute("org.jboss.identity.idm.userStatus",
userStatus);
+
+ if (userStatus == UserStatus.DISABLE)
+ {
+ //request.setAttribute("org.jboss.identity.idm.loginError",
"Your account is disabled");
+ return false;
+ }
+ else if (userStatus == UserStatus.NOTASSIGNEDTOROLE)
+ {
+ //request.setAttribute("org.jboss.identity.idm.loginError",
"The user doesn't have the correct role");
+ return false;
+ }
+ else if ((userStatus == UserStatus.UNEXISTING) || userStatus ==
UserStatus.WRONGPASSWORD)
+ {
+ //request.setAttribute("org.jboss.identity.idm.loginError",
"The user doesn't exist or the password is incorrect");
+ return false;
+ }
+ else if (userStatus == UserStatus.OK)
+ {
+ return true;
+ }
+ else
+ {
+ log.fine("Unexpected error while logging in");
+ return false;
+ } }
+ catch (Exception e)
+ {
+ log.fine("Error when validating password: " + e);
+ }
+ }
+ catch (Exception e)
+ {
+ log.finer("Failed to validate password: " + e);
+ }
+ }
+ return false;
+ }
+
+ protected UserStatus getUserStatus(final String inputPassword)
+ {
+ UserStatus result = UserStatus.OK;
+
+ try {
+ TransactionManager tm =
TransactionManagerProvider.JBOSS_PROVIDER.getTransactionManager();
+ UserStatus tmp = (UserStatus)Transactions.required(tm, new
Transactions.Runnable()
+ {
+ public Object run() throws Exception
+ {
+ try
+ {
+ IdentitySession ids =
getIdentitySessionFactory().getCurrentIdentitySession(realmName);
+
+ User user = ids.getPersistenceManager().findUser(getUsername());
+
+ // 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 (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);
+ }
+
+ if (!hasTheGroup)
+ {
+ return UserStatus.NOTASSIGNEDTOROLE;
+ }
+ }
+
+ if (!ids.getAttributesManager().validatePassword(user, inputPassword))
+ {
+ return UserStatus.WRONGPASSWORD;
+ }
+
+ }
+ catch (NoSuchUserException e1)
+ {
+ return UserStatus.UNEXISTING;
+ }
+ catch (Exception e)
+ {
+ throw new LoginException(e.toString());
+ }
+ return null;
+ }
+ });
+ if (tmp != null)
+ {
+ result = tmp;
+ }
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ return result;
+ }
+
+ 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
+ {
+ Group rolesGroup = new SimpleGroup("Roles");
+
+ //
+ if (additionalRole != null) {
+ rolesGroup.addMember(createIdentity(additionalRole));
+ }
+
+ 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);
+
+ //
+ 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.finer("Failed to create principal " + roleName +
" " + e);
+ }
+
+ }
+
+ } catch (Exception e) {
+ throw new LoginException(e.toString());
+ }
+ //
+ return new Group[] { rolesGroup };
+ }
+ });
+ } catch (Exception e) {
+ Throwable cause = e.getCause();
+ throw new LoginException(cause.toString());
+ }
+ }
+
+ /** Subclass to use the PortalPrincipal to make the username easier to retrieve by the
portal. */
+ protected Principal createIdentity(String username) throws Exception
+ {
+ return new UserPrincipal(username);
+ }
+
+ protected String getUsername()
+ {
+ if (userNameToLowerCase != null &&
userNameToLowerCase.equalsIgnoreCase("true"))
+ {
+ return super.getUsername().toLowerCase();
+ }
+ return super.getUsername();
+ }
+
+ protected String[] getUsernameAndPassword() throws LoginException
+ {
+ String[] names = super.getUsernameAndPassword();
+
+ if (userNameToLowerCase != null &&
userNameToLowerCase.equalsIgnoreCase("true"))
+ {
+ if (names[0] != null)
+ {
+ names[0] = names[0].toLowerCase();
+ }
+ }
+ return names;
+
+ }
+
+ protected IdentitySessionFactory getIdentitySessionFactory() throws NamingException
+ {
+ if (identitySessionFactory == null)
+ {
+ identitySessionFactory = (IdentitySessionFactory)new
InitialContext().lookup(identitySessionFactoryJNDIName);
+ }
+ return identitySessionFactory;
+ }
+}
Modified: idm/trunk/idm-common/pom.xml
===================================================================
--- idm/trunk/idm-common/pom.xml 2009-05-09 21:28:54 UTC (rev 488)
+++ idm/trunk/idm-common/pom.xml 2009-05-10 19:15:26 UTC (rev 489)
@@ -33,6 +33,17 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</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>
</dependencies>
<reporting>
Copied: idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception (from
rev 485, idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/exception)
Modified:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/FeatureNotSupportedException.java
===================================================================
---
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/exception/FeatureNotSupportedException.java 2009-05-09
11:10:49 UTC (rev 485)
+++
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/FeatureNotSupportedException.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -20,7 +20,7 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.identity.idm.exception;
+package org.jboss.identity.idm.common.exception;
/**
* Exception indicating that the feature is not implemented
Modified:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/IdentityConfigurationException.java
===================================================================
---
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/exception/IdentityConfigurationException.java 2009-05-09
11:10:49 UTC (rev 485)
+++
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/IdentityConfigurationException.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -20,9 +20,9 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.identity.idm.exception;
+package org.jboss.identity.idm.common.exception;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
/**
* Exception indicating some issue in configuration
Modified:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/IdentityException.java
===================================================================
---
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/exception/IdentityException.java 2009-05-09
11:10:49 UTC (rev 485)
+++
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/IdentityException.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.identity.idm.exception;
+package org.jboss.identity.idm.common.exception;
import java.security.GeneralSecurityException;
Added:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/NoSuchUserException.java
===================================================================
---
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/NoSuchUserException.java
(rev 0)
+++
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/NoSuchUserException.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -0,0 +1,46 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.common.exception;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class NoSuchUserException extends IdentityException
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 7328419579811469592L;
+ private String userId;
+
+ public NoSuchUserException(String userId)
+ {
+ super("No such user " + userId);
+ this.userId = this.userId;
+ }
+
+ public String getUserId()
+ {
+ return userId;
+ }
+}
Modified:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/PolicyValidationException.java
===================================================================
---
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/exception/PolicyValidationException.java 2009-05-09
11:10:49 UTC (rev 485)
+++
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/exception/PolicyValidationException.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-package org.jboss.identity.idm.exception;
+package org.jboss.identity.idm.common.exception;
import java.security.GeneralSecurityException;
Copied: idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/p3p (from rev
485, idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/p3p)
Modified:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/p3p/P3PConstants.java
===================================================================
---
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/p3p/P3PConstants.java 2009-05-09
11:10:49 UTC (rev 485)
+++
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/p3p/P3PConstants.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -20,7 +20,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.identity.idm.p3p;
+package org.jboss.identity.idm.common.p3p;
/**
* Class taken from JBoss Portal common module.
Added:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/NestedException.java
===================================================================
---
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/NestedException.java
(rev 0)
+++
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/NestedException.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -0,0 +1,38 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.common.transaction;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5451 $
+ */
+public class NestedException extends RuntimeException
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 8546585764241990455L;
+
+ public NestedException(Throwable throwable)
+ {
+ super(throwable);
+ }
+}
\ No newline at end of file
Added:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/TransactionException.java
===================================================================
---
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/TransactionException.java
(rev 0)
+++
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/TransactionException.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -0,0 +1,48 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.common.transaction;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5451 $
+ */
+public class TransactionException extends RuntimeException
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 8968893103336776336L;
+ public TransactionException()
+ {
+ }
+ public TransactionException(Throwable cause)
+ {
+ super(cause);
+ }
+ public TransactionException(String message)
+ {
+ super(message);
+ }
+ public TransactionException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Added:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/TransactionManagerProvider.java
===================================================================
---
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/TransactionManagerProvider.java
(rev 0)
+++
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/TransactionManagerProvider.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -0,0 +1,54 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.common.transaction;
+
+import javax.transaction.TransactionManager;
+import javax.naming.InitialContext;
+
+/**
+ * Implementations provides access to a transaction manager.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5451 $
+ */
+public interface TransactionManagerProvider
+{
+ /**
+ * Provide access to the transaction manager.
+ *
+ * @return return the transaction manager.
+ * @throws Exception any exception that prevent to get the transaction manager
+ */
+ TransactionManager getTransactionManager() throws Exception;
+
+ /**
+ * JBoss transaction manager provider implementation.
+ */
+ TransactionManagerProvider JBOSS_PROVIDER = new TransactionManagerProvider()
+ {
+ public TransactionManager getTransactionManager() throws Exception
+ {
+ return (TransactionManager)new
InitialContext().lookup("java:/TransactionManager");
+ }
+ };
+}
\ No newline at end of file
Added:
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/Transactions.java
===================================================================
---
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/Transactions.java
(rev 0)
+++
idm/trunk/idm-common/src/main/java/org/jboss/identity/idm/common/transaction/Transactions.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -0,0 +1,704 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.common.transaction;
+
+import javax.transaction.Status;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.NotSupportedException;
+import javax.transaction.HeuristicMixedException;
+import javax.transaction.HeuristicRollbackException;
+import javax.transaction.RollbackException;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Utility class for managing transactions.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5451 $
+ */
+public class Transactions
+{
+
+ /** . */
+ private static Logger log = Logger.getLogger(Transactions.class);
+
+ /** . */
+ private static final String[] STATUS_NAMES = {
+ "STATUS_ACTIVE",
+ "STATUS_MARKED_ROLLBACK",
+ "STATUS_PREPARED",
+ "STATUS_COMMITTED",
+ "STATUS_ROLLEDBACK",
+ "STATUS_UNKNOWN",
+ "STATUS_NO_TRANSACTION",
+ "STATUS_PREPARING",
+ "STATUS_COMMITTING",
+ "STATUS_ROLLING_BACK"};
+
+ /**
+ * Decode the status name.
+ *
+ * @param status the status value
+ * @return the translated status name or null if it is not valid
+ */
+ public static String decodeStatus(int status)
+ {
+ if (status >= 0 && status <= STATUS_NAMES.length)
+ {
+ return STATUS_NAMES[status];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Apply the transaction type before the unit of work.
+ *
+ * @param type the transaction type
+ * @param tm the transaction manager
+ * @return the new transaction if one has been started.
+ * @throws TransactionException
+ * @throws IllegalArgumentException if the type or the transaction manager is null
+ */
+ public static Transaction applyBefore(Type type, TransactionManager tm) throws
TransactionException, IllegalArgumentException
+ {
+ if (tm == null)
+ {
+ throw new IllegalArgumentException("No transaction manager
provided");
+ }
+ if (type == null)
+ {
+ throw new IllegalArgumentException("No type");
+ }
+
+ // Suspend the incoming transaction
+ Transaction oldTx = suspend(tm);
+
+ if (oldTx != null)
+ {
+ type.txBefore(tm, oldTx);
+ }
+ else
+ {
+ type.noTxBefore(tm);
+ }
+
+ return oldTx;
+ }
+
+ /**
+ * Apply the transaction type after the unit of work has been done.
+ *
+ * @param type the transaction type
+ * @param tm the transaction manager
+ * @param oldTx the old transaction if it is not null
+ * @throws TransactionException
+ * @throws IllegalArgumentException if the type of the transaction manager is null
+ */
+ public static void applyAfter(Type type, TransactionManager tm, Transaction oldTx)
throws TransactionException, IllegalArgumentException
+ {
+ if (tm == null)
+ {
+ throw new IllegalArgumentException("No transaction manager
provided");
+ }
+ if (type == null)
+ {
+ throw new IllegalArgumentException("No type");
+ }
+
+ try
+ {
+ if (oldTx != null)
+ {
+ type.txAfter(tm, oldTx);
+ }
+ else
+ {
+ type.noTxAfter(tm);
+ }
+ }
+ finally
+ {
+ if (oldTx != null)
+ {
+ try
+ {
+ resume(tm, oldTx);
+ }
+ catch (TransactionException ignore)
+ {
+ log.error("Was not capable to resume the incoming transaction",
ignore);
+ }
+ }
+ }
+ }
+
+ /**
+ * Apply the transaction type around the unit of work.
+ *
+ * @param type the transaction type
+ * @param tm the transaction manager
+ * @param runnable the unit of work
+ * @return the object returned by the runnable object
+ * @throws NestedException wraps any exception throws by the runnable object
+ * @throws TransactionException
+ * @throws IllegalArgumentException if any method argument is null
+ */
+ public static Object apply(Type type, TransactionManager tm, final Runnable runnable)
throws NestedException, TransactionException, IllegalArgumentException
+ {
+ if (tm == null)
+ {
+ throw new IllegalArgumentException("No transaction manager
provided");
+ }
+ if (runnable == null)
+ {
+ throw new IllegalArgumentException("No code to execute");
+ }
+ if (type == null)
+ {
+ throw new IllegalArgumentException("No type");
+ }
+
+ // Any throwable thrown by the wrapped code
+ Throwable throwable = null;
+
+ // Any object returned by the wrapped code
+ Object ret = null;
+
+ // Suspend the incoming transaction
+ Transaction oldTx = suspend(tm);
+
+ try
+ {
+ if (oldTx != null)
+ {
+ type.txBefore(tm, oldTx);
+ try
+ {
+ ret = runnable.run();
+ }
+ catch (Throwable t)
+ {
+ throwable = t;
+ }
+ finally
+ {
+ type.txAfter(tm, oldTx);
+ }
+ }
+ else
+ {
+ type.noTxBefore(tm);
+ try
+ {
+ ret = runnable.run();
+ }
+ catch (Throwable t)
+ {
+ throwable = t;
+ }
+ finally
+ {
+ type.noTxAfter(tm);
+ }
+ }
+ }
+ finally
+ {
+ if (oldTx != null)
+ {
+ try
+ {
+ resume(tm, oldTx);
+ }
+ catch (TransactionException ignore)
+ {
+ log.error("Was not capable to resume the incoming transaction",
ignore);
+ }
+ }
+ }
+ if (throwable != null)
+ {
+ if (throwable instanceof Error)
+ {
+ throw (Error)throwable;
+ }
+ else
+ {
+ throw new NestedException(throwable);
+ }
+ }
+ else
+ {
+ return ret;
+ }
+ }
+
+ public static Object notSupported(TransactionManager tm, Runnable runnable)
+ throws NestedException, TransactionException
+ {
+ return apply(TYPE_NOT_SUPPORTED, tm, runnable);
+ }
+
+ public static Object never(TransactionManager tm, Runnable runnable)
+ throws NestedException, TransactionException
+ {
+ return apply(TYPE_NEVER, tm, runnable);
+ }
+
+ public static Object mandatory(TransactionManager tm, Runnable runnable)
+ throws NestedException, TransactionException
+ {
+ return apply(TYPE_MANDATORY, tm, runnable);
+ }
+
+ public static Object supports(TransactionManager tm, Runnable runnable)
+ throws NestedException, TransactionException
+ {
+ return apply(TYPE_SUPPORTS, tm, runnable);
+ }
+
+ public static Object required(TransactionManager tm, Runnable runnable)
+ throws NestedException, TransactionException
+ {
+ return apply(TYPE_REQUIRED, tm, runnable);
+ }
+
+ public static Object requiresNew(TransactionManager tm, Runnable runnable)
+ throws NestedException, TransactionException
+ {
+ return apply(TYPE_REQUIRES_NEW, tm, runnable);
+ }
+
+ /**
+ * Begin a new transaction.
+ *
+ * @param tm the transaction manager
+ * @throws IllegalArgumentException if the tm is null
+ */
+ public static void begin(TransactionManager tm) throws IllegalArgumentException,
TransactionException
+ {
+ try
+ {
+ if (tm == null)
+ {
+ throw new IllegalArgumentException("No transaction manager");
+ }
+ tm.begin();
+ }
+ catch (SystemException e)
+ {
+ log.error("Problem when beginning transaction", e);
+ throw new TransactionException(e);
+ }
+ catch (NotSupportedException e)
+ {
+ log.error("Problem when beginning transaction", e);
+ throw new TransactionException(e);
+ }
+ }
+
+ /**
+ * Mark the transaction as rollback only.
+ *
+ * @param tx the transaction to mark as rollback only
+ * @throws IllegalArgumentException if the transaction is null
+ * @throws TransactionException
+ */
+ private static void setRollbackOnly(Transaction tx) throws IllegalArgumentException,
TransactionException
+ {
+ try
+ {
+ if (tx == null)
+ {
+ throw new IllegalArgumentException("No transaction to set rollback
only");
+ }
+ tx.setRollbackOnly();
+ }
+ catch (SystemException e)
+ {
+ log.error("Problem when setting transaction as rollback only", e);
+ throw new TransactionException(e);
+ }
+ }
+
+ /**
+ * Mark the active transaction for this thread as rollback only
+ *
+ * @see #setRollbackOnly(javax.transaction.Transaction)
+ * @param tm the transaction manager
+ * @throws IllegalArgumentException if the tm is null
+ */
+ public static void setRollbackOnly(TransactionManager tm) throws
IllegalArgumentException, TransactionException
+ {
+ try
+ {
+ if (tm == null)
+ {
+ throw new IllegalArgumentException("No transaction manager");
+ }
+ Transaction tx = tm.getTransaction();
+ if (tx == null)
+ {
+ throw new TransactionException("No active transaction to set rollback
only");
+ }
+ setRollbackOnly(tx);
+ }
+ catch (SystemException e)
+ {
+ log.error("Problem when setting transaction as rollback only", e);
+ throw new TransactionException(e);
+ }
+ }
+
+ public void safeSetRollbackOnly(TransactionManager tm)
+ {
+ try
+ {
+ setRollbackOnly(tm);
+ }
+ catch (IllegalArgumentException e)
+ {
+ log.error("", e);
+ }
+ catch (TransactionException e)
+ {
+ log.error("", e);
+ }
+ }
+
+ public static void safeEnd(TransactionManager tm)
+ {
+ try
+ {
+ end(tm);
+ }
+ catch (IllegalArgumentException e)
+ {
+ log.error("", e);
+ }
+ catch (TransactionException e)
+ {
+ log.error("", e);
+ }
+ }
+
+ /**
+ * Terminate the active transaction for this thread. If the transaction is marked for
rollback
+ * then it is rollbacked otherwise it is commited.
+ *
+ * @param tm the transaction manager
+ * @return true if commit happened, false otherwise
+ * @throws IllegalArgumentException if the tm is null
+ */
+ public static boolean end(TransactionManager tm) throws IllegalArgumentException,
TransactionException
+ {
+ try
+ {
+ if (tm == null)
+ {
+ throw new IllegalArgumentException("No transaction manager");
+ }
+ int status = tm.getStatus();
+ switch (status)
+ {
+ case Status.STATUS_MARKED_ROLLBACK:
+ tm.rollback();
+ return false;
+ case Status.STATUS_ACTIVE:
+ tm.commit();
+ return true;
+ default:
+ throw new TransactionException("Abnormal status for ending a tx " +
STATUS_NAMES[status]);
+ }
+ }
+ catch (SystemException e)
+ {
+ log.error("Problem when ending transaction", e);
+ throw new TransactionException(e);
+ }
+ catch (HeuristicMixedException e)
+ {
+ log.error("Problem when ending transaction", e);
+ throw new TransactionException(e);
+ }
+ catch (HeuristicRollbackException e)
+ {
+ log.error("Problem when ending transaction", e);
+ throw new TransactionException(e);
+ }
+ catch (RollbackException e)
+ {
+ log.error("Problem when ending transaction", e);
+ throw new TransactionException(e);
+ }
+ }
+
+ /**
+ * Associate the thread with a transaction
+ *
+ * @param tm the transaction manager
+ * @param tx the transaction to associate with the this thread
+ * @throws IllegalArgumentException if any argument is null
+ * @throws TransactionException
+ */
+ public static void resume(TransactionManager tm, Transaction tx) throws
IllegalArgumentException, TransactionException
+ {
+ try
+ {
+ if (tm == null)
+ {
+ throw new IllegalArgumentException("No transaction manager");
+ }
+ if (tx == null)
+ {
+ throw new IllegalArgumentException("No transaction to resume");
+ }
+ tm.resume(tx);
+ }
+ catch (Exception e)
+ {
+ log.error("Problem when resuming transaction", e);
+ throw new TransactionException(e);
+ }
+ }
+
+ /**
+ * Disassociate the current thread with the active transaction.
+ *
+ * @param tm the transaction manager
+ * @return the transaction previously associated with this thread
+ * @throws IllegalArgumentException if the transaction manager is null
+ * @throws TransactionException
+ */
+ public static Transaction suspend(TransactionManager tm) throws
IllegalArgumentException, TransactionException
+ {
+ try
+ {
+ if (tm == null)
+ {
+ throw new IllegalArgumentException("No transaction manager");
+ }
+ return tm.suspend();
+ }
+ catch (SystemException e)
+ {
+ log.error("Problem when suspending transaction", e);
+ throw new TransactionException(e);
+ }
+ }
+
+ public interface Runnable
+ {
+ Object run() throws Exception;
+ }
+
+ public abstract static class Type
+ {
+ private final String name;
+
+ private Type(String name)
+ {
+ this.name = name;
+ }
+
+ public Transaction before(TransactionManager tm)
+ {
+ return applyBefore(this, tm);
+ }
+
+ public void after(TransactionManager tm, Transaction oldTx)
+ {
+ applyAfter(this, tm, oldTx);
+ }
+
+ abstract void txBefore(TransactionManager tm, Transaction oldTx) throws
TransactionException;
+
+ abstract void txAfter(TransactionManager tm, Transaction oldTx);
+
+ abstract void noTxBefore(TransactionManager tm) throws TransactionException;
+
+ abstract void noTxAfter(TransactionManager tm);
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String toString()
+ {
+ return name;
+ }
+ }
+
+ public static final Type TYPE_NOT_SUPPORTED = new Type("NOT_SUPPORTED")
+ {
+ void txBefore(TransactionManager tm, Transaction oldTx)
+ {
+ }
+ void txAfter(TransactionManager tm, Transaction oldTx)
+ {
+ }
+ void noTxBefore(TransactionManager tm)
+ {
+ }
+ void noTxAfter(TransactionManager tm)
+ {
+ }
+ };
+
+ public static final Type TYPE_SUPPORTS = new Type("SUPPORTS")
+ {
+ void txBefore(TransactionManager tm, Transaction oldTx) throws
TransactionException
+ {
+ resume(tm, oldTx);
+ }
+ void txAfter(TransactionManager tm, Transaction oldTx)
+ {
+ try
+ {
+ suspend(tm);
+ }
+ catch (IllegalStateException ignore)
+ {
+ log.error("Problem when suspending transaction", ignore);
+ }
+ }
+ void noTxBefore(TransactionManager tm)
+ {
+ }
+ void noTxAfter(TransactionManager tm)
+ {
+ }
+ };
+
+ public static final Type TYPE_REQUIRED = new Type("REQUIRED")
+ {
+ void txBefore(TransactionManager tm, Transaction oldTx)
+ {
+ resume(tm, oldTx);
+ }
+ void txAfter(TransactionManager tm, Transaction oldTx)
+ {
+ try
+ {
+ suspend(tm);
+ }
+ catch (TransactionException ignore)
+ {
+ log.error("Problem when suspending transaction", ignore);
+ }
+ }
+ void noTxBefore(TransactionManager tm) throws TransactionException
+ {
+ begin(tm);
+ }
+ void noTxAfter(TransactionManager tm)
+ {
+ try
+ {
+ end(tm);
+ }
+ catch (IllegalStateException ignore)
+ {
+ log.error("Problem when ending transaction", ignore);
+ }
+ }
+ };
+
+ public static final Type TYPE_REQUIRES_NEW = new Type("REQUIRES_NEW")
+ {
+ void txBefore(TransactionManager tm, Transaction oldTx) throws
TransactionException
+ {
+ begin(tm);
+ }
+ void txAfter(TransactionManager tm, Transaction oldTx)
+ {
+ try
+ {
+ end(tm);
+ }
+ catch (IllegalStateException ignore)
+ {
+ log.error("Problem when ending transaction", ignore);
+ }
+ }
+ void noTxBefore(TransactionManager tm) throws TransactionException
+ {
+ begin(tm);
+ }
+ void noTxAfter(TransactionManager tm)
+ {
+ try
+ {
+ end(tm);
+ }
+ catch (IllegalStateException ignore)
+ {
+ log.error("Problem when ending transaction", ignore);
+ }
+ }
+ };
+
+ public static final Type TYPE_MANDATORY = new Type("MANDATORY")
+ {
+ void txBefore(TransactionManager tm, Transaction oldTx) throws
TransactionException
+ {
+ resume(tm, oldTx);
+ }
+ void txAfter(TransactionManager tm, Transaction oldTx)
+ {
+ }
+ void noTxBefore(TransactionManager tm) throws TransactionException
+ {
+ throw new TransactionException("No incoming transaction");
+ }
+ void noTxAfter(TransactionManager tm)
+ {
+ throw new UnsupportedOperationException("Should never ne called");
+ }
+ };
+
+ public static final Type TYPE_NEVER = new Type("NEVER")
+ {
+ void txBefore(TransactionManager tm, Transaction oldTx) throws
TransactionException
+ {
+ throw new TransactionException("Need no incoming transaction");
+ }
+ void txAfter(TransactionManager tm, Transaction oldTx)
+ {
+ throw new UnsupportedOperationException("Should never ne called");
+ }
+ void noTxBefore(TransactionManager tm)
+ {
+ }
+ void noTxAfter(TransactionManager tm)
+ {
+ }
+ };
+}
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySessionFactoryImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySessionFactoryImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySessionFactoryImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -28,7 +28,7 @@
import org.jboss.identity.idm.api.IdentitySession;
import org.jboss.identity.idm.api.IdentitySessionFactory;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.impl.api.session.IdentitySessionImpl;
import org.jboss.identity.idm.impl.configuration.IdentitySessionConfigurationContext;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -23,25 +23,12 @@
package org.jboss.identity.idm.impl.api.query;
import org.jboss.identity.idm.api.query.GroupQuery;
-import org.jboss.identity.idm.api.query.UnsupportedQueryCriterium;
-import org.jboss.identity.idm.api.query.QueryException;
-import org.jboss.identity.idm.api.SortOrder;
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.User;
-import org.jboss.identity.idm.api.Role;
-import org.jboss.identity.idm.impl.NotYetImplementedException;
-import org.jboss.identity.idm.impl.api.session.IdentitySessionImpl;
import org.jboss.identity.idm.impl.api.model.GroupId;
-import org.jboss.identity.idm.impl.api.model.SimpleGroup;
-import org.jboss.identity.idm.impl.api.model.SimpleUser;
import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
-import org.jboss.identity.idm.exception.IdentityException;
-import java.util.Collection;
-import java.util.List;
import java.util.Set;
-import java.util.HashSet;
-import java.util.LinkedList;
import java.util.Collections;
/**
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -23,30 +23,11 @@
package org.jboss.identity.idm.impl.api.query;
import org.jboss.identity.idm.api.query.RoleQuery;
-import org.jboss.identity.idm.api.query.GroupQuery;
-import org.jboss.identity.idm.api.query.UnsupportedQueryCriterium;
-import org.jboss.identity.idm.api.query.QueryException;
-import org.jboss.identity.idm.api.SortOrder;
-import org.jboss.identity.idm.api.Role;
import org.jboss.identity.idm.api.User;
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.RoleType;
-import org.jboss.identity.idm.api.IdentityType;
-import org.jboss.identity.idm.impl.api.session.IdentitySessionImpl;
-import org.jboss.identity.idm.impl.api.model.SimpleUser;
-import org.jboss.identity.idm.impl.api.model.GroupId;
-import org.jboss.identity.idm.impl.api.model.SimpleGroup;
-import org.jboss.identity.idm.impl.api.model.SimpleRoleType;
-import org.jboss.identity.idm.impl.api.model.SimpleRole;
import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
-import org.jboss.identity.idm.impl.NotYetImplementedException;
-import org.jboss.identity.idm.exception.IdentityException;
-import org.jboss.identity.idm.exception.FeatureNotSupportedException;
-import java.util.Collection;
-import java.util.List;
-import java.util.LinkedList;
-
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -23,21 +23,10 @@
package org.jboss.identity.idm.impl.api.query;
import org.jboss.identity.idm.api.query.UserQuery;
-import org.jboss.identity.idm.api.query.QueryException;
-import org.jboss.identity.idm.api.query.UnsupportedQueryCriterium;
-import org.jboss.identity.idm.api.User;
import org.jboss.identity.idm.api.Group;
-import org.jboss.identity.idm.api.SortOrder;
-import org.jboss.identity.idm.impl.api.session.IdentitySessionImpl;
import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
-import org.jboss.identity.idm.impl.NotYetImplementedException;
-import org.jboss.identity.idm.exception.IdentityException;
-import java.util.Collection;
-import java.util.List;
import java.util.Set;
-import java.util.HashSet;
-import java.util.LinkedList;
import java.util.Collections;
/**
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/IdentitySessionImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/IdentitySessionImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/IdentitySessionImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -42,8 +42,8 @@
import org.jboss.identity.idm.api.query.GroupQueryBuilder;
import org.jboss.identity.idm.api.query.RoleQueryBuilder;
import org.jboss.identity.idm.api.query.QueryException;
-import org.jboss.identity.idm.exception.IdentityException;
-import org.jboss.identity.idm.exception.FeatureNotSupportedException;
+import org.jboss.identity.idm.common.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.FeatureNotSupportedException;
import org.jboss.identity.idm.spi.store.IdentityStoreSession;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
import org.jboss.identity.idm.spi.repository.IdentityStoreRepository;
@@ -66,7 +66,6 @@
import org.jboss.identity.idm.impl.api.query.UserQueryBuilderImpl;
import org.jboss.identity.idm.impl.api.query.GroupQueryBuilderImpl;
import org.jboss.identity.idm.impl.api.query.RoleQueryBuilderImpl;
-import org.jboss.identity.idm.impl.NotYetImplementedException;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
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-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AttributesManagerImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -30,7 +30,7 @@
import org.jboss.identity.idm.api.CredentialType;
import org.jboss.identity.idm.api.Credential;
import org.jboss.identity.idm.api.Attribute;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
import
org.jboss.identity.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
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-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -29,7 +29,7 @@
import org.jboss.identity.idm.api.PersistenceManagerFeaturesDescription;
import org.jboss.identity.idm.api.IdentitySearchCriteria;
import org.jboss.identity.idm.api.IdentitySearchCriteriumType;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.store.IdentityObjectSearchCriteriaType;
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-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -30,13 +30,12 @@
import org.jboss.identity.idm.api.RelationshipManagerFeaturesDescription;
import org.jboss.identity.idm.api.IdentitySearchCriteria;
import org.jboss.identity.idm.api.IdentitySearchCriteriumType;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.store.IdentityObjectSearchCriteriaType;
-import org.jboss.identity.idm.impl.NotYetImplementedException;
import org.jboss.identity.idm.impl.api.session.managers.AbstractManager;
import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
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-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -32,7 +32,7 @@
import org.jboss.identity.idm.api.RoleManagerFeaturesDescription;
import org.jboss.identity.idm.api.IdentitySearchCriteria;
import org.jboss.identity.idm.api.IdentitySearchCriteriumType;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAttributeStoreWrapper.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAttributeStoreWrapper.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAttributeStoreWrapper.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -30,7 +30,7 @@
import org.jboss.identity.idm.spi.model.IdentityObject;
import
org.jboss.identity.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
import org.jboss.identity.idm.spi.cache.IdentityStoreCacheProvider;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import java.util.logging.Logger;
import java.util.Set;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheIdentityStoreWrapper.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -34,7 +34,7 @@
import org.jboss.identity.idm.spi.configuration.IdentityStoreConfigurationContext;
import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
import org.jboss.identity.idm.spi.cache.IdentityStoreCacheProvider;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import java.util.Map;
import java.util.Collection;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/IdentityConfigurationImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -31,8 +31,8 @@
import
org.jboss.identity.idm.impl.api.session.mapper.DirectIdentityObjectTypeMapperImpl;
import org.jboss.identity.idm.impl.api.session.mapper.IdentityObjectTypeMapperImpl;
import org.jboss.identity.idm.impl.api.IdentitySessionFactoryImpl;
-import org.jboss.identity.idm.exception.IdentityException;
-import org.jboss.identity.idm.exception.IdentityConfigurationException;
+import org.jboss.identity.idm.common.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityConfigurationException;
import org.jboss.identity.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
import
org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import
org.jboss.identity.idm.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -37,7 +37,7 @@
import org.jboss.identity.idm.spi.configuration.metadata.RelationshipMetaData;
import
org.jboss.identity.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
import org.jboss.identity.idm.spi.configuration.metadata.IdentityObjectTypeMetaData;
-import org.jboss.identity.idm.exception.IdentityConfigurationException;
+import org.jboss.identity.idm.common.exception.IdentityConfigurationException;
import org.jboss.identity.idm.impl.api.attribute.IdentityObjectAttributeMetaDataImpl;
import org.jboss.identity.idm.impl.configuration.jaxb2.generated.JbossIdentityType;
import org.jboss.identity.idm.impl.configuration.jaxb2.generated.IdentityStoreType;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/AbstractIdentityStoreRepository.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -32,7 +32,7 @@
import org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreMappingMetaData;
import org.jboss.identity.idm.spi.configuration.IdentityRepositoryConfigurationContext;
import org.jboss.identity.idm.spi.cache.IdentityStoreCacheProvider;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.impl.helper.SecurityActions;
import org.jboss.identity.idm.impl.cache.JBossCacheIdentityStoreWrapper;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/FallbackIdentityStoreRepository.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -41,7 +41,7 @@
import org.jboss.identity.idm.spi.model.IdentityObjectCredentialType;
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.impl.store.SimpleIdentityStoreInvocationContext;
import org.jboss.identity.idm.impl.api.session.managers.RoleManagerImpl;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/RepositoryIdentityStoreSessionImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/RepositoryIdentityStoreSessionImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/RepositoryIdentityStoreSessionImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -23,7 +23,7 @@
package org.jboss.identity.idm.impl.repository;
import org.jboss.identity.idm.spi.store.IdentityStoreSession;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import java.util.Map;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/repository/WrapperIdentityStoreRepository.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -38,7 +38,7 @@
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
import org.jboss.identity.idm.spi.exception.OperationNotSupportedException;
import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.impl.store.SimpleIdentityStoreInvocationContext;
import java.util.Map;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/store/FeaturesMetaDataImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -29,7 +29,7 @@
import java.util.Map;
import java.util.Set;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.spi.configuration.metadata.IdentityObjectTypeMetaData;
import
org.jboss.identity.idm.spi.configuration.metadata.IdentityStoreConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.metadata.RelationshipMetaData;
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/types/SimpleIdentityObject.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/types/SimpleIdentityObject.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/types/SimpleIdentityObject.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -21,7 +21,7 @@
*/
package org.jboss.identity.idm.impl.types;
-import org.jboss.identity.idm.exception.PolicyValidationException;
+import org.jboss.identity.idm.common.exception.PolicyValidationException;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
Modified:
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/opends/OpenDSService.java
===================================================================
---
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/opends/OpenDSService.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/opends/OpenDSService.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -23,15 +23,12 @@
package org.jboss.identity.idm.opends;
import java.io.File;
-import java.io.InputStream;
import java.net.URL;
import java.net.URISyntaxException;
import org.opends.server.util.EmbeddedUtils;
import org.opends.server.types.DirectoryEnvironmentConfig;
import org.opends.server.types.InitializationException;
-import org.jboss.identity.idm.impl.helper.SecurityActions;
-import org.jboss.identity.idm.exception.IdentityException;
/**
* Simple service class that enables to bootstrap OpenDS LDAP server and to manage its
lifecycle
Modified: idm/trunk/idm-hibernate/pom.xml
===================================================================
--- idm/trunk/idm-hibernate/pom.xml 2009-05-09 21:28:54 UTC (rev 488)
+++ idm/trunk/idm-hibernate/pom.xml 2009-05-10 19:15:26 UTC (rev 489)
@@ -65,11 +65,11 @@
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.2</version>
</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>
<dependency>
Modified:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObject.java
===================================================================
---
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObject.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/model/hibernate/HibernateIdentityObject.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -40,11 +40,9 @@
import javax.persistence.FetchType;
import javax.persistence.UniqueConstraint;
import javax.persistence.JoinColumn;
-import javax.persistence.NamedQueries;
-import javax.persistence.NamedQuery;
import javax.persistence.JoinTable;
-import org.jboss.identity.idm.exception.PolicyValidationException;
+import org.jboss.identity.idm.common.exception.PolicyValidationException;
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectCredentialType;
import org.hibernate.annotations.Cascade;
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-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -41,7 +41,7 @@
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.criterion.Restrictions;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject;
import org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute;
import
org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute;
Modified:
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreSessionImpl.java
===================================================================
---
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreSessionImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-hibernate/src/main/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreSessionImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -23,7 +23,7 @@
package org.jboss.identity.idm.impl.store.hibernate;
import org.jboss.identity.idm.spi.store.IdentityStoreSession;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.hibernate.SessionFactory;
/**
Modified:
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/model/ldap/LDAPIdentityObjectImpl.java
===================================================================
---
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/model/ldap/LDAPIdentityObjectImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/model/ldap/LDAPIdentityObjectImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -24,7 +24,7 @@
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectType;
-import org.jboss.identity.idm.exception.PolicyValidationException;
+import org.jboss.identity.idm.common.exception.PolicyValidationException;
import java.util.Set;
import java.util.Map;
Modified:
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java
===================================================================
---
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -56,7 +56,7 @@
import javax.naming.ldap.LdapName;
import javax.naming.ldap.SortControl;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.impl.NotYetImplementedException;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
import org.jboss.identity.idm.impl.helper.Tools;
Modified:
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreSessionImpl.java
===================================================================
---
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreSessionImpl.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-ldap/src/main/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreSessionImpl.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -23,7 +23,7 @@
package org.jboss.identity.idm.impl.store.ldap;
import org.jboss.identity.idm.spi.store.IdentityStoreSession;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import javax.naming.ldap.LdapContext;
import javax.naming.ldap.InitialLdapContext;
Modified:
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/configuration/IdentityConfigurationContextRegistry.java
===================================================================
---
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/configuration/IdentityConfigurationContextRegistry.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/configuration/IdentityConfigurationContextRegistry.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,7 +22,7 @@
package org.jboss.identity.idm.spi.configuration;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
@@ -35,7 +35,7 @@
* Retister object in context
* @param object representing object
* @param name to map object
- * @throws org.jboss.identity.idm.exception.IdentityException thrown if such object is
already registered or operation fail.
+ * @throws org.jboss.identity.idm.common.exception.IdentityException thrown if such
object is already registered or operation fail.
*/
public void register(Object object, String name) throws IdentityException;
@@ -49,7 +49,7 @@
* Retrieve registered object
* @param name
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException thrown if no such object
exists in context
+ * @throws org.jboss.identity.idm.common.exception.IdentityException thrown if no such
object exists in context
*/
public Object getObject(String name) throws IdentityException;
}
Modified:
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/exception/IdentityTypeNotSupportedException.java
===================================================================
---
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/exception/IdentityTypeNotSupportedException.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/exception/IdentityTypeNotSupportedException.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -21,7 +21,7 @@
*/
package org.jboss.identity.idm.spi.exception;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
/**
* <p>Represents an exception that
Modified:
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/exception/OperationNotSupportedException.java
===================================================================
---
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/exception/OperationNotSupportedException.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/exception/OperationNotSupportedException.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,7 +22,7 @@
package org.jboss.identity.idm.spi.exception;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
/**
* Identity operation not supported exception
Modified:
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/model/IdentityObject.java
===================================================================
---
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/model/IdentityObject.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/model/IdentityObject.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,7 +22,7 @@
package org.jboss.identity.idm.spi.model;
-import org.jboss.identity.idm.exception.PolicyValidationException;
+import org.jboss.identity.idm.common.exception.PolicyValidationException;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
@@ -52,7 +52,7 @@
/**
* Validate configured Policies
- * @throws org.jboss.identity.idm.exception.PolicyValidationException
+ * @throws org.jboss.identity.idm.common.exception.PolicyValidationException
*/
void validatePolicy() throws PolicyValidationException;
}
Modified:
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/repository/IdentityStoreRepository.java
===================================================================
---
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/repository/IdentityStoreRepository.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/repository/IdentityStoreRepository.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -27,9 +27,8 @@
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.store.IdentityStore;
import org.jboss.identity.idm.spi.store.AttributeStore;
-import
org.jboss.identity.idm.spi.configuration.metadata.IdentityRepositoryConfigurationMetaData;
import org.jboss.identity.idm.spi.configuration.IdentityRepositoryConfigurationContext;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
/**
* IdentityStoreRepository exposes identity object management
Modified:
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/AttributeStore.java
===================================================================
---
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/AttributeStore.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/AttributeStore.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -26,7 +26,7 @@
import org.jboss.identity.idm.spi.model.IdentityObject;
import org.jboss.identity.idm.spi.model.IdentityObjectAttribute;
import
org.jboss.identity.idm.spi.configuration.metadata.IdentityObjectAttributeMetaData;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import java.util.Set;
import java.util.Map;
@@ -50,7 +50,7 @@
* @param invocationContext
* @param identityType @return names of supported attributes
* @return
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
Set<String> getSupportedAttributeNames(IdentityStoreInvocationContext
invocationContext, IdentityObjectType identityType)
throws IdentityException;
Modified:
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java
===================================================================
---
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/FeaturesMetaData.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -26,7 +26,7 @@
import org.jboss.identity.idm.spi.model.IdentityObjectType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectCredentialType;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
/**
* Describe the features supported by an Identity Store
@@ -84,7 +84,7 @@
* @param toType
* @param relationshipType
* @return true is given relationship can be persisted or retrieved
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
boolean isRelationshipTypeSupported(IdentityObjectType fromType, IdentityObjectType
toType,
IdentityObjectRelationshipType relationshipType)
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-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStore.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -34,7 +34,7 @@
import org.jboss.identity.idm.spi.configuration.IdentityStoreConfigurationContext;
import org.jboss.identity.idm.spi.model.IdentityObjectCredential;
import org.jboss.identity.idm.spi.search.IdentityObjectSearchCriteria;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
/**
* Represents an Identity Store. Implementation of this interface perform operations on
real identity storage like DB or LDAP
Modified:
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStoreSession.java
===================================================================
---
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStoreSession.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStoreSession.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,7 +22,7 @@
package org.jboss.identity.idm.spi.store;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
/**
* Session related to the identity persistence store. Created by
IdentityStoreSessionFactory
@@ -41,19 +41,19 @@
/**
* Close this session
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void close() throws IdentityException;
/**
* Save all pending changes
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void save() throws IdentityException;
/**
* Clear this session
- * @throws org.jboss.identity.idm.exception.IdentityException
+ * @throws org.jboss.identity.idm.common.exception.IdentityException
*/
void clear() throws IdentityException;
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-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-spi/src/main/java/org/jboss/identity/idm/spi/store/IdentityStoreSessionFactory.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -22,7 +22,7 @@
package org.jboss.identity.idm.spi.store;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/OrganizationTest.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -30,7 +30,7 @@
import org.jboss.identity.idm.api.Attribute;
import org.jboss.identity.idm.api.AttributeDescription;
import org.jboss.identity.idm.api.Credential;
-import org.jboss.identity.idm.p3p.P3PConstants;
+import org.jboss.identity.idm.common.p3p.P3PConstants;
import java.util.Collection;
import java.util.Map;
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/hibernate/HibernateIdentityStoreTestCase.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -40,7 +40,7 @@
import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
import org.jboss.identity.idm.impl.IdentityTestPOJO;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.unit.api.pojo.annotations.Create;
import org.jboss.unit.api.pojo.annotations.Test;
import org.hibernate.Session;
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreTestCase.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreTestCase.java 2009-05-09
21:28:54 UTC (rev 488)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreTestCase.java 2009-05-10
19:15:26 UTC (rev 489)
@@ -39,7 +39,7 @@
import org.jboss.identity.idm.impl.configuration.IdentityStoreConfigurationContextImpl;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
import org.jboss.identity.idm.impl.LDAPTestPOJO;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.unit.api.pojo.annotations.Create;
import org.jboss.unit.api.pojo.annotations.Destroy;
import org.jboss.unit.api.pojo.annotations.Test;