Author: bdaw
Date: 2009-11-11 15:46:11 -0500 (Wed, 11 Nov 2009)
New Revision: 925
Added:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/GroupKey.java
Removed:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RealmManager.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/GroupId.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleGroupType.java
Modified:
idm/trunk/example/simple/src/test/java/org/jboss/identity/idm/example/InjectSFTestCase.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/Group.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentityType.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/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/User.java
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/query/GroupQueryBuilder.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQueryBuilder.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQueryBuilder.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/APICacheProvider.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/GroupSearch.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/RoleSearch.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/RoleTypeSearch.java
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/UserSearch.java
idm/trunk/idm-auth/src/main/java/org/jboss/identity/idm/auth/JBossIdentityIDMLoginModule.java
idm/trunk/idm-cache/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAPICacheProviderImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchCriteriaImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleGroup.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleUser.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/AbstractQuery.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/AbstractQueryBuilder.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryBuilderImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryExecutorImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryBuilderImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryBuilderImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AttributesManagerImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/RelationshipSearchImpl.java
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupQueryTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleManagerTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleQueryTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/UserQueryTest.java
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreTestCase.java
Log:
- API refactoring introducing IdentityType.getKey(). groupKey instead of id should be less
confusing
Modified:
idm/trunk/example/simple/src/test/java/org/jboss/identity/idm/example/InjectSFTestCase.java
===================================================================
---
idm/trunk/example/simple/src/test/java/org/jboss/identity/idm/example/InjectSFTestCase.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/example/simple/src/test/java/org/jboss/identity/idm/example/InjectSFTestCase.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -89,30 +89,30 @@
// Use username nad group ids instead of objects
- String johnDoeUser =
identitySession.getPersistenceManager().createUser("John Doe").getId();
- String aliceUser =
identitySession.getPersistenceManager().createUser("Alice").getId();
- String evaUser =
identitySession.getPersistenceManager().createUser("Eva").getId();
+ String johnDoeUser =
identitySession.getPersistenceManager().createUser("John Doe").getKey();
+ String aliceUser =
identitySession.getPersistenceManager().createUser("Alice").getKey();
+ String evaUser =
identitySession.getPersistenceManager().createUser("Eva").getKey();
- String acmeOrgId =
identitySession.getPersistenceManager().createGroup("ACME",
ORGANIZATION).getId();
+ String acmeOrgId =
identitySession.getPersistenceManager().createGroup("ACME",
ORGANIZATION).getKey();
- String itGroupId =
identitySession.getPersistenceManager().createGroup("IT", GROUP).getId();
- String hrGroupId =
identitySession.getPersistenceManager().createGroup("HR", GROUP).getId();
+ String itGroupId =
identitySession.getPersistenceManager().createGroup("IT", GROUP).getKey();
+ String hrGroupId =
identitySession.getPersistenceManager().createGroup("HR", GROUP).getKey();
- identitySession.getRelationshipManager().associateGroupsByIds(acmeOrgId,
itGroupId);
- identitySession.getRelationshipManager().associateGroupsByIds(acmeOrgId,
hrGroupId);
+ identitySession.getRelationshipManager().associateGroupsByKeys(acmeOrgId,
itGroupId);
+ identitySession.getRelationshipManager().associateGroupsByKeys(acmeOrgId,
hrGroupId);
- identitySession.getRelationshipManager().associateUserByIds(itGroupId,
johnDoeUser);
- identitySession.getRelationshipManager().associateUserByIds(itGroupId,
aliceUser);
+ identitySession.getRelationshipManager().associateUserByKeys(itGroupId,
johnDoeUser);
+ identitySession.getRelationshipManager().associateUserByKeys(itGroupId,
aliceUser);
- identitySession.getRelationshipManager().associateUserByIds(hrGroupId,
evaUser);
+ identitySession.getRelationshipManager().associateUserByKeys(hrGroupId,
evaUser);
identitySession.getRoleManager().createRoleType("manager");
identitySession.getRoleManager().createRole("manager", johnDoeUser,
itGroupId);
// John belongs to IT and not HR
- assertTrue(identitySession.getRelationshipManager().isAssociatedByIds(itGroupId,
johnDoeUser));
-
assertFalse(identitySession.getRelationshipManager().isAssociatedByIds(hrGroupId,
johnDoeUser));
+
assertTrue(identitySession.getRelationshipManager().isAssociatedByKeys(itGroupId,
johnDoeUser));
+
assertFalse(identitySession.getRelationshipManager().isAssociatedByKeys(hrGroupId,
johnDoeUser));
// John is manager of IT and not HR
assertTrue(identitySession.getRoleManager().hasRole(johnDoeUser, itGroupId,
"manager"));
@@ -140,8 +140,8 @@
assertTrue(Arrays.equals((byte[])attributes.get("picture").getValue(),
picture));
- String xUser =
identitySession.getPersistenceManager().createUser("x").getId();
- String someGroupId =
identitySession.getPersistenceManager().createGroup("someGroup",
GROUP).getId();
+ String xUser =
identitySession.getPersistenceManager().createUser("x").getKey();
+ String someGroupId =
identitySession.getPersistenceManager().createGroup("someGroup",
GROUP).getKey();
identitySession.getRoleManager().createRole("manager", xUser,
someGroupId);
@@ -149,9 +149,9 @@
assertEquals(1,
identitySession.getRoleManager().findGroupsWithRelatedRole(xUser, GROUP, null).size());
assertEquals(1,
identitySession.getRoleManager().findGroupsWithRelatedRole(xUser, null).size());
- String otherGroupId =
identitySession.getPersistenceManager().createGroup("otherGroup",
GROUP).getId();
+ String otherGroupId =
identitySession.getPersistenceManager().createGroup("otherGroup",
GROUP).getKey();
- identitySession.getRelationshipManager().associateUserByIds(otherGroupId,
xUser);
+ identitySession.getRelationshipManager().associateUserByKeys(otherGroupId,
xUser);
assertEquals(1,
identitySession.getRelationshipManager().findAssociatedGroups(xUser, GROUP,
null).size());
assertEquals(1,
identitySession.getRoleManager().findGroupsWithRelatedRole(xUser, GROUP, null).size());
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/Group.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/Group.java 2009-11-11
13:18:39 UTC (rev 924)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/Group.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -26,9 +26,7 @@
/**
* Represents a Group. Group has a name that is unique in scope of a given group type.
This means that groupType/name pairs
- * uniquely identifies group. Group Id contains encoded group type and name imformation.
In default implementation
- * it can look as follows: "jbpid_group_id_._._GROUP_TYPE_._._GROUP_NAME".
Still prefix and format of Id can change in the future so
- * PersistenceManager.createGroupId(String groupName, String groupType) method should be
used to create it.
+ * uniquely identifies group.
*
* @author Anil.Saldhana(a)redhat.com
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentitySearchCriteria.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -70,12 +70,12 @@
IdentitySearchCriteria attributeValuesFilter(String attributeName, String[]
attributeValue) throws UnsupportedCriterium;
/**
- * Filter results by id. Wildcard '*' can be used
+ * Filter results by id or name. Wildcard '*' can be used
*
* @param filter
* @return
* @throws UnsupportedCriterium
*/
- IdentitySearchCriteria idFilter(String filter) throws UnsupportedCriterium;
+ IdentitySearchCriteria nameFilter(String filter) throws UnsupportedCriterium;
}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentityType.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentityType.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/IdentityType.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -34,8 +34,11 @@
{
/**
- * @return the id of the IdentityType
+ * @return the pointer to the IdentityType. For User this will return same value as
getId(). For Group key contains
+ * encoded group type and name imformation. In default implementation it can look as
follows:
+ * "jbpid_group_id_._._GROUP_TYPE_._._GROUP_NAME". Still prefix and format
of key can change in the future so
+ * PersistenceManager.createGroupId(String groupName, String groupType) method should
be used to create it for Group.
*/
- String getId();
+ String getKey();
}
\ No newline at end of file
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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/PersistenceManager.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -73,16 +73,25 @@
throws IdentityException;
/**
- * <p>Create a group Id. Result string can be used in other methods. Group Id
contains encoded group type and
- * name imformation.
+ * <p>Create a group key. Result string can be used in other methods as a simple
reference instead of whole object.
+ * Group key contains encoded group type and name imformation.
* In default implementation it can look as follows:
"jbpid_group_id_._._GROUP_TYPE_._._GROUP_NAME".
- * Still prefix and format of Id can change in the future so this method should be
used to create it.</p>
+ * Still prefix and format of key can change in the future so this method should be
used to create it.</p>
* @param groupName
* @param groupType
* @return
*/
- String createGroupId(String groupName, String groupType);
+ String createGroupKey(String groupName, String groupType);
+ /**
+ * <p>Create a user key. Result string can be used in other methods as a simple
reference instead of whole object.
+ * User key contains encoded id information. The most common implementation will be
that key and id values are simply
+ * equals. Still format of key can change in the future so this method should be used
to create it.</p>
+ * @param id
+ * @return
+ */
+ String createUserKey(String id);
+
// Remove
/**
@@ -98,12 +107,12 @@
/**
* Remove given user
*
- * @param id
+ * @param key
* @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.common.exception.IdentityException
*/
- void removeUser(String id, boolean force) throws IdentityException;
+ void removeUser(String key, boolean force) throws IdentityException;
/**
* Remove given group
@@ -118,12 +127,12 @@
/**
* Remove given group
*
- * @param groupId
+ * @param groupKey
* @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.common.exception.IdentityException
*/
- void removeGroup(String groupId, boolean force) throws IdentityException;
+ void removeGroup(String groupKey, boolean force) throws IdentityException;
// Search
@@ -143,13 +152,13 @@
throws IdentityException;
/**
- * Find user with a given name
+ * Find user with a given key
*
- * @param name
+ * @param key
* @return
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- User findUser(String name) throws IdentityException;
+ User findUser(String key) throws IdentityException;
/**
* Obtain users
@@ -175,11 +184,11 @@
/**
* Find group with a given id
*
- * @param id
+ * @param key
* @return
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- Group findGroupById(String id) throws IdentityException;
+ Group findGroupByKey(String key) throws IdentityException;
/**
@@ -201,14 +210,4 @@
*/
Collection<Group> findGroup(String groupType) throws IdentityException;
-
- //TODO: commented out for now as it is not implemented
- /**
- * Whether Identity is a virtual
- * (such as a pseudonym)
- * @return true (virtual identity)
- */
-// boolean isVirtual(User user);
-
-
}
Deleted: 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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RealmManager.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -1,89 +0,0 @@
-//TODO: Implement
-
-///*
-//* 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.api;
-//
-//import org.jboss.identity.idm.common.exception.IdentityException;
-//
-//import java.io.InputStream;
-//
-///**
-// * All operations connected with realms.
-// * Because operations on realms are not often there is no transaction or session
support.
-// *
-// * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
-// * @version : 0.1 $
-// */
-//public interface RealmManager
-//{
-//
-//
-// /**
-// * <p>Create a Realm or return an already
-// * created realm. Bootstrapping includes generating
-// * the models in the realm</p>
-// * @param realmName
-// * @return
-// */
-// Realm bootstrap(String realmName) throws IdentityException;
-//
-// /**
-// * <p>Bootstrap a realm given a configuration</p>
-// * @param realmName
-// * @param config
-// * @return
-// */
-// Realm bootstrap(String realmName, InputStream config) throws IdentityException;
-//
-// /**
-// * <p>Associate a relationship between two realms</p>
-// * @param realmA
-// * @param realmB
-// */
-// void associate(Realm realmA, Realm realmB) throws IdentityException;
-//
-//
-// /**
-// * <p>Disassociate a relationship between two realms</p>
-// * @param realmA
-// * @param realmB
-// */
-// void disassociate(Realm realmA, Realm realmB) throws IdentityException;
-//
-// /**
-// * @param fromRealm
-// * @param toRealm
-// * @return returns a relationship type between this and given Realm.
-// */
-// boolean isAssosiated(Realm fromRealm, Realm toRealm) throws IdentityException;
-//
-// /**
-// * <p>Return a realm</p>
-// * @param realmName
-// * @param shouldBootstrap Should we bootstrap if a realm does not exist?
-// * @return
-// */
-// Realm getRealm(String realmName, boolean shouldBootstrap) throws IdentityException;
-//
-//}
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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RelationshipManager.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -73,20 +73,20 @@
/**
* <p>Associate groups</p>
- * @param parentIds
- * @param memberIds
+ * @param parentKeys
+ * @param memberKeys
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- void associateGroupsByIds(Collection<String> parentIds, Collection<String>
memberIds)
+ void associateGroupsByKeys(Collection<String> parentKeys,
Collection<String> memberKeys)
throws IdentityException;
/**
* <p>Associate groups</p>
- * @param parentId
- * @param memberIds
+ * @param parentKeys
+ * @param memberKeys
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- void associateGroupsByIds(String parentId, Collection<String> memberIds)
+ void associateGroupsByKeys(String parentKeys, Collection<String> memberKeys)
throws IdentityException;
/**
@@ -100,11 +100,11 @@
/**
* <p>Associate groups</p>
- * @param parentId
- * @param memberId
+ * @param parentKey
+ * @param memberKey
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- void associateGroupsByIds(String parentId, String memberId)
+ void associateGroupsByKeys(String parentKey, String memberKey)
throws IdentityException;
/**
@@ -127,20 +127,20 @@
/**
* <p>Associate identities to groups</p>
- * @param parents
- * @param members
+ * @param parentKeys
+ * @param memberKeys
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- void associateUsersByIds(Collection<String> parents, Collection<String>
members)
+ void associateUsersByKeys(Collection<String> parentKeys,
Collection<String> memberKeys)
throws IdentityException;
/**
* <p>Associate identities to groups</p>
- * @param parentId
- * @param members
+ * @param parentKey
+ * @param memberKeys
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- void associateUsersByIds(String parentId, Collection<String> members)
+ void associateUsersByKeys(String parentKey, Collection<String> memberKeys)
throws IdentityException;
/**
@@ -154,11 +154,11 @@
/**
* <p>Associate identities to groups</p>
- * @param parentGroupId
- * @param memberid
+ * @param parentGroupKey
+ * @param memberKey
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- void associateUserByIds(String parentGroupId, String memberid)
+ void associateUserByKeys(String parentGroupKey, String memberKey)
throws IdentityException;
/**
@@ -198,20 +198,20 @@
/**
* <p>Disassociate groups</p>
- * @param parents
- * @param members
+ * @param parentKeys
+ * @param memberKeys
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- void disassociateGroupsByIds(Collection<String> parents,
Collection<String> members)
+ void disassociateGroupsByKeys(Collection<String> parentKeys,
Collection<String> memberKeys)
throws IdentityException;
/**
* <p>Disassociate groups</p>
- * @param parent
- * @param members
+ * @param parentKey
+ * @param memberKeys
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- void disassociateGroupsByIds(String parent, Collection<String> members)
+ void disassociateGroupsByKeys(String parentKey, Collection<String> memberKeys)
throws IdentityException;
/**
@@ -234,20 +234,20 @@
/**
* <p>Disassociate users from groups</p>
- * @param parents
- * @param members
+ * @param parentKeys
+ * @param memberKeys
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- void disassociateUsersByIds(Collection<String> parents, Collection<String>
members)
+ void disassociateUsersByKeys(Collection<String> parentKeys,
Collection<String> memberKeys)
throws IdentityException;
/**
* <p>Disassociate users from groups</p>
- * @param parent
- * @param members
+ * @param parentKey
+ * @param memberKey
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- void disassociateUsersByIds(String parent, Collection<String> members)
+ void disassociateUsersByKeys(String parentKey, Collection<String> memberKey)
throws IdentityException;
/**
@@ -262,12 +262,12 @@
/**
* <p>Check if association is present </p>
- * @param parents
- * @param members
+ * @param parentKeys
+ * @param memberKeys
* @return
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- boolean isAssociatedByIds(Collection<String> parents, Collection<String>
members)
+ boolean isAssociatedByKeys(Collection<String> parentKeys,
Collection<String> memberKeys)
throws IdentityException;
/**
@@ -282,12 +282,12 @@
/**
* <p>Check if association is present </p>
- * @param parent
- * @param member
+ * @param parentKey
+ * @param memberKey
* @return
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- boolean isAssociatedByIds(String parent, String member)
+ boolean isAssociatedByKeys(String parentKey, String memberKey)
throws IdentityException;
// Resolve relationships
@@ -440,12 +440,12 @@
/**
* Find users that have relationship with given parent group.
*
- * @param groupId parent group id
+ * @param groupKey parent group id
* @param cascade if true also identities from subgroubs will be retrieved. Default is
false
* @return
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- Collection<User> findAssociatedUsers(String groupId,
+ Collection<User> findAssociatedUsers(String groupKey,
boolean cascade,
IdentitySearchCriteria criteria) throws
IdentityException;
@@ -486,11 +486,11 @@
/**
* Find users that have relationship with given parent group. Will return users
connected with a given group with a role
*
- * @param groupId parent group id
+ * @param groupKey parent group id
* @return
* @throws org.jboss.identity.idm.common.exception.IdentityException
*/
- Collection<User> findRelatedUsers(String groupId, IdentitySearchCriteria
criteria) throws IdentityException;
+ Collection<User> findRelatedUsers(String groupKey, 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-11-11
13:18:39 UTC (rev 924)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/RoleManager.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -115,11 +115,11 @@
* Create role
* @param roleTypeName
* @param userId
- * @param groupId
+ * @param groupKey
* @return
* @throws IdentityException
*/
- Role createRole(String roleTypeName, String userId, String groupId) throws
IdentityException;
+ Role createRole(String roleTypeName, String userId, String groupKey) throws
IdentityException;
/**
* Create role
@@ -135,11 +135,11 @@
* Create role
* @param roleTypeName
* @param userId
- * @param groupId
+ * @param groupKey
* @return
* @throws IdentityException
*/
- Role getRole(String roleTypeName, String userId, String groupId) throws
IdentityException;
+ Role getRole(String roleTypeName, String userId, String groupKey) throws
IdentityException;
/**
* Remove Role
@@ -154,10 +154,10 @@
* Remove Role
* @param roleTypeName
* @param userId
- * @param groupId
+ * @param groupKey
* @throws IdentityException
*/
- void removeRole(String roleTypeName, String userId, String groupId) throws
IdentityException;
+ void removeRole(String roleTypeName, String userId, String groupKey) throws
IdentityException;
/**
* Remove Role
@@ -179,12 +179,12 @@
/**
* Check if Role is present
* @param userId
- * @param groupId
+ * @param groupKey
* @param roleTypeName
* @return
* @throws IdentityException
*/
- boolean hasRole(String userId, String groupId, String roleTypeName) throws
IdentityException;
+ boolean hasRole(String userId, String groupKey, String roleTypeName) throws
IdentityException;
/**
* Find RoleType objects for roles associated with a given User and Group
@@ -199,11 +199,11 @@
/**
* Find RoleType objects for roles associated with a given User and Group
* @param userId
- * @param groupId
+ * @param groupKey
* @return
* @throws IdentityException
*/
- Collection<RoleType> findRoleTypes(String userId, String groupId,
+ Collection<RoleType> findRoleTypes(String userId, String groupKey,
IdentitySearchCriteria criteria) throws
IdentityException;
/**
@@ -258,11 +258,11 @@
/**
* Find RoleType objects for roles associated with a given Group
- * @param groupId
+ * @param groupKey
* @return
* @throws IdentityException
*/
- Collection<RoleType> findGroupRoleTypes(String groupId,
+ Collection<RoleType> findGroupRoleTypes(String groupKey,
IdentitySearchCriteria criteria) throws
IdentityException;
/**
@@ -326,12 +326,12 @@
/**
* Find all Users with which Group has a Role association
*
- * @param groupId
+ * @param groupKey
* @param criteria
* @return
* @throws IdentityException
*/
- Collection<User> findUsersWithRelatedRole(String groupId,
+ Collection<User> findUsersWithRelatedRole(String groupKey,
IdentitySearchCriteria criteria) throws
IdentityException;
/**
@@ -345,13 +345,13 @@
RoleType roleType) throws
IdentityException;
/**
- * Find Role objects with a given RoleType name associated with IdentityType for a
given id
- * @param id
+ * Find Role objects with a given RoleType name associated with IdentityType for a
given key
+ * @param key
* @param roleTypeName
* @return
* @throws IdentityException
*/
- <T extends IdentityType> Collection<Role> findRoles(String id,
+ <T extends IdentityType> Collection<Role> findRoles(String key,
String roleTypeName) throws
IdentityException;
/**
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/User.java
===================================================================
--- idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/User.java 2009-11-11
13:18:39 UTC (rev 924)
+++ idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/User.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -30,5 +30,7 @@
*/
public interface User extends IdentityType
{
+
+ String getId();
}
\ No newline at end of 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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/cfg/IdentityConfigurationRegistry.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -25,7 +25,8 @@
import org.jboss.identity.idm.common.exception.IdentityException;
/**
- * Simple registry enables to register object instance and then reference it from
configuration file.
+ * Simple registry enables to register object instance before IdentitySessionFactory
creation and then reference it
+ * from configuration file.
*
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
* @version : 0.1 $
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQueryBuilder.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQueryBuilder.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/GroupQueryBuilder.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -49,12 +49,12 @@
GroupQueryBuilder reset();
/**
- * Search for a Group with a given ID
+ * Search for a Group with a given key
*
- * @param id
+ * @param key
* @return
*/
- GroupQueryBuilder setId(String id);
+ GroupQueryBuilder setKey(String key);
/**
* Search for groups with a given name and type
@@ -91,11 +91,11 @@
/**
* Search for groups that are associated with a given group
*
- * @param id
+ * @param key
* @param parent
* @return
*/
- GroupQueryBuilder addAssociatedGroup(String id, boolean parent);
+ GroupQueryBuilder addAssociatedGroup(String key, boolean parent);
/**
* Search for groups that are associated with a given groups
@@ -108,11 +108,11 @@
/**
* Search for groups that are associated with a given groups
*
- * @param ids
+ * @param keys
* @param parent
* @return
*/
- GroupQueryBuilder addAssociatedGroupsIds(Collection<String> ids, boolean
parent);
+ GroupQueryBuilder addAssociatedGroupsKeys(Collection<String> keys, boolean
parent);
/**
* Search for groups that are associated with a given user
@@ -125,10 +125,10 @@
/**
* Search for groups that are associated with a given user
*
- * @param id
+ * @param key
* @return
*/
- GroupQueryBuilder addAssociatedUser(String id);
+ GroupQueryBuilder addAssociatedUser(String key);
/**
* Search for groups that are associated with a given users
@@ -141,10 +141,10 @@
/**
* Search for groups that are associated with a given users
*
- * @param ids
+ * @param keys
* @return
*/
- GroupQueryBuilder addAssociatedUsersIds(Collection<String> ids);
+ GroupQueryBuilder addAssociatedUsersKeys(Collection<String> keys);
/**
* Search for groups that are connected with a Role with a given user
@@ -157,10 +157,10 @@
/**
* Search for groups that are connected with a Role with a given user
*
- * @param id
+ * @param key
* @return
*/
- GroupQueryBuilder addUserConnectedByRole(String id);
+ GroupQueryBuilder addUserConnectedByRole(String key);
/**
* Search for groups that are connected with a Role with a given users
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQueryBuilder.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQueryBuilder.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/RoleQueryBuilder.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -75,10 +75,10 @@
/**
* Search for roles connected with a given group
*
- * @param id
+ * @param key
* @return
*/
- RoleQueryBuilder setGroup(String id);
+ RoleQueryBuilder setGroup(String key);
/**
* Search for roles with a given RoleType
@@ -107,9 +107,9 @@
/**
* Search for roles connected with a given IdentityType object
*
- * @param id
+ * @param key
* @return
*/
- RoleQueryBuilder setIdentityTypeId(String id);
+ RoleQueryBuilder setIdentityTypeKey(String key);
}
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQueryBuilder.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQueryBuilder.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/api/query/UserQueryBuilder.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -66,10 +66,10 @@
/**
* Search for users associated with a given group
*
- * @param id
+ * @param key
* @return
*/
- UserQueryBuilder addAssociatedGroup(String id);
+ UserQueryBuilder addAssociatedGroup(String key);
/**
* Search for users associated with a given groups
@@ -82,10 +82,10 @@
/**
* Search for users associated with a given groups
*
- * @param groups
+ * @param groupKeys
* @return
*/
- UserQueryBuilder addAssociatedGroupsIds(Collection<String> groups);
+ UserQueryBuilder addAssociatedGroupsKeys(Collection<String> groupKeys);
/**
* Search for users that are connected with role with a given group
@@ -99,10 +99,10 @@
/**
* Search for users that are connected with role with a given group
*
- * @param id
+ * @param groupKey
* @return
*/
- UserQueryBuilder addGroupConnectedWithRole(String id);
+ UserQueryBuilder addGroupConnectedWithRole(String groupKey);
/**
* Search for users that are connected with role with a given groups
@@ -115,10 +115,10 @@
/**
* Search for users that are connected with role with a given group
*
- * @param groups
+ * @param groupKeys
* @return
*/
- UserQueryBuilder addGroupsIdsConnectedWithRole(Collection<String> groups);
+ UserQueryBuilder addGroupsKeysConnectedWithRole(Collection<String> groupKeys);
/**
* Search for users that are connected with role or associated with a given group
@@ -131,10 +131,10 @@
/**
* Search for users that are connected with role or associated with a given group
*
- * @param id
+ * @param key
* @return
*/
- UserQueryBuilder addRelatedGroup(String id);
+ UserQueryBuilder addRelatedGroup(String key);
/**
* Search for users that are connected with role or associated with a given group
@@ -147,10 +147,10 @@
/**
* Search for users that are connected with role or associated with a given group
*
- * @param ids
+ * @param groupKeys
* @return
*/
- UserQueryBuilder addRelatedGroupsIds(Collection<String> ids);
+ UserQueryBuilder addRelatedGroupsKeys(Collection<String> groupKeys);
/**
* Sort results
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/APICacheProvider.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/APICacheProvider.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/APICacheProvider.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -47,6 +47,11 @@
*/
void initialize(Map<String, String> properties, IdentityConfigurationRegistry
configurationRegistry);
+ /**
+ * Invalidate whole namespace
+ *
+ * @param ns
+ */
void invalidate(String ns);
/**
@@ -69,145 +74,550 @@
// Persistence Manager
-
+
+ /**
+ * Store user in cache
+ *
+ * @param ns
+ * @param user
+ */
void putUser(String ns, User user);
+ /**
+ * Get user from cache
+ *
+ * @param ns
+ * @param id
+ * @return
+ */
User getUser(String ns, String id);
+ /**
+ * Remove user from cache
+ *
+ * @param ns
+ * @param id
+ */
void removeUser(String ns, String id);
+ /**
+ * Store users in cache
+ *
+ * @param ns
+ * @param criteria
+ * @param users
+ */
void putUsers(String ns, IdentitySearchCriteria criteria, Collection<User>
users);
+ /**
+ * Get users from cache
+ *
+ * @param ns
+ * @param criteria
+ * @return
+ */
Collection<User> getUsers(String ns, IdentitySearchCriteria criteria);
+ /**
+ * Invalidate all stored users
+ *
+ * @param ns
+ */
void invalidateUsers(String ns);
+ /**
+ * Store user count in cache
+ * @param ns
+ * @param count
+ */
void putUserCount(String ns, int count);
+ /**
+ * Get user count
+ * @param ns
+ * @return
+ */
int getUserCount(String ns);
+ /**
+ * Invalidate user count
+ * @param ns
+ */
void invalidateUserCount(String ns);
//
+ /**
+ * Put group in cache
+ *
+ * @param ns
+ * @param group
+ */
void putGroup(String ns, Group group);
+ /**
+ * Get group from cache
+ *
+ * @param ns
+ * @param groupType
+ * @param groupName
+ * @return
+ */
Group getGroup(String ns, String groupType, String groupName);
+ /**
+ * Remove group from cache
+ *
+ * @param ns
+ * @param groupType
+ * @param groupName
+ */
void removeGroup(String ns, String groupType, String groupName);
+ /**
+ * Put groups in cache
+ *
+ * @param ns
+ * @param criteria
+ * @param groups
+ */
void putGroups(String ns, IdentitySearchCriteria criteria, Collection<Group>
groups);
+ /**
+ * Get groups from cache
+ *
+ * @param ns
+ * @param criteria
+ * @return
+ */
Collection<Group> getGroups(String ns, IdentitySearchCriteria criteria);
+ /**
+ * Invalidate all stored groups
+ *
+ * @param ns
+ */
void invalidateGroups(String ns);
+ /**
+ * Store group count
+ *
+ * @param ns
+ * @param groupType
+ * @param count
+ */
void putGroupCount(String ns, String groupType, int count);
+ /**
+ * Get group count
+ *
+ * @param ns
+ * @param groupType
+ * @return
+ */
int getGroupCount(String ns, String groupType);
+ /**
+ * Invalidate group count
+ *
+ * @param ns
+ * @param groupType
+ */
void invalidateGroupCount(String ns, String groupType);
//
+
+ /**
+ * Store role
+ *
+ * @param ns
+ * @param role
+ */
void putRole(String ns, Role role);
+ /**
+ * Get role
+ *
+ * @param ns
+ * @param role
+ * @return
+ */
Role getRole(String ns, Role role);
+ /**
+ * Remove role
+ *
+ * @param ns
+ * @param role
+ */
void removeRole(String ns, Role role);
+ /**
+ * Store role type
+ *
+ * @param ns
+ * @param roleType
+ */
void putRoleType(String ns, RoleType roleType);
+ /**
+ * Get role type
+ *
+ * @param ns
+ * @param roleType
+ * @return
+ */
RoleType getRoleType(String ns, RoleType roleType);
+ /**
+ * Remove role type
+ *
+ * @param ns
+ * @param roleType
+ */
void removeRoleType(String ns, RoleType roleType);
// Attribute
+
+ /**
+ * Store attributes
+ *
+ * @param ns
+ * @param id
+ * @param attributes
+ */
void putAttributes(String ns, String id, Map<String, Attribute> attributes);
+ /**
+ * Get attributes
+ *
+ * @param ns
+ * @param id
+ * @return
+ */
Map<String, Attribute> getAttributes(String ns, String id);
+ /**
+ * Invalidate attributes
+ *
+ * @param ns
+ * @param id
+ */
void invalidateAttributes(String ns, String id);
+ /**
+ * Invalidate attributes
+ *
+ * @param ns
+ */
void invalidateAttributes(String ns);
// Properties
+
+ /**
+ * Store properties
+ *
+ * @param ns
+ * @param role
+ * @param properties
+ */
void putProperties(String ns, Role role, Map<String, String> properties);
+ /**
+ * Get properties
+ *
+ * @param ns
+ * @param role
+ * @return
+ */
Map<String, String> getProperties(String ns, Role role);
+ /**
+ * Invalidate role properties
+ *
+ * @param ns
+ * @param role
+ */
void invalidateRoleProperties(String ns, Role role);
+ /**
+ * Invalidate role properties
+ *
+ * @param ns
+ */
void invalidateRoleProperties(String ns);
+ /**
+ * Store properties
+ *
+ * @param ns
+ * @param roleType
+ * @param properties
+ */
void putProperties(String ns, RoleType roleType, Map<String, String>
properties);
+ /**
+ * Get role type properties
+ *
+ * @param ns
+ * @param roleType
+ * @return
+ */
Map<String, String> getProperties(String ns, RoleType roleType);
+ /**
+ * Invalidate role type properties
+ *
+ * @param ns
+ * @param roleType
+ */
void invalidateRoleTypeProperties(String ns, RoleType roleType);
+ /**
+ * Invalidate role type properties
+ *
+ * @param ns
+ */
void invalidateRoleTypeProperties(String ns);
// Searches
+ /**
+ * Invalidate all searches stored in cache
+ *
+ * @param ns
+ */
void invalidateAllSearches(String ns);
+ /**
+ * Store user search
+ *
+ * @param ns
+ * @param search
+ * @param results
+ */
void putUserSearch(String ns, UserSearch search, Collection<User> results);
+ /**
+ * Get user search
+ *
+ * @param ns
+ * @param search
+ * @return
+ */
Collection<User> getUserSearch(String ns, UserSearch search);
+ /**
+ * Store group search
+ *
+ * @param ns
+ * @param search
+ * @param results
+ */
void putGroupSearch(String ns, GroupSearch search, Collection<Group> results);
+ /**
+ * Get group search
+ *
+ * @param ns
+ * @param search
+ * @return
+ */
Collection<Group> getGroupSearch(String ns, GroupSearch search);
+ /**
+ * Store relationship search
+ *
+ * @param ns
+ * @param search
+ * @param result
+ */
void putRelationshipSearch(String ns, RelationshipSearch search, Boolean result);
+ /**
+ * Get relationship Search
+ *
+ * @param ns
+ * @param search
+ * @return
+ */
Boolean getRelationshipSearch(String ns, RelationshipSearch search);
+ /**
+ * Store role search
+ * @param ns
+ * @param search
+ * @param results
+ */
void putRoleSearch(String ns, RoleSearch search, Collection<Role> results);
+ /**
+ * Get role search
+ *
+ * @param ns
+ * @param search
+ * @return
+ */
Collection<Role> getRoleSearch(String ns, RoleSearch search);
+ /**
+ * Store role type search
+ *
+ * @param ns
+ * @param search
+ * @param results
+ */
void putRoleTypeSearch(String ns, RoleTypeSearch search, Collection<RoleType>
results);
+ /**
+ * Get role type search
+ *
+ * @param ns
+ * @param search
+ * @return
+ */
Collection<RoleType> getRoleTypeSearch(String ns, RoleTypeSearch search);
// Queries
+ /**
+ * Invalidate all queries
+ *
+ * @param ns
+ */
void invalidateAllQueries(String ns);
+ /**
+ * Store user query
+ *
+ * @param ns
+ * @param q
+ * @param results
+ */
void putUserQuery(String ns, UserQuery q, Collection<User> results);
+ /**
+ * Store user query unique result
+ *
+ * @param ns
+ * @param q
+ * @param user
+ */
void putUserQueryUnique(String ns, UserQuery q, User user);
+ /**
+ * Get user query
+ *
+ * @param ns
+ * @param q
+ * @return
+ */
Collection<User> getUserQuery(String ns, UserQuery q);
+ /**
+ * Get user query unique result
+ * @param ns
+ * @param q
+ * @return
+ */
User getUserQueryUnique(String ns, UserQuery q);
+ /**
+ * Invalidate user queries
+ * @param ns
+ */
void invalidateUserQueries(String ns);
//
+
+ /**
+ * Store group query
+ *
+ * @param ns
+ * @param q
+ * @param results
+ */
void putGroupQuery(String ns, GroupQuery q, Collection<Group> results);
+ /**
+ * Store group query unique result
+ * \
+ * @param ns
+ * @param q
+ * @param group
+ */
void putGroupQueryUnique(String ns, GroupQuery q, Group group);
+ /**
+ * Get group query
+ *
+ * @param ns
+ * @param q
+ * @return
+ */
Collection<Group> getGroupQuery(String ns, GroupQuery q);
+ /**
+ * Get group query unique
+ *
+ * @param ns
+ * @param q
+ * @return
+ */
Group getGroupQueryUnique(String ns, GroupQuery q);
+ /**
+ * Invalidate all group queries
+ * @param ns
+ */
void invalidateGroupQueries(String ns);
//
+
+ /**
+ * Store role query
+ *
+ * @param ns
+ * @param q
+ * @param results
+ */
void putRoleQuery(String ns, RoleQuery q, Collection<Role> results);
+ /**
+ * Store role query unique result
+ *
+ * @param ns
+ * @param q
+ * @param role
+ */
void putRoleQueryUnique(String ns, RoleQuery q, Role role);
+ /**
+ * Get role query
+ *
+ * @param ns
+ * @param q
+ * @return
+ */
Collection<Role> getRoleQuery(String ns, RoleQuery q);
+ /**
+ * Get role query
+ *
+ * @param ns
+ * @param q
+ * @return
+ */
Role getRoleQueryUnique(String ns, RoleQuery q);
+ /**
+ * Invalidate all role queries
+ *
+ * @param ns
+ */
void invalidateRoleQueries(String ns);
}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/GroupSearch.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/GroupSearch.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/GroupSearch.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -23,8 +23,6 @@
package org.jboss.identity.idm.cache;
-import java.io.Serializable;
-
public interface GroupSearch extends Search
{
}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/RoleSearch.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/RoleSearch.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/RoleSearch.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -23,8 +23,6 @@
package org.jboss.identity.idm.cache;
-import java.io.Serializable;
-
public interface RoleSearch extends Search
{
}
Modified:
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/RoleTypeSearch.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/RoleTypeSearch.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/RoleTypeSearch.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -23,8 +23,6 @@
package org.jboss.identity.idm.cache;
-import java.io.Serializable;
-
public interface RoleTypeSearch extends Search
{
}
Modified: idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/UserSearch.java
===================================================================
---
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/UserSearch.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-api/src/main/java/org/jboss/identity/idm/cache/UserSearch.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -21,8 +21,6 @@
*/
package org.jboss.identity.idm.cache;
-import java.io.Serializable;
-
public interface UserSearch extends Search
{
}
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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-auth/src/main/java/org/jboss/identity/idm/auth/JBossIdentityIDMLoginModule.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -241,7 +241,7 @@
//This is because LDAP binds can be non case sensitive
if (validateUserNameCase != null &&
validateUserNameCase.equalsIgnoreCase("true")
- && !getUsername().equals(user.getId()))
+ && !getUsername().equals(user.getKey()))
{
return UserStatus.UNEXISTING;
}
Modified:
idm/trunk/idm-cache/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAPICacheProviderImpl.java
===================================================================
---
idm/trunk/idm-cache/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAPICacheProviderImpl.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-cache/src/main/java/org/jboss/identity/idm/impl/cache/JBossCacheAPICacheProviderImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -27,8 +27,7 @@
import org.jboss.identity.idm.api.query.UserQuery;
import org.jboss.identity.idm.api.query.GroupQuery;
import org.jboss.identity.idm.api.query.RoleQuery;
-import org.jboss.identity.idm.impl.api.model.GroupId;
-import org.jboss.identity.idm.common.exception.IdentityException;
+import org.jboss.identity.idm.impl.api.model.GroupKey;
import org.jboss.cache.*;
import java.util.Map;
@@ -192,7 +191,7 @@
public void putUser(String ns, User user)
{
- Fqn nodeFqn = getFqn(ns, NODE_USERS, user.getId());
+ Fqn nodeFqn = getFqn(ns, NODE_USERS, user.getKey());
Node ioNode = getCache().getRoot().addChild(nodeFqn);
@@ -339,7 +338,7 @@
public void putGroup(String ns, Group group)
{
- Fqn nodeFqn = getFqn(ns, NODE_GROUPS, group.getId());
+ Fqn nodeFqn = getFqn(ns, NODE_GROUPS, group.getKey());
Node ioNode = getCache().getRoot().addChild(nodeFqn);
@@ -347,13 +346,13 @@
if (log.isLoggable(Level.FINER))
{
- log.finer(this.toString() + "Group stored in cache: " +
group.getId());
+ log.finer(this.toString() + "Group stored in cache: " +
group.getKey());
}
}
public Group getGroup(String ns, String groupType, String groupName)
{
- Fqn nodeFqn = getFqn(ns, NODE_GROUPS, GroupId.parseId(groupName, groupType));
+ Fqn nodeFqn = getFqn(ns, NODE_GROUPS, GroupKey.parseKey(groupName, groupType));
Node node = getCache().getRoot().getChild(nodeFqn);
@@ -363,7 +362,7 @@
if (log.isLoggable(Level.FINER) && group != null)
{
- log.finer(this.toString() + "Group found in cache: id=" +
group.getId());
+ log.finer(this.toString() + "Group found in cache: id=" +
group.getKey());
}
return group;
@@ -374,13 +373,13 @@
public void removeGroup(String ns, String groupType, String groupName)
{
- Fqn nodeFqn = getFqn(ns, NODE_GROUPS, GroupId.parseId(groupName, groupType));
+ Fqn nodeFqn = getFqn(ns, NODE_GROUPS, GroupKey.parseKey(groupName, groupType));
getCache().getRoot().removeChild(nodeFqn);
if (log.isLoggable(Level.FINER))
{
- log.finer(this.toString() + "Group removed from cache: id= " +
GroupId.parseId(groupName, groupType));
+ log.finer(this.toString() + "Group removed from cache: id= " +
GroupKey.parseKey(groupName, groupType));
}
}
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchCriteriaImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchCriteriaImpl.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/IdentitySearchCriteriaImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -198,7 +198,7 @@
return this;
}
- public IdentitySearchCriteria idFilter(String filter) throws UnsupportedCriterium
+ public IdentitySearchCriteria nameFilter(String filter) throws UnsupportedCriterium
{
if (filter == null)
{
@@ -378,7 +378,7 @@
if (type instanceof User)
{
- id = type.getId();
+ id = type.getKey();
}
else if (type instanceof Group)
{
@@ -412,11 +412,11 @@
{
if (ascending)
{
- return o1.getId().compareTo(o2.getId());
+ return o1.getKey().compareTo(o2.getKey());
}
else
{
- return o2.getId().compareTo(o1.getId());
+ return o2.getKey().compareTo(o1.getKey());
}
}
else
Deleted:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/GroupId.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/GroupId.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/GroupId.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -1,109 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.identity.idm.impl.api.model;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
- * @version : 0.1 $
- */
-public class GroupId
-{
- public static final String PREFIX = "jbpid_group_id";
-
- public static final String SEPARATOR = "_._._";
-
- public static final String SEPARATOR_REGEX = "_\\._\\._";
-
- private String name;
-
- private String type;
-
- public GroupId(String name, String type)
- {
- if (name == null)
- {
- throw new IllegalArgumentException("name is null");
- }
- if (type == null)
- {
- throw new IllegalArgumentException("type is null");
- }
-
- this.name = name;
- this.type = type;
- }
-
- public GroupId(String id)
- {
- if (id == null)
- {
- throw new IllegalArgumentException("id is null");
- }
-
- String[] parts = id.split(SEPARATOR_REGEX);
-
- if (!validateId(id))
- {
- throw new IllegalArgumentException("group id not following required format:
" +
- PREFIX + SEPARATOR + "groupType" + SEPARATOR + "name : "
+ id);
- }
-
- name = parts[2];
- type = parts[1];
- }
-
- public static boolean validateId(String id)
- {
- String[] parts = id.split(SEPARATOR_REGEX);
-
- if (parts == null || parts.length != 3 || parts[0].equals(PREFIX.substring(0,
PREFIX.length() - 1)))
- {
- return false;
- }
-
- return true;
- }
-
- public static String parseId(String name, String type)
- {
- GroupId gid = new GroupId(name, type);
- String id = gid.getId();
- gid = null;
- return id;
- }
-
- public String getName()
- {
- return name;
- }
-
- public String getType()
- {
- return type;
- }
-
- public String getId()
- {
- return PREFIX + SEPARATOR + type + SEPARATOR + name;
- }
-}
Copied:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/GroupKey.java (from
rev 906,
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/GroupId.java)
===================================================================
--- idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/GroupKey.java
(rev 0)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/GroupKey.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -0,0 +1,109 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.identity.idm.impl.api.model;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class GroupKey
+{
+ public static final String PREFIX = "jbpid_group_id";
+
+ public static final String SEPARATOR = "_._._";
+
+ public static final String SEPARATOR_REGEX = "_\\._\\._";
+
+ private String name;
+
+ private String type;
+
+ public GroupKey(String name, String type)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("name is null");
+ }
+ if (type == null)
+ {
+ throw new IllegalArgumentException("type is null");
+ }
+
+ this.name = name;
+ this.type = type;
+ }
+
+ public GroupKey(String id)
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException("id is null");
+ }
+
+ String[] parts = id.split(SEPARATOR_REGEX);
+
+ if (!validateKey(id))
+ {
+ throw new IllegalArgumentException("group id not following required format:
" +
+ PREFIX + SEPARATOR + "groupType" + SEPARATOR + "name : "
+ id);
+ }
+
+ name = parts[2];
+ type = parts[1];
+ }
+
+ public static boolean validateKey(String key)
+ {
+ String[] parts = key.split(SEPARATOR_REGEX);
+
+ if (parts == null || parts.length != 3 || parts[0].equals(PREFIX.substring(0,
PREFIX.length() - 1)))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public static String parseKey(String name, String type)
+ {
+ GroupKey gid = new GroupKey(name, type);
+ String id = gid.getKey();
+ gid = null;
+ return id;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public String getKey()
+ {
+ return PREFIX + SEPARATOR + type + SEPARATOR + name;
+ }
+}
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleGroup.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleGroup.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleGroup.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -41,15 +41,15 @@
{
this.name = name;
this.groupType = groupType;
- this.id = new GroupId(name, groupType).getId();
+ this.id = new GroupKey(name, groupType).getKey();
}
- public SimpleGroup(GroupId groupId)
+ public SimpleGroup(GroupKey groupKey)
{
- this.name = groupId.getName();
- this.groupType = groupId.getType();
- this.id = groupId.getId();
+ this.name = groupKey.getName();
+ this.groupType = groupKey.getType();
+ this.id = groupKey.getKey();
}
public String getName()
@@ -62,7 +62,7 @@
return groupType;
}
- public String getId()
+ public String getKey()
{
return id;
}
Deleted:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleGroupType.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleGroupType.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleGroupType.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -1,71 +0,0 @@
-///*
-//* JBoss, a division of Red Hat
-//* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-//* by the @authors tag. See the copyright.txt in the distribution for a
-//* full listing of individual contributors.
-//*
-//* This is free software; you can redistribute it and/or modify it
-//* under the terms of the GNU Lesser General Public License as
-//* published by the Free Software Foundation; either version 2.1 of
-//* the License, or (at your option) any later version.
-//*
-//* This software is distributed in the hope that it will be useful,
-//* but WITHOUT ANY WARRANTY; without even the implied warranty of
-//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-//* Lesser General Public License for more details.
-//*
-//* You should have received a copy of the GNU Lesser General Public
-//* License along with this software; if not, write to the Free
-//* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-//* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-//*/
-//
-//package org.jboss.identity.idm.impl.api.model;
-//
-//import org.jboss.identity.idm.api.GroupType;
-//
-///**
-// * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
-// * @version : 0.1 $
-// */
-//public class SimpleGroupType implements GroupType
-//{
-//
-// private final String name;
-//
-// public SimpleGroupType(String name)
-// {
-// this.name = name;
-// }
-//
-// public String getName()
-// {
-// return name;
-// }
-//
-// public boolean equals(Object o)
-// {
-// if (this == o)
-// {
-// return true;
-// }
-// if (o == null || getClass() != o.getClass())
-// {
-// return false;
-// }
-//
-// SimpleGroupType that = (SimpleGroupType)o;
-//
-// if (name != null ? !name.equals(that.name) : that.name != null)
-// {
-// return false;
-// }
-//
-// return true;
-// }
-//
-// public int hashCode()
-// {
-// return (name != null ? name.hashCode() : 0);
-// }
-//}
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleUser.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleUser.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/model/SimpleUser.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -43,6 +43,11 @@
return id;
}
+ public String getKey()
+ {
+ return getId();
+ }
+
@Override
public boolean equals(Object o)
{
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/AbstractQuery.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/AbstractQuery.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/AbstractQuery.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -22,25 +22,9 @@
package org.jboss.identity.idm.impl.api.query;
-import org.jboss.identity.idm.api.IdentitySearchCriteria;
-import org.jboss.identity.idm.api.SortOrder;
-import org.jboss.identity.idm.api.UnsupportedCriterium;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.api.Group;
-import org.jboss.identity.idm.api.IdentityType;
-import org.jboss.identity.idm.api.User;
-import org.jboss.identity.idm.api.Role;
-import org.jboss.identity.idm.api.query.UserQuery;
-import org.jboss.identity.idm.api.query.UnsupportedQueryCriterium;
import org.jboss.identity.idm.api.query.Query;
import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
-import org.jboss.identity.idm.impl.api.model.SimpleGroup;
-import org.jboss.identity.idm.impl.api.model.GroupId;
-import org.jboss.identity.idm.impl.api.model.SimpleUser;
-import org.jboss.identity.idm.impl.api.session.IdentitySessionImpl;
-import java.util.List;
-import java.util.LinkedList;
import java.io.Serializable;
/**
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/AbstractQueryBuilder.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/AbstractQueryBuilder.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/AbstractQueryBuilder.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -24,9 +24,8 @@
import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
import org.jboss.identity.idm.impl.api.model.SimpleGroup;
-import org.jboss.identity.idm.impl.api.model.GroupId;
+import org.jboss.identity.idm.impl.api.model.GroupKey;
import org.jboss.identity.idm.impl.api.model.SimpleUser;
-import org.jboss.identity.idm.api.query.Query;
import org.jboss.identity.idm.api.query.UnsupportedQueryCriterium;
import org.jboss.identity.idm.api.query.QueryBuilder;
import org.jboss.identity.idm.api.SortOrder;
@@ -101,7 +100,7 @@
{
try
{
- searchCriteria.idFilter(idFilter);
+ searchCriteria.nameFilter(idFilter);
}
catch (UnsupportedCriterium unsupportedCriterium)
{
@@ -121,16 +120,16 @@
protected Group createGroupFromId(String id)
{
- return new SimpleGroup(new GroupId(id));
+ return new SimpleGroup(new GroupKey(id));
}
protected IdentityType createIdentityTypeFromId(String id)
{
- if (GroupId.validateId(id))
+ if (GroupKey.validateKey(id))
{
- GroupId groupId = new GroupId(id);
+ GroupKey groupKey = new GroupKey(id);
- return new SimpleGroup(groupId);
+ return new SimpleGroup(groupKey);
}
else
{
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryBuilderImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryBuilderImpl.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryBuilderImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -23,22 +23,19 @@
package org.jboss.identity.idm.impl.api.query;
import org.jboss.identity.idm.api.query.GroupQueryBuilder;
-import org.jboss.identity.idm.api.query.QueryException;
import org.jboss.identity.idm.api.query.GroupQuery;
import org.jboss.identity.idm.api.query.UnsupportedQueryCriterium;
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.User;
import org.jboss.identity.idm.api.SortOrder;
-import org.jboss.identity.idm.impl.api.model.GroupId;
+import org.jboss.identity.idm.impl.api.model.GroupKey;
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.impl.NotYetImplementedException;
import java.util.Set;
import java.util.HashSet;
import java.util.Collection;
-import java.util.List;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
@@ -46,7 +43,7 @@
*/
public class GroupQueryBuilderImpl extends AbstractQueryBuilder implements
GroupQueryBuilder
{
- private GroupId groupId;
+ private GroupKey groupKey;
private String groupName;
@@ -64,9 +61,9 @@
private void prepare()
{
- if (groupId == null && (groupName != null && groupType != null))
+ if (groupKey == null && (groupName != null && groupType != null))
{
- groupId = new GroupId(groupName, groupType);
+ groupKey = new GroupKey(groupName, groupType);
}
}
@@ -77,7 +74,7 @@
return new GroupQueryImpl(
searchCriteria,
- groupId,
+ groupKey,
groupName,
groupType,
associatedParentGroups,
@@ -90,7 +87,7 @@
public GroupQueryBuilder reset()
{
searchCriteria = new IdentitySearchCriteriaImpl();
- groupId = null;
+ groupKey = null;
groupName = null;
groupType = null;
associatedParentGroups = new HashSet<Group>();
@@ -102,15 +99,15 @@
return this;
}
- public GroupQueryBuilder setId(String id)
+ public GroupQueryBuilder setKey(String id)
{
- groupId = new GroupId(id);
+ groupKey = new GroupKey(id);
return this;
}
public GroupQueryBuilder setNameAndType(String name, String type)
{
- groupId = new GroupId(name, type);
+ groupKey = new GroupKey(name, type);
groupName = name;
groupType = type;
@@ -149,7 +146,7 @@
{
checkNotNullArgument(id, "Group id");
- Group group = new SimpleGroup(new GroupId(id));
+ Group group = new SimpleGroup(new GroupKey(id));
if (parent)
{
@@ -180,12 +177,12 @@
return this;
}
- public GroupQueryBuilder addAssociatedGroupsIds(Collection<String> ids, boolean
parent)
+ public GroupQueryBuilder addAssociatedGroupsKeys(Collection<String> ids, boolean
parent)
{
checkNotNullArgument(ids, "Groups ids");
for (String groupId : ids)
{
- Group group = new SimpleGroup(new GroupId(groupId));
+ Group group = new SimpleGroup(new GroupKey(groupId));
if (parent)
{
@@ -221,7 +218,7 @@
return this;
}
- public GroupQueryBuilder addAssociatedUsersIds(Collection<String> ids)
+ public GroupQueryBuilder addAssociatedUsersKeys(Collection<String> ids)
{
checkNotNullArgument(ids, "Users ids");
for (String id : ids)
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryExecutorImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryExecutorImpl.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryExecutorImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -63,7 +63,7 @@
// If no conditions
- if (q.groupId == null &&
+ if (q.groupKey == null &&
q.groupName == null &&
q.groupType == null &&
q.associatedParentGroups.size() == 0 &&
@@ -79,10 +79,10 @@
}
- if (q.groupId != null)
+ if (q.groupKey != null)
{
uniqueResult = identitySession.getPersistenceManager().
- findGroup(q.groupId.getName(), q.groupId.getType());
+ findGroup(q.groupKey.getName(), q.groupKey.getType());
}
// Process each condition
@@ -135,7 +135,7 @@
// If only one search was performed then return it as search criteria are
applied correctly
- if (q.groupId == null &&
+ if (q.groupKey == null &&
uniqueResult == null &&
q.associatedChildGroups.size() == 0 &&
resultsAssociatedChildGroups.size() == 0 &&
@@ -151,7 +151,7 @@
return mainResults;
}
- else if (q.groupId != null &&
+ else if (q.groupKey != null &&
uniqueResult != null &&
q.associatedChildGroups.size() == 0 &&
resultsAssociatedChildGroups.size() == 0 &&
@@ -169,7 +169,7 @@
IdentitySearchCriteriaImpl.applyCriteria(identitySession, q.searchCriteria,
mainResults);
return mainResults;
}
- else if (q.groupId == null &&
+ else if (q.groupKey == null &&
uniqueResult == null &&
q.associatedChildGroups.size() != 0 &&
resultsAssociatedChildGroups.size() != 0 &&
@@ -185,7 +185,7 @@
return resultsAssociatedChildGroups;
}
- else if (q.groupId == null &&
+ else if (q.groupKey == null &&
uniqueResult == null &&
q.associatedChildGroups.size() == 0 &&
resultsAssociatedChildGroups.size() == 0 &&
@@ -200,7 +200,7 @@
{
return resultsAssociatedParentGroups;
}
- else if (q.groupId == null &&
+ else if (q.groupKey == null &&
uniqueResult == null &&
q.associatedChildGroups.size() == 0 &&
resultsAssociatedChildGroups.size() == 0 &&
@@ -215,7 +215,7 @@
{
return resultsUsersAssociated;
}
- else if (q.groupId == null &&
+ else if (q.groupKey == null &&
uniqueResult == null &&
q.associatedChildGroups.size() == 0 &&
resultsAssociatedChildGroups.size() == 0 &&
@@ -230,7 +230,7 @@
{
return resultsUsersConnectedByRole;
}
- else if (q.groupId == null &&
+ else if (q.groupKey == null &&
uniqueResult == null &&
q.associatedChildGroups.size() == 0 &&
resultsAssociatedChildGroups.size() == 0 &&
@@ -250,7 +250,7 @@
boolean first = true;
- if (q.groupId != null)
+ if (q.groupKey != null)
{
first = false;
mainResults.add(uniqueResult);
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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/GroupQueryImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -25,7 +25,7 @@
import org.jboss.identity.idm.api.query.GroupQuery;
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.User;
-import org.jboss.identity.idm.impl.api.model.GroupId;
+import org.jboss.identity.idm.impl.api.model.GroupKey;
import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
import java.util.Set;
@@ -37,7 +37,7 @@
*/
public class GroupQueryImpl extends AbstractQuery implements GroupQuery
{
- public final GroupId groupId;
+ public final GroupKey groupKey;
public final String groupName;
@@ -53,10 +53,10 @@
public final Set<User> usersConnectedByRole;
- public GroupQueryImpl(IdentitySearchCriteriaImpl searchCriteria, GroupId groupId,
String groupName, String groupType, Set<Group> associatedParentGroups,
Set<Group> associatedChildGroups, Set<User> usersAssociated, Set<User>
usersRelated, Set<User> usersConnectedByRole)
+ public GroupQueryImpl(IdentitySearchCriteriaImpl searchCriteria, GroupKey groupKey,
String groupName, String groupType, Set<Group> associatedParentGroups,
Set<Group> associatedChildGroups, Set<User> usersAssociated, Set<User>
usersRelated, Set<User> usersConnectedByRole)
{
super(searchCriteria);
- this.groupId = groupId;
+ this.groupKey = groupKey;
this.groupName = groupName;
this.groupType = groupType;
@@ -132,7 +132,7 @@
{
return false;
}
- if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != null)
+ if (groupKey != null ? !groupKey.equals(that.groupKey) : that.groupKey != null)
{
return false;
}
@@ -164,7 +164,7 @@
public int hashCode()
{
int result = super.hashCode();
- result = 31 * result + (groupId != null ? groupId.hashCode() : 0);
+ result = 31 * result + (groupKey != null ? groupKey.hashCode() : 0);
result = 31 * result + (groupName != null ? groupName.hashCode() : 0);
result = 31 * result + (groupType != null ? groupType.hashCode() : 0);
result = 31 * result + associatedParentGroups.hashCode();
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryBuilderImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryBuilderImpl.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/RoleQueryBuilderImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -32,7 +32,7 @@
import org.jboss.identity.idm.api.SortOrder;
import org.jboss.identity.idm.impl.api.model.SimpleUser;
import org.jboss.identity.idm.impl.api.model.SimpleGroup;
-import org.jboss.identity.idm.impl.api.model.GroupId;
+import org.jboss.identity.idm.impl.api.model.GroupKey;
import org.jboss.identity.idm.impl.api.model.SimpleRoleType;
import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
@@ -93,7 +93,7 @@
public RoleQueryBuilder setGroup(String id)
{
checkNotNullArgument(id, "Group id");
- this.group = new SimpleGroup(new GroupId(id));
+ this.group = new SimpleGroup(new GroupKey(id));
return this;
}
@@ -125,7 +125,7 @@
return this;
}
- public RoleQueryBuilder setIdentityTypeId(String id)
+ public RoleQueryBuilder setIdentityTypeKey(String id)
{
checkNotNullArgument(id, "IdentityType id");
IdentityType identityType = createIdentityTypeFromId(id);
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryBuilderImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryBuilderImpl.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/query/UserQueryBuilderImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -98,7 +98,7 @@
return this;
}
- public UserQueryBuilder addAssociatedGroupsIds(Collection<String> groups)
+ public UserQueryBuilder addAssociatedGroupsKeys(Collection<String> groups)
{
checkNotNullArgument(groups, "Groups");
for (String groupId : groups)
@@ -129,7 +129,7 @@
return this;
}
- public UserQueryBuilder addGroupsIdsConnectedWithRole(Collection<String>
groups)
+ public UserQueryBuilder addGroupsKeysConnectedWithRole(Collection<String>
groups)
{
checkNotNullArgument(groups, "Groups");
for (String groupId : groups)
@@ -160,7 +160,7 @@
return this;
}
- public UserQueryBuilder addRelatedGroupsIds(Collection<String> ids)
+ public UserQueryBuilder addRelatedGroupsKeys(Collection<String> ids)
{
checkNotNullArgument(ids, "Groups ids");
for (String id : ids)
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AbstractManager.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -35,7 +35,7 @@
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.SimpleGroup;
-import org.jboss.identity.idm.impl.api.model.GroupId;
+import org.jboss.identity.idm.impl.api.model.GroupKey;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
import org.jboss.identity.idm.cache.APICacheProvider;
@@ -112,11 +112,11 @@
protected IdentityType createIdentityTypeFromId(String id)
{
- if (GroupId.validateId(id))
+ if (GroupKey.validateKey(id))
{
- GroupId groupId = new GroupId(id);
+ GroupKey groupKey = new GroupKey(id);
- return new SimpleGroup(groupId);
+ return new SimpleGroup(groupKey);
}
else
{
@@ -128,7 +128,7 @@
{
IdentityObjectType iot =
getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType();
- return new SimpleIdentityObject(user.getId(), iot);
+ return new SimpleIdentityObject(user.getKey(), iot);
}
protected IdentityObject createIdentityObjectForUserName(String userName)
@@ -142,16 +142,16 @@
{
IdentityObjectType iot =
getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType(group.getGroupType());
- return new SimpleIdentityObject(group.getName(), group.getId(), iot);
+ return new SimpleIdentityObject(group.getName(), group.getKey(), iot);
}
protected IdentityObject createIdentityObjectForGroupId(String groupId)
{
- GroupId id = new GroupId(groupId);
+ GroupKey key = new GroupKey(groupId);
- IdentityObjectType iot =
getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType(id.getType());
+ IdentityObjectType iot =
getSessionContext().getIdentityObjectTypeMapper().getIdentityObjectType(key.getType());
- return new SimpleIdentityObject(id.getName(), null, iot);
+ return new SimpleIdentityObject(key.getName(), null, iot);
}
protected IdentityObject createIdentityObject(IdentityType identityType)
@@ -171,9 +171,9 @@
protected IdentityObject createIdentityObject(String id)
{
- if (GroupId.validateId(id))
+ if (GroupKey.validateKey(id))
{
- GroupId groupId = new GroupId(id);
+ GroupKey groupKey = new GroupKey(id);
return createIdentityObjectForGroupId(id);
}
@@ -187,7 +187,7 @@
protected Group createGroupFromId(String id)
{
- return new SimpleGroup(new GroupId(id));
+ return new SimpleGroup(new GroupKey(id));
}
protected IdentityObjectSearchCriteria convertSearchControls(IdentitySearchCriteria
criteria)
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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/AttributesManagerImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -22,7 +22,6 @@
package org.jboss.identity.idm.impl.api.session.managers;
-import org.jboss.identity.idm.api.IdentitySession;
import org.jboss.identity.idm.api.AttributesManager;
import org.jboss.identity.idm.api.IdentityType;
import org.jboss.identity.idm.api.User;
@@ -156,7 +155,7 @@
if (cache != null)
{
- Map<String, Attribute> attributes = cache.getAttributes(cacheNS,
identityType.getId());
+ Map<String, Attribute> attributes = cache.getAttributes(cacheNS,
identityType.getKey());
if (attributes != null)
{
return attributes;
@@ -174,7 +173,7 @@
if (cache != null)
{
- cache.putAttributes(cacheNS, identityType.getId(), newMap);
+ cache.putAttributes(cacheNS, identityType.getKey(), newMap);
}
return newMap;
}
@@ -208,7 +207,7 @@
attrMap.put(attribute.getName(), attribute);
}
- cache.putAttributes(cacheNS, identity.getId(), attrMap);
+ cache.putAttributes(cacheNS, identity.getKey(), attrMap);
}
postAttributesUpdate(identity, attributes);
@@ -318,8 +317,8 @@
if (cache != null)
{
// Grab the new profile and persist in cache
- cache.invalidateAttributes(cacheNS, identityType.getId());
- cache.putAttributes(cacheNS, identityType.getId(),
this.getAttributes(identityType));
+ cache.invalidateAttributes(cacheNS, identityType.getKey());
+ cache.putAttributes(cacheNS, identityType.getKey(),
this.getAttributes(identityType));
}
postAttributesAdd(identityType, attributes);
@@ -339,8 +338,8 @@
if (cache != null)
{
// Grab the new profile and persist in cache
- cache.invalidateAttributes(cacheNS, identityType.getId());
- cache.putAttributes(cacheNS, identityType.getId(),
this.getAttributes(identityType));
+ cache.invalidateAttributes(cacheNS, identityType.getKey());
+ cache.putAttributes(cacheNS, identityType.getKey(),
this.getAttributes(identityType));
}
postAttributesRemove(identityType, attributeNames);
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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/PersistenceManagerImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -23,15 +23,13 @@
package org.jboss.identity.idm.impl.api.session.managers;
import org.jboss.identity.idm.api.*;
-import org.jboss.identity.idm.api.event.IdentityTypeEventListener;
-import org.jboss.identity.idm.api.event.EventListener;
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;
import org.jboss.identity.idm.impl.api.session.managers.AbstractManager;
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.GroupKey;
import org.jboss.identity.idm.impl.api.model.SimpleUser;
import org.jboss.identity.idm.impl.api.model.SimpleGroup;
import org.jboss.identity.idm.impl.cache.GroupSearchImpl;
@@ -170,16 +168,21 @@
return group;
}
- public String createGroupId(String groupName, String groupType)
+ public String createGroupKey(String groupName, String groupType)
{
checkNotNullArgument(groupName, "Group name");
checkNotNullArgument(groupType, "Group type");
checkObjectName(groupName);
checkObjectName(groupType);
- return new GroupId(groupName, groupType).getId();
+ return new GroupKey(groupName, groupType).getKey();
}
+ public String createUserKey(String id)
+ {
+ return id;
+ }
+
public void removeUser(User user, boolean force) throws IdentityException
{
checkNotNullArgument(user, "User");
@@ -241,7 +244,7 @@
//TODO: force
- preRemove(new SimpleGroup(new GroupId(groupId)));
+ preRemove(new SimpleGroup(new GroupKey(groupId)));
getRepository().removeIdentityObject(getInvocationContext(),
createIdentityObjectForGroupId(groupId));
@@ -250,7 +253,7 @@
cache.invalidate(cacheNS);
}
- postRemove(new SimpleGroup(new GroupId(groupId)));
+ postRemove(new SimpleGroup(new GroupKey(groupId)));
}
@@ -392,19 +395,19 @@
return null;
}
- public Group findGroupById(String id) throws IdentityException
+ public Group findGroupByKey(String id) throws IdentityException
{
checkNotNullArgument(id, "Group id");
- if (!GroupId.validateId(id))
+ if (!GroupKey.validateKey(id))
{
throw new IdentityException("Provided group id is not valid: " + id +
"; " +
- "Please use PersistenceManager.createGroupId() to obtain valid group
id");
+ "Please use PersistenceManager.createGroupKey() to obtain valid group
id");
}
- GroupId groupId = new GroupId(id);
+ GroupKey groupKey = new GroupKey(id);
- return findGroup(groupId.getName(), groupId.getType());
+ return findGroup(groupKey.getName(), groupKey.getType());
}
@@ -455,5 +458,4 @@
}
-
}
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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RelationshipManagerImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -23,7 +23,6 @@
package org.jboss.identity.idm.impl.api.session.managers;
import org.jboss.identity.idm.api.RelationshipManager;
-import org.jboss.identity.idm.api.IdentitySession;
import org.jboss.identity.idm.api.Group;
import org.jboss.identity.idm.api.User;
import org.jboss.identity.idm.api.IdentityType;
@@ -40,12 +39,11 @@
import org.jboss.identity.idm.impl.api.session.IdentitySessionImpl;
import org.jboss.identity.idm.impl.api.IdentitySearchCriteriaImpl;
import org.jboss.identity.idm.impl.api.model.SimpleGroup;
-import org.jboss.identity.idm.impl.api.model.GroupId;
+import org.jboss.identity.idm.impl.api.model.GroupKey;
import org.jboss.identity.idm.impl.api.model.SimpleUser;
import org.jboss.identity.idm.impl.cache.RelationshipSearchImpl;
import org.jboss.identity.idm.impl.cache.GroupSearchImpl;
import org.jboss.identity.idm.impl.cache.UserSearchImpl;
-import org.jboss.identity.idm.cache.RelationshipSearch;
import java.util.Collection;
import java.util.Iterator;
@@ -179,7 +177,7 @@
associateGroups(Arrays.asList(parent), members);
}
- public void associateGroupsByIds(Collection<String> parentIds,
Collection<String> memberIds) throws IdentityException
+ public void associateGroupsByKeys(Collection<String> parentIds,
Collection<String> memberIds) throws IdentityException
{
checkNotNullArgument(parentIds, "Parents Ids");
checkNotNullArgument(memberIds, "Members Ids");
@@ -192,16 +190,16 @@
{
String memberId = membersIterator.next();
- associateGroupsByIds(parentId, memberId);
+ associateGroupsByKeys(parentId, memberId);
}
}
}
- public void associateGroupsByIds(String parentId, Collection<String> memberIds)
throws IdentityException
+ public void associateGroupsByKeys(String parentId, Collection<String> memberIds)
throws IdentityException
{
checkNotNullArgument(parentId, "Parent Id");
- associateGroupsByIds(Arrays.asList(parentId), memberIds);
+ associateGroupsByKeys(Arrays.asList(parentId), memberIds);
}
public void associateGroups(Group parent, Group member) throws IdentityException
@@ -224,13 +222,13 @@
}
- public void associateGroupsByIds(String parentId, String memberId) throws
IdentityException
+ public void associateGroupsByKeys(String parentId, String memberId) throws
IdentityException
{
checkNotNullArgument(parentId, "Parent Id");
checkNotNullArgument(memberId, "Member Id");
- Group parent = new SimpleGroup(new GroupId(parentId));
- Group member = new SimpleGroup(new GroupId(memberId));
+ Group parent = new SimpleGroup(new GroupKey(parentId));
+ Group member = new SimpleGroup(new GroupKey(memberId));
preGroupAssociationCreate(parent, member);
@@ -274,7 +272,7 @@
}
- public void associateUsersByIds(Collection<String> parents,
Collection<String> members) throws IdentityException
+ public void associateUsersByKeys(Collection<String> parents,
Collection<String> members) throws IdentityException
{
checkNotNullArgument(parents, "parents");
@@ -288,17 +286,17 @@
{
String member = membersIterator.next();
- associateUserByIds(parent, member);
+ associateUserByKeys(parent, member);
}
}
}
- public void associateUsersByIds(String parentId, Collection<String> members)
throws IdentityException
+ public void associateUsersByKeys(String parentId, Collection<String> members)
throws IdentityException
{
checkNotNullArgument(parentId, "Parent Id");
- associateUsersByIds(Arrays.asList(parentId), members);
+ associateUsersByKeys(Arrays.asList(parentId), members);
}
@@ -323,12 +321,12 @@
}
- public void associateUserByIds(String parentId, String memberId) throws
IdentityException
+ public void associateUserByKeys(String parentId, String memberId) throws
IdentityException
{
checkNotNullArgument(parentId, "Parent group Id");
checkNotNullArgument(memberId, "Member user Id");
- Group parent = new SimpleGroup(new GroupId(parentId));
+ Group parent = new SimpleGroup(new GroupKey(parentId));
User member = new SimpleUser(memberId);
preUserAssociationCreate(parent, member);
@@ -405,7 +403,7 @@
disassociateGroups(Arrays.asList(parent), members);
}
- public void disassociateGroupsByIds(Collection<String> parents,
Collection<String> members) throws IdentityException
+ public void disassociateGroupsByKeys(Collection<String> parents,
Collection<String> members) throws IdentityException
{
checkNotNullArgument(parents, "parents");
checkNotNullArgument(members, "members");
@@ -418,8 +416,8 @@
{
String member = membersIterator.next();
- Group parentGroup = new SimpleGroup(new GroupId(parent));
- Group memberGroup = new SimpleGroup(new GroupId(member));
+ Group parentGroup = new SimpleGroup(new GroupKey(parent));
+ Group memberGroup = new SimpleGroup(new GroupKey(member));
preGroupAssociationRemove(parentGroup, memberGroup);
@@ -438,11 +436,11 @@
}
}
- public void disassociateGroupsByIds(String parent, Collection<String> members)
throws IdentityException
+ public void disassociateGroupsByKeys(String parent, Collection<String> members)
throws IdentityException
{
checkNotNullArgument(parent, "Parent Id");
- disassociateGroupsByIds(Arrays.asList(parent), members);
+ disassociateGroupsByKeys(Arrays.asList(parent), members);
}
public void disassociateUsers(Collection<Group> parents, Collection<User>
members) throws IdentityException
@@ -482,7 +480,7 @@
disassociateUsers(Arrays.asList(parent), members);
}
- public void disassociateUsersByIds(Collection<String> parents,
Collection<String> members) throws IdentityException
+ public void disassociateUsersByKeys(Collection<String> parents,
Collection<String> members) throws IdentityException
{
checkNotNullArgument(parents, "parents");
checkNotNullArgument(members, "members");
@@ -496,7 +494,7 @@
{
String member = membersIterator.next();
- Group parentGroup = new SimpleGroup(new GroupId(parent));
+ Group parentGroup = new SimpleGroup(new GroupKey(parent));
User memberUser = new SimpleUser(member);
preUserAssociationRemove(parentGroup, memberUser);
@@ -516,11 +514,11 @@
}
}
- public void disassociateUsersByIds(String parent, Collection<String> members)
throws IdentityException
+ public void disassociateUsersByKeys(String parent, Collection<String> members)
throws IdentityException
{
checkNotNullArgument(parent, "Parent Id");
- disassociateUsersByIds(Arrays.asList(parent), members);
+ disassociateUsersByKeys(Arrays.asList(parent), members);
}
@@ -602,7 +600,7 @@
return true;
}
- public boolean isAssociatedByIds(Collection<String> parents,
Collection<String> members) throws IdentityException
+ public boolean isAssociatedByKeys(Collection<String> parents,
Collection<String> members) throws IdentityException
{
checkNotNullArgument(parents, "parents");
checkNotNullArgument(members, "members");
@@ -691,7 +689,7 @@
return isAssociated(parents, members);
}
- public boolean isAssociatedByIds(String parent, String member) throws
IdentityException
+ public boolean isAssociatedByKeys(String parent, String member) throws
IdentityException
{
checkNotNullArgument(parent, "Parent Id");
checkNotNullArgument(member, "Member Id");
@@ -760,7 +758,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addAssociatedGroupId(group.getId());
+ search.addAssociatedGroupId(group.getKey());
search.setGroupType(groupType);
search.setParent(parent);
search.setCascade(cascade);
@@ -818,7 +816,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addAssociatedGroupId(group.getId());
+ search.addAssociatedGroupId(group.getKey());
search.setGroupType(groupType);
search.setParent(parent);
search.setCascade(cascade);
@@ -858,7 +856,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addAssociatedUserId(user.getId());
+ search.addAssociatedUserId(user.getKey());
search.setGroupType(groupType);
search.setSearchCriteria(criteria);
@@ -886,7 +884,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addAssociatedUserId(user.getId());
+ search.addAssociatedUserId(user.getKey());
search.setGroupType(groupType);
search.setSearchCriteria(criteria);
@@ -924,7 +922,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addAssociatedUserId(user.getId());
+ search.addAssociatedUserId(user.getKey());
search.setSearchCriteria(criteria);
Collection<Group> results = cache.getGroupSearch(cacheNS, search);
@@ -952,7 +950,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addAssociatedUserId(user.getId());
+ search.addAssociatedUserId(user.getKey());
search.setSearchCriteria(criteria);
cache.putGroupSearch(cacheNS, search, identities);
@@ -984,7 +982,7 @@
if (cache != null)
{
UserSearchImpl search = new UserSearchImpl();
- search.addAssociatedGroupId(group.getId());
+ search.addAssociatedGroupId(group.getKey());
search.setCascade(cascade);
search.setSearchCriteria(criteria);
@@ -1047,7 +1045,7 @@
if (cache != null)
{
UserSearchImpl search = new UserSearchImpl();
- search.addAssociatedGroupId(group.getId());
+ search.addAssociatedGroupId(group.getKey());
search.setCascade(cascade);
search.setSearchCriteria(criteria);
@@ -1080,7 +1078,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addRelatedUserId(user.getId());
+ search.addRelatedUserId(user.getKey());
search.setGroupType(groupType);
search.setSearchCriteria(criteria);
@@ -1108,7 +1106,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addRelatedUserId(user.getId());
+ search.addRelatedUserId(user.getKey());
search.setGroupType(groupType);
search.setSearchCriteria(criteria);
@@ -1138,7 +1136,7 @@
if (cache != null)
{
UserSearchImpl search = new UserSearchImpl();
- search.addRelatedGroupId(group.getId());
+ search.addRelatedGroupId(group.getKey());
search.setSearchCriteria(criteria);
Collection<User> results = cache.getUserSearch(cacheNS, search);
@@ -1170,7 +1168,7 @@
if (cache != null)
{
UserSearchImpl search = new UserSearchImpl();
- search.addRelatedGroupId(group.getId());
+ search.addRelatedGroupId(group.getKey());
search.setSearchCriteria(criteria);
cache.putUserSearch(cacheNS, search, identities);
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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/api/session/managers/RoleManagerImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -23,7 +23,6 @@
package org.jboss.identity.idm.impl.api.session.managers;
import org.jboss.identity.idm.api.RoleManager;
-import org.jboss.identity.idm.api.IdentitySession;
import org.jboss.identity.idm.api.RoleType;
import org.jboss.identity.idm.api.Role;
import org.jboss.identity.idm.api.User;
@@ -32,7 +31,6 @@
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.api.query.RoleQuery;
import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationshipType;
import org.jboss.identity.idm.spi.model.IdentityObjectRelationship;
@@ -670,7 +668,7 @@
if (cache != null)
{
UserSearchImpl search = new UserSearchImpl();
- search.addRelatedGroupId(group.getId());
+ search.addRelatedGroupId(group.getKey());
search.setSearchCriteria(criteria);
Collection<User> results = cache.getUserSearch(cacheNS, search);
@@ -692,7 +690,7 @@
if (cache != null)
{
UserSearchImpl search = new UserSearchImpl();
- search.addRelatedGroupId(group.getId());
+ search.addRelatedGroupId(group.getKey());
search.setSearchCriteria(criteria);
cache.putUserSearch(cacheNS, search, identities);
@@ -720,7 +718,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addRelatedUserId(user.getId());
+ search.addRelatedUserId(user.getKey());
search.setSearchCriteria(criteria);
Collection<Group> results = cache.getGroupSearch(cacheNS, search);
@@ -742,7 +740,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addRelatedUserId(user.getId());
+ search.addRelatedUserId(user.getKey());
search.setSearchCriteria(criteria);
cache.putGroupSearch(cacheNS, search, identities);
@@ -771,7 +769,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addRelatedUserId(user.getId());
+ search.addRelatedUserId(user.getKey());
search.setGroupType(groupType);
search.setSearchCriteria(criteria);
@@ -809,7 +807,7 @@
if (cache != null)
{
GroupSearchImpl search = new GroupSearchImpl();
- search.addRelatedUserId(user.getId());
+ search.addRelatedUserId(user.getKey());
search.setGroupType(groupType);
search.setSearchCriteria(criteria);
@@ -842,7 +840,7 @@
if (cache != null)
{
RoleSearchImpl search = new RoleSearchImpl();
- search.setIdentityTypeId(identityType.getId());
+ search.setIdentityTypeId(identityType.getKey());
search.setRoleType(roleType);
Collection<Role> results = cache.getRoleSearch(cacheNS, search);
@@ -883,7 +881,7 @@
if (cache != null)
{
RoleSearchImpl search = new RoleSearchImpl();
- search.setIdentityTypeId(identityType.getId());
+ search.setIdentityTypeId(identityType.getKey());
search.setRoleType(roleType);
cache.putRoleSearch(cacheNS, search, roles);
Modified:
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/RelationshipSearchImpl.java
===================================================================
---
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/RelationshipSearchImpl.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/cache/RelationshipSearchImpl.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -25,7 +25,7 @@
import org.jboss.identity.idm.cache.RelationshipSearch;
import org.jboss.identity.idm.api.IdentityType;
-import org.jboss.identity.idm.impl.api.model.GroupId;
+import org.jboss.identity.idm.impl.api.model.GroupKey;
import org.jboss.identity.idm.impl.api.model.SimpleGroup;
import org.jboss.identity.idm.impl.api.model.SimpleUser;
@@ -70,9 +70,9 @@
public void addParent(String id)
{
- if (GroupId.validateId(id))
+ if (GroupKey.validateKey(id))
{
- parents.add(new SimpleGroup(new GroupId(id)));
+ parents.add(new SimpleGroup(new GroupKey(id)));
return;
}
parents.add(new SimpleUser(id));
@@ -80,9 +80,9 @@
public void addMember(String id)
{
- if (GroupId.validateId(id))
+ if (GroupKey.validateKey(id))
{
- members.add(new SimpleGroup(new GroupId(id)));
+ members.add(new SimpleGroup(new GroupKey(id)));
return;
}
members.add(new SimpleUser(id));
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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/main/java/org/jboss/identity/idm/impl/configuration/jaxb2/JAXB2IdentityConfiguration.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -443,7 +443,7 @@
// all configured identity object types
// if (storeMD.getSupportedIdentityTypes() == null ||
storeMD.getSupportedIdentityTypes().size() == 0)
// {
-// throw new IdentityConfigurationException("identity-store \""
+ storeMD.getId() + "\" doesn't have any supported " +
+// throw new IdentityConfigurationException("identity-store \""
+ storeMD.getKey() + "\" doesn't have any supported " +
// "identity-object-types configured");
// }
@@ -584,7 +584,7 @@
// if (repoMD.getIdentityStoreToIdentityObjectTypeMappings() == null ||
// repoMD.getIdentityStoreToIdentityObjectTypeMappings().size() == 0)
// {
-// throw new IdentityConfigurationException("No identity-store-mappings
defined in repository \"" + repoMD.getId() + "\"");
+// throw new IdentityConfigurationException("No identity-store-mappings
defined in repository \"" + repoMD.getKey() + "\"");
// }
// If there are no repo mappings then add all mappings from the default store
Modified:
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java
===================================================================
---
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-core/src/test/java/org/jboss/identity/idm/impl/store/CommonIdentityStoreTest.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -379,42 +379,42 @@
isSearchCriteriaTypeSupported(IdentityTypeEnum.USER,
IdentityObjectSearchCriteriaType.NAME_FILTER))
{
- criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().idFilter("*");
+ criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().nameFilter("*");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, criteria);
assertEquals(8, results.size());
- criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().idFilter("D*");
+ criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().nameFilter("D*");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, criteria);
assertEquals(3, results.size());
- criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().idFilter("*2");
+ criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().nameFilter("*2");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, criteria);
assertEquals(3, results.size());
- criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().idFilter("*3");
+ criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().nameFilter("*3");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, criteria);
assertEquals(2, results.size());
- criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().idFilter("Company1");
+ criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().nameFilter("Company1");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, criteria);
assertEquals(1, results.size());
- criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().idFilter("Toronto");
+ criteria = (IdentityObjectSearchCriteria)new
IdentitySearchCriteriaImpl().nameFilter("Toronto");
results = testContext.getStore().
findIdentityObject(testContext.getCtx(), IdentityTypeEnum.USER, criteria);
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupQueryTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupQueryTest.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/GroupQueryTest.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -78,7 +78,7 @@
Role role1 = ids.getRoleManager().createRole(rt1, user1, group1);
Role role2 = ids.getRoleManager().createRole(rt1, user1, group2);
- Role role3 = ids.getRoleManager().createRole("rt2", user1.getId(),
group1.getId());
+ Role role3 = ids.getRoleManager().createRole("rt2", user1.getKey(),
group1.getKey());
// Assertions
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/ModelTestCase.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -23,7 +23,7 @@
package org.jboss.identity.idm.impl.api;
import junit.framework.TestCase;
-import org.jboss.identity.idm.impl.api.model.GroupId;
+import org.jboss.identity.idm.impl.api.model.GroupKey;
/**
* @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
@@ -35,13 +35,13 @@
public void testGroupId() throws Exception
{
- GroupId id = new GroupId(GroupId.PREFIX + GroupId.SEPARATOR +
"groupTypeName" + GroupId.SEPARATOR + "groupName");
- assertEquals("groupName", id.getName());
- assertEquals("groupTypeName", id.getType());
+ GroupKey key = new GroupKey(GroupKey.PREFIX + GroupKey.SEPARATOR +
"groupTypeName" + GroupKey.SEPARATOR + "groupName");
+ assertEquals("groupName", key.getName());
+ assertEquals("groupTypeName", key.getType());
- id = new GroupId("groupName", "groupTypeName");
- assertEquals("groupName", id.getName());
- assertEquals("groupTypeName", id.getType());
+ key = new GroupKey("groupName", "groupTypeName");
+ assertEquals("groupName", key.getName());
+ assertEquals("groupTypeName", key.getType());
}
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/PersistenceManagerTest.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -109,11 +109,11 @@
assertEquals(group1.getGroupType(), ORGANIZATION);
assertEquals(group1.getName(), "groupName1");
- String group1Id =
session.getPersistenceManager().createGroupId("groupName1", ORGANIZATION);
+ String group1Id =
session.getPersistenceManager().createGroupKey("groupName1", ORGANIZATION);
- assertEquals(group1Id, group1.getId());
+ assertEquals(group1Id, group1.getKey());
- group1 = session.getPersistenceManager().findGroupById(group1Id);
+ group1 = session.getPersistenceManager().findGroupByKey(group1Id);
assertNotNull(group1);
assertEquals(group1.getGroupType(), ORGANIZATION);
@@ -131,9 +131,9 @@
assertEquals(0, session.getPersistenceManager().findGroup(DEPARTMENT).size());
session.getPersistenceManager().removeGroup(group1, false);
- String id = session.getPersistenceManager().createGroupId("groupName2",
ORGANIZATION);
+ String id = session.getPersistenceManager().createGroupKey("groupName2",
ORGANIZATION);
session.getPersistenceManager().removeGroup(id, false);
- id = session.getPersistenceManager().createGroupId("groupName3",
PROJECT);
+ id = session.getPersistenceManager().createGroupKey("groupName3",
PROJECT);
session.getPersistenceManager().removeGroup(id, false);
assertEquals(0, session.getPersistenceManager().findGroup(ORGANIZATION,
(IdentitySearchCriteria)null).size());
@@ -150,7 +150,7 @@
User u1 = session.getPersistenceManager().createUser("olo");
assertNotNull(u1);
- assertEquals(u1.getId(), "olo");
+ assertEquals(u1.getKey(), "olo");
session.getPersistenceManager().createUser("anna");
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RelationshipManagerTest.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -111,18 +111,18 @@
assertFalse(session.getRelationshipManager().isAssociated(Arrays.asList(group1,
group2), Arrays.asList(group2, group3)));
assertFalse(session.getRelationshipManager().isAssociated(Arrays.asList(group2,
group3), Arrays.asList(group1)));
- assertTrue(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
group2.getId()));
- assertTrue(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
group3.getId()));
- assertFalse(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
group4.getId()));
- assertFalse(session.getRelationshipManager().isAssociatedByIds(group2.getId(),
group1.getId()));
- assertFalse(session.getRelationshipManager().isAssociatedByIds(group2.getId(),
group3.getId()));
+ assertTrue(session.getRelationshipManager().isAssociatedByKeys(group1.getKey(),
group2.getKey()));
+ assertTrue(session.getRelationshipManager().isAssociatedByKeys(group1.getKey(),
group3.getKey()));
+ assertFalse(session.getRelationshipManager().isAssociatedByKeys(group1.getKey(),
group4.getKey()));
+ assertFalse(session.getRelationshipManager().isAssociatedByKeys(group2.getKey(),
group1.getKey()));
+ assertFalse(session.getRelationshipManager().isAssociatedByKeys(group2.getKey(),
group3.getKey()));
assertTrue(session.getRelationshipManager().
- isAssociatedByIds(Arrays.asList(group1.getId()), Arrays.asList(group2.getId(),
group3.getId())));
+ isAssociatedByKeys(Arrays.asList(group1.getKey()),
Arrays.asList(group2.getKey(), group3.getKey())));
assertFalse(session.getRelationshipManager().
- isAssociatedByIds(Arrays.asList(group1.getId(), group2.getId()),
Arrays.asList(group2.getId(), group3.getId())));
+ isAssociatedByKeys(Arrays.asList(group1.getKey(), group2.getKey()),
Arrays.asList(group2.getKey(), group3.getKey())));
assertFalse(session.getRelationshipManager().
- isAssociatedByIds(Arrays.asList(group2.getId(), group3.getId()),
Arrays.asList(group1.getId())));
+ isAssociatedByKeys(Arrays.asList(group2.getKey(), group3.getKey()),
Arrays.asList(group1.getKey())));
// Associate groups - other methods
@@ -137,17 +137,17 @@
session.getRelationshipManager().associateGroups(Arrays.asList(group1),
Arrays.asList(group2, group3));
assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(group2, group3)));
-
session.getRelationshipManager().disassociateGroupsByIds(Arrays.asList(group1.getId()),
Arrays.asList(group2.getId(), group3.getId()));
+
session.getRelationshipManager().disassociateGroupsByKeys(Arrays.asList(group1.getKey()),
Arrays.asList(group2.getKey(), group3.getKey()));
// reassociate #2
-
session.getRelationshipManager().associateGroupsByIds(Arrays.asList(group1.getId()),
Arrays.asList(group2.getId(), group3.getId()));
+
session.getRelationshipManager().associateGroupsByKeys(Arrays.asList(group1.getKey()),
Arrays.asList(group2.getKey(), group3.getKey()));
assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(group2, group3)));
session.getRelationshipManager().disassociateGroups(Arrays.asList(group1),
Arrays.asList(group2, group3));
// reassociate #3
- session.getRelationshipManager().associateGroupsByIds(group1.getId(),
group2.getId());
- session.getRelationshipManager().associateGroupsByIds(group1.getId(),
group3.getId());
+ session.getRelationshipManager().associateGroupsByKeys(group1.getKey(),
group2.getKey());
+ session.getRelationshipManager().associateGroupsByKeys(group1.getKey(),
group3.getKey());
assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(group2, group3)));
session.getRelationshipManager().disassociateGroups(Arrays.asList(group1),
Arrays.asList(group2, group3));
@@ -170,18 +170,18 @@
assertFalse(session.getRelationshipManager().isAssociated(Arrays.asList(group1,
group2), Arrays.asList(user1, user2)));
assertFalse(session.getRelationshipManager().isAssociated(Arrays.asList(group2),
Arrays.asList(user3)));
- assertTrue(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
user1.getId()));
- assertTrue(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
user2.getId()));
- assertFalse(session.getRelationshipManager().isAssociatedByIds(group1.getId(),
user3.getId()));
- assertFalse(session.getRelationshipManager().isAssociatedByIds(group2.getId(),
user1.getId()));
- assertFalse(session.getRelationshipManager().isAssociatedByIds(group2.getId(),
user3.getId()));
+ assertTrue(session.getRelationshipManager().isAssociatedByKeys(group1.getKey(),
user1.getKey()));
+ assertTrue(session.getRelationshipManager().isAssociatedByKeys(group1.getKey(),
user2.getKey()));
+ assertFalse(session.getRelationshipManager().isAssociatedByKeys(group1.getKey(),
user3.getKey()));
+ assertFalse(session.getRelationshipManager().isAssociatedByKeys(group2.getKey(),
user1.getKey()));
+ assertFalse(session.getRelationshipManager().isAssociatedByKeys(group2.getKey(),
user3.getKey()));
assertTrue(session.getRelationshipManager().
- isAssociatedByIds(Arrays.asList(group1.getId()), Arrays.asList(user1.getId(),
user2.getId())));
+ isAssociatedByKeys(Arrays.asList(group1.getKey()), Arrays.asList(user1.getKey(),
user2.getKey())));
assertFalse(session.getRelationshipManager().
- isAssociatedByIds(Arrays.asList(group1.getId(), group2.getId()),
Arrays.asList(user1.getId(), user2.getId())));
+ isAssociatedByKeys(Arrays.asList(group1.getKey(), group2.getKey()),
Arrays.asList(user1.getKey(), user2.getKey())));
assertFalse(session.getRelationshipManager().
- isAssociatedByIds(Arrays.asList(group2.getId(), group3.getId()),
Arrays.asList(user1.getId())));
+ isAssociatedByKeys(Arrays.asList(group2.getKey(), group3.getKey()),
Arrays.asList(user1.getKey())));
// Associate groups / users - other methods
@@ -199,23 +199,23 @@
session.getRelationshipManager().disassociateUsers(Arrays.asList(group1),
Arrays.asList(user1, user2));
// reassociate #2
- session.getRelationshipManager().associateUsersByIds(Arrays.asList(group1.getId()),
Arrays.asList(user1.getId(), user2.getId()));
+
session.getRelationshipManager().associateUsersByKeys(Arrays.asList(group1.getKey()),
Arrays.asList(user1.getKey(), user2.getKey()));
assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(user1, user2)));
-
session.getRelationshipManager().disassociateUsersByIds(Arrays.asList(group1.getId()),
Arrays.asList(user1.getId(), user2.getId()));
+
session.getRelationshipManager().disassociateUsersByKeys(Arrays.asList(group1.getKey()),
Arrays.asList(user1.getKey(), user2.getKey()));
// reassociate #3
- session.getRelationshipManager().associateUserByIds(group1.getId(),
user1.getId());
- session.getRelationshipManager().associateUserByIds(group1.getId(),
user2.getId());
+ session.getRelationshipManager().associateUserByKeys(group1.getKey(),
user1.getKey());
+ session.getRelationshipManager().associateUserByKeys(group1.getKey(),
user2.getKey());
assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1),
Arrays.asList(user1, user2)));
session.getRelationshipManager().disassociateUsers(Arrays.asList(group1),
Arrays.asList(user1, user2));
// reassociate #4
- session.getRelationshipManager().associateUserByIds(group1.getId(),
user1.getId());
- session.getRelationshipManager().associateUserByIds(group2.getId(),
user1.getId());
- session.getRelationshipManager().associateUserByIds(group3.getId(),
user1.getId());
+ session.getRelationshipManager().associateUserByKeys(group1.getKey(),
user1.getKey());
+ session.getRelationshipManager().associateUserByKeys(group2.getKey(),
user1.getKey());
+ session.getRelationshipManager().associateUserByKeys(group3.getKey(),
user1.getKey());
assertTrue(session.getRelationshipManager().isAssociated(Arrays.asList(group1,
group2, group3), Arrays.asList(user1)));
@@ -257,8 +257,8 @@
assertEquals(3, session.getRelationshipManager().findAssociatedUsers(group1, false,
null).size());
assertEquals(0, session.getRelationshipManager().findAssociatedUsers(group2, false,
null).size());
- assertEquals(3,
session.getRelationshipManager().findAssociatedUsers(group1.getId(), false,
null).size());
- assertEquals(0,
session.getRelationshipManager().findAssociatedUsers(group2.getId(), false,
null).size());
+ assertEquals(3,
session.getRelationshipManager().findAssociatedUsers(group1.getKey(), false,
null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedUsers(group2.getKey(), false,
null).size());
// Find groups
@@ -269,9 +269,9 @@
assertEquals(0, session.getRelationshipManager().findAssociatedGroups(group2,
ORGANIZATION, true, false).size());
// #1
- assertEquals(2,
session.getRelationshipManager().findAssociatedGroups(group2.getId(), DEPARTMENT, true,
false, null).size());
- assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(group2.getId(), ORGANIZATION_UNIT,
true, false, null).size());
- assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(group2.getId(), ORGANIZATION, true,
false, null).size());
+ assertEquals(2,
session.getRelationshipManager().findAssociatedGroups(group2.getKey(), DEPARTMENT, true,
false, null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(group2.getKey(), ORGANIZATION_UNIT,
true, false, null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(group2.getKey(), ORGANIZATION, true,
false, null).size());
// #3
assertEquals(1, session.getRelationshipManager().findAssociatedGroups(group3,
ORGANIZATION_UNIT, false, false).size());
@@ -280,9 +280,9 @@
assertEquals(3, session.getRelationshipManager().findAssociatedGroups(group2, null,
true, false).size());
// #4
- assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(group3.getId(), ORGANIZATION_UNIT,
false, false, null).size());
- assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(group4.getId(), ORGANIZATION_UNIT,
false, false, null).size());
- assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(group2.getId(), ORGANIZATION, false,
false, null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(group3.getKey(), ORGANIZATION_UNIT,
false, false, null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(group4.getKey(), ORGANIZATION_UNIT,
false, false, null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(group2.getKey(), ORGANIZATION,
false, false, null).size());
// #5
assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user1).size());
@@ -291,10 +291,10 @@
assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user4).size());
// #6
- assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user1.getId(), null).size());
- assertEquals(2,
session.getRelationshipManager().findAssociatedGroups(user2.getId(), null).size());
- assertEquals(2,
session.getRelationshipManager().findAssociatedGroups(user3.getId(), null).size());
- assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user4.getId(), null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user1.getKey(), null).size());
+ assertEquals(2,
session.getRelationshipManager().findAssociatedGroups(user2.getKey(), null).size());
+ assertEquals(2,
session.getRelationshipManager().findAssociatedGroups(user3.getKey(), null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user4.getKey(), null).size());
// #7
assertEquals(1, session.getRelationshipManager().findAssociatedGroups(user1,
ORGANIZATION).size());
@@ -308,14 +308,14 @@
assertEquals(0, session.getRelationshipManager().findAssociatedGroups(user4,
ORGANIZATION_UNIT).size());
// #7
- assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user1.getId(), ORGANIZATION,
null).size());
- assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user1.getId(), ORGANIZATION_UNIT,
null).size());
- assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user2.getId(), ORGANIZATION,
null).size());
- assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user2.getId(), ORGANIZATION_UNIT,
null).size());
- assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user3.getId(), ORGANIZATION,
null).size());
- assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user3.getId(), ORGANIZATION_UNIT,
null).size());
- assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user4.getId(), ORGANIZATION,
null).size());
- assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user4.getId(), ORGANIZATION_UNIT,
null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user1.getKey(), ORGANIZATION,
null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user1.getKey(), ORGANIZATION_UNIT,
null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user2.getKey(), ORGANIZATION,
null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user2.getKey(), ORGANIZATION_UNIT,
null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user3.getKey(), ORGANIZATION,
null).size());
+ assertEquals(1,
session.getRelationshipManager().findAssociatedGroups(user3.getKey(), ORGANIZATION_UNIT,
null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user4.getKey(), ORGANIZATION,
null).size());
+ assertEquals(0,
session.getRelationshipManager().findAssociatedGroups(user4.getKey(), ORGANIZATION_UNIT,
null).size());
// Cleanup and check
session.getRelationshipManager().disassociateUsers(Arrays.asList(group1),
Arrays.asList(user1, user2, user3));
@@ -427,13 +427,13 @@
session.getRoleManager().createRoleType("rt1");
session.getRoleManager().createRoleType("rt2");
- session.getRoleManager().createRole("rt1", user1.getId(),
group1.getId());
- session.getRoleManager().createRole("rt1", user3.getId(),
group1.getId());
- session.getRoleManager().createRole("rt1", user4.getId(),
group1.getId());
- session.getRoleManager().createRole("rt2", user3.getId(),
group1.getId());
+ session.getRoleManager().createRole("rt1", user1.getKey(),
group1.getKey());
+ session.getRoleManager().createRole("rt1", user3.getKey(),
group1.getKey());
+ session.getRoleManager().createRole("rt1", user4.getKey(),
group1.getKey());
+ session.getRoleManager().createRole("rt2", user3.getKey(),
group1.getKey());
- session.getRoleManager().createRole("rt1", user3.getId(),
group2.getId());
- session.getRoleManager().createRole("rt2", user2.getId(),
group3.getId());
+ session.getRoleManager().createRole("rt1", user3.getKey(),
group2.getKey());
+ session.getRoleManager().createRole("rt2", user2.getKey(),
group3.getKey());
// Assert
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleManagerTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleManagerTest.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleManagerTest.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -33,8 +33,6 @@
import java.util.Map;
import java.util.HashMap;
-import java.util.Set;
-import java.util.HashSet;
/**
*
@@ -130,7 +128,7 @@
Role role1 = session.getRoleManager().createRole(rt1, user1, group1);
Role role2 = session.getRoleManager().createRole(rt1, user1, group2);
- Role role3 = session.getRoleManager().createRole("rt2", user1.getId(),
group1.getId());
+ Role role3 = session.getRoleManager().createRole("rt2", user1.getKey(),
group1.getKey());
@@ -145,35 +143,35 @@
//
assertEquals(2, session.getRoleManager().findGroupRoleTypes(group1).size());
- assertEquals(1, session.getRoleManager().findGroupRoleTypes(group2.getId(),
null).size());
+ assertEquals(1, session.getRoleManager().findGroupRoleTypes(group2.getKey(),
null).size());
//
assertEquals(2, session.getRoleManager().findRoles(user1, rt1).size());
- assertEquals(1, session.getRoleManager().findRoles(user1.getId(),
"rt2").size());
- assertEquals(1, session.getRoleManager().findRoles(group1.getId(),
"rt1").size());
+ assertEquals(1, session.getRoleManager().findRoles(user1.getKey(),
"rt2").size());
+ assertEquals(1, session.getRoleManager().findRoles(group1.getKey(),
"rt1").size());
assertEquals(1, session.getRoleManager().findRoles(group1, rt1).size());
//
assertEquals(2, session.getRoleManager().findGroupsWithRelatedRole(user1,
null).size());
- assertEquals(1, session.getRoleManager().findGroupsWithRelatedRole(user1.getId(),
ORGANIZATION, null).size());
+ assertEquals(1, session.getRoleManager().findGroupsWithRelatedRole(user1.getKey(),
ORGANIZATION, null).size());
//
assertEquals(2, session.getRoleManager().findRoleTypes(user1, group1).size());
- assertEquals(1, session.getRoleManager().findRoleTypes(user1.getId(),
group2.getId(), null).size());
+ assertEquals(1, session.getRoleManager().findRoleTypes(user1.getKey(),
group2.getKey(), null).size());
//
assertEquals(2, session.getRoleManager().findUserRoleTypes(user1).size());
- assertEquals(0, session.getRoleManager().findUserRoleTypes(user2.getId(),
null).size());
+ assertEquals(0, session.getRoleManager().findUserRoleTypes(user2.getKey(),
null).size());
//
assertTrue(session.getRoleManager().hasRole(user1, group1, rt1));
assertTrue(session.getRoleManager().hasRole(user1, group1, rt2));
- assertTrue(session.getRoleManager().hasRole("user1", group2.getId(),
"rt1"));
- assertFalse(session.getRoleManager().hasRole("user2", group2.getId(),
"rt1"));
+ assertTrue(session.getRoleManager().hasRole("user1", group2.getKey(),
"rt1"));
+ assertFalse(session.getRoleManager().hasRole("user2", group2.getKey(),
"rt1"));
assertFalse(session.getRoleManager().hasRole(user1, group1, rt3));
assertFalse(session.getRoleManager().hasRole(user1, group4, rt3));
@@ -235,11 +233,11 @@
session.getRoleManager().removeRole(rt1, user1, group1);
session.getRoleManager().removeRole(role2);
- session.getRoleManager().removeRole("rt2", user1.getId(),
group1.getId());
+ session.getRoleManager().removeRole("rt2", user1.getKey(),
group1.getKey());
assertFalse(session.getRoleManager().hasRole(user1, group1, rt1));
assertFalse(session.getRoleManager().hasRole(user1, group1, rt2));
- assertFalse(session.getRoleManager().hasRole("user1", group2.getId(),
"rt1"));
+ assertFalse(session.getRoleManager().hasRole("user1", group2.getKey(),
"rt1"));
//
@@ -251,29 +249,29 @@
//
assertEquals(0, session.getRoleManager().findGroupRoleTypes(group1).size());
- assertEquals(0, session.getRoleManager().findGroupRoleTypes(group2.getId(),
null).size());
+ assertEquals(0, session.getRoleManager().findGroupRoleTypes(group2.getKey(),
null).size());
//
assertEquals(0, session.getRoleManager().findRoles(user1, rt1).size());
- assertEquals(0, session.getRoleManager().findRoles(user1.getId(),
"rt2").size());
- assertEquals(0, session.getRoleManager().findRoles(group1.getId(),
"rt1").size());
+ assertEquals(0, session.getRoleManager().findRoles(user1.getKey(),
"rt2").size());
+ assertEquals(0, session.getRoleManager().findRoles(group1.getKey(),
"rt1").size());
assertEquals(0, session.getRoleManager().findRoles(group1, rt1).size());
//
assertEquals(0, session.getRoleManager().findGroupsWithRelatedRole(user1,
null).size());
- assertEquals(0, session.getRoleManager().findGroupsWithRelatedRole(user1.getId(),
ORGANIZATION, null).size());
+ assertEquals(0, session.getRoleManager().findGroupsWithRelatedRole(user1.getKey(),
ORGANIZATION, null).size());
//
assertEquals(0, session.getRoleManager().findRoleTypes(user1, group1).size());
- assertEquals(0, session.getRoleManager().findRoleTypes(user1.getId(),
group2.getId(), null).size());
+ assertEquals(0, session.getRoleManager().findRoleTypes(user1.getKey(),
group2.getKey(), null).size());
//
assertEquals(0, session.getRoleManager().findUserRoleTypes(user1).size());
- assertEquals(0, session.getRoleManager().findUserRoleTypes(user2.getId(),
null).size());
+ assertEquals(0, session.getRoleManager().findUserRoleTypes(user2.getKey(),
null).size());
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleQueryTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleQueryTest.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/RoleQueryTest.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -74,7 +74,7 @@
Role role1 = ids.getRoleManager().createRole(rt1, user1, group1);
Role role2 = ids.getRoleManager().createRole(rt1, user1, group2);
- Role role3 = ids.getRoleManager().createRole("rt2", user1.getId(),
group1.getId());
+ Role role3 = ids.getRoleManager().createRole("rt2", user1.getKey(),
group1.getKey());
// Test Query
Modified:
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/UserQueryTest.java
===================================================================
---
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/UserQueryTest.java 2009-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/api/UserQueryTest.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -86,7 +86,7 @@
Role role1 = ids.getRoleManager().createRole(rt1, user1, group1);
Role role2 = ids.getRoleManager().createRole(rt1, user1, group2);
- Role role3 = ids.getRoleManager().createRole("rt2", user1.getId(),
group1.getId());
+ Role role3 = ids.getRoleManager().createRole("rt2", user1.getKey(),
group1.getKey());
// Asserts
@@ -98,7 +98,7 @@
assertEquals(1, ids.execute(q).size());
assertEquals(1, ids.list(q).size());
- assertEquals("user1", ids.uniqueResult(q).getId());
+ assertEquals("user1", ids.uniqueResult(q).getKey());
//
qb.reset();
@@ -118,7 +118,7 @@
qb.reset();
qb.addAssociatedGroup(group1);
- qb.withUserId(user1.getId());
+ qb.withUserId(user1.getKey());
assertEquals(1, ids.execute(qb.createQuery()).size());
@@ -126,7 +126,7 @@
qb.reset();
qb.addAssociatedGroup(group2);
- qb.withUserId(user1.getId());
+ qb.withUserId(user1.getKey());
assertEquals(0, ids.execute(qb.createQuery()).size());
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-11-11
13:18:39 UTC (rev 924)
+++
idm/trunk/idm-testsuite/src/test/java/org/jboss/identity/idm/impl/store/ldap/LDAPIdentityStoreTestCase.java 2009-11-11
20:46:11 UTC (rev 925)
@@ -208,7 +208,7 @@
//
// IdentityObject io = store.findIdentityObject(ctx, "admin",
IdentityTypeEnum.USER);
// assertEquals("admin", io.getName());
-// assertEquals("uid=admin,ou=People,o=test,dc=portal,dc=example,dc=com",
io.getId().toString());
+// assertEquals("uid=admin,ou=People,o=test,dc=portal,dc=example,dc=com",
io.getKey().toString());
//
// //
//