JBoss Identity SVN: r61 - in trunk: identity-impl/src/main/java/org/jboss/identity/impl/types and 3 other directories.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2008-09-04 15:41:50 -0400 (Thu, 04 Sep 2008)
New Revision: 61
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java
Log:
- Remove direct getters connection from identity interfaces as with big number of entities paginated searches are needed
- Use only getIdentityType in Role and Group
- Some extensions to FeaturesDescription
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java 2008-09-03 15:44:20 UTC (rev 60)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java 2008-09-04 19:41:50 UTC (rev 61)
@@ -22,6 +22,7 @@
package org.jboss.identity.api.store;
import java.util.Set;
+import java.util.Map;
import org.jboss.identity.api.exception.IdentityException;
import org.jboss.identity.api.exception.IdentityTypeNotSupportedException;
@@ -83,4 +84,15 @@
boolean isRelationshipSupported(IdentityType fromType, IdentityType toType,
RelationshipType relationshipType)
throws IdentityException;
+
+ /**
+ * @return Set of RelationshipType supported in this store
+ */
+ Set<RelationshipType> getSupportedRelationshipTypes();
+
+ /**
+ * @return A mapping of RelationshipType and IdentityType objects that can have such relationship in this store
+ */
+ Map<RelationshipType, Map<IdentityType, IdentityType>> getSupportedRelationshipTypeMappings();
+
}
\ No newline at end of file
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2008-09-03 15:44:20 UTC (rev 60)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2008-09-04 19:41:50 UTC (rev 61)
@@ -28,6 +28,7 @@
import org.jboss.identity.model.roles.Role;
import org.jboss.identity.model.IdentityType;
import org.jboss.identity.model.groups.Group;
+import org.jboss.identity.model.groups.GroupType;
import org.jboss.identity.model.policy.PolicyValidationException;
import org.jboss.identity.model.policy.RelationshipPolicy;
@@ -65,27 +66,29 @@
return name;
}
- public Group getParent()
+ public List<IdentityAttribute> getAttributes()
{
return null;
}
- public List<Role> getRoles()
+ public void validatePolicy() throws PolicyValidationException
{
- return null;
}
- public List<Group> getSubGroups()
+ public String getDisplayName()
{
return null;
}
- public List<IdentityAttribute> getAttributes()
+ public String getDescription()
{
return null;
}
- public void validatePolicy() throws PolicyValidationException
+ public GroupType getGroupType()
{
+ return null;
}
+
+
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java 2008-09-03 15:44:20 UTC (rev 60)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java 2008-09-04 19:41:50 UTC (rev 61)
@@ -35,16 +35,4 @@
public interface Identity extends IdentityObject
{
-
- /**
- * <p>Return a list of Roles</p>
- * @return
- */
- List<Role> getRoles();
-
- /**
- * <p>Return a list of groups</p>
- * @return
- */
- List<Group> getGroups();
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java 2008-09-03 15:44:20 UTC (rev 60)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java 2008-09-04 19:41:50 UTC (rev 61)
@@ -24,6 +24,7 @@
import java.util.List;
import org.jboss.identity.model.policy.PolicyValidationException;
+import org.jboss.identity.model.policy.RelationshipPolicy;
/**
* Marker Interface representing
@@ -39,6 +40,12 @@
* @return
*/
String getName();
-
+
+ /**
+ * Return a list of relationship policies
+ * @return
+ */
+ List<RelationshipPolicy<IdentityType,IdentityType>> getRelationshipPolicies();
+
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java 2008-09-03 15:44:20 UTC (rev 60)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java 2008-09-04 19:41:50 UTC (rev 61)
@@ -39,31 +39,16 @@
*/
public interface Group extends IdentityObject
{
- /**
- * <p>Get the name</p>
- * @return
- */
- String getName();
-
- /**
- * <p>Get the list of roles</p>
- * @return
- */
- List<Role> getRoles();
-
- /**
- * <p>Get the parent group in hierarchy.</p>
- * <p> May be <i>Null<i>.</p>
- * @return
- */
- Group getParent();
-
- /**
- * <p>Get the subgroups contained.</p>
- * <p>May be <i>Null<i>.</p>
- * @return
- */
- List<Group> getSubGroups();
-
+ /**
+ * @return group display name
+ */
+ String getDisplayName();
+
+ /**
+ * @return description
+ */
+ String getDescription();
+
+
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java 2008-09-03 15:44:20 UTC (rev 60)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java 2008-09-04 19:41:50 UTC (rev 61)
@@ -35,22 +35,7 @@
*/
public interface GroupType extends IdentityType
{
- /**
- * Add a relationship policy
- * @param aRelationPolicy
- */
- void add(RelationshipPolicy<GroupType,GroupType> aRelationPolicy);
- /**
- * Add a collection of relationship policies
- * @param relationList
- */
- void addAll(Collection<RelationshipPolicy<GroupType,GroupType>> relationList);
- /**
- * Return a list of relationship policies
- * @return
- */
- List<RelationshipPolicy<GroupType,GroupType>> getRelationshipPolicies();
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java 2008-09-03 15:44:20 UTC (rev 60)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java 2008-09-04 19:41:50 UTC (rev 61)
@@ -22,6 +22,7 @@
package org.jboss.identity.model.groups;
import org.jboss.identity.model.policy.RelationshipPolicy;
+import org.jboss.identity.model.IdentityType;
import java.util.Collection;
import java.util.List;
@@ -56,18 +57,9 @@
return builder.toString();
}
- public void add(RelationshipPolicy<GroupType, GroupType> aRelationPolicy)
- {
- }
-
- public void addAll(Collection<RelationshipPolicy<GroupType, GroupType>> relationList)
+ public List<RelationshipPolicy<IdentityType, IdentityType>> getRelationshipPolicies()
{
-
- }
-
- public List<RelationshipPolicy<GroupType, GroupType>> getRelationshipPolicies()
- {
return null;
}
}
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java 2008-09-03 15:44:20 UTC (rev 60)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java 2008-09-04 19:41:50 UTC (rev 61)
@@ -34,21 +34,16 @@
*/
public interface Role extends IdentityObject
{
+
/**
- * Get the type of role
- * @return
+ * @return group display name
*/
- RoleType getRoleType();
+ String getDisplayName();
/**
- * Get a list of Identities
- * @return
+ * @return description
*/
- List<Identity> getIdentities();
+ String getDescription();
- /**
- * Get a list of Groups
- * @return
- */
- List<Group> getGroups();
+
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java 2008-09-03 15:44:20 UTC (rev 60)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java 2008-09-04 19:41:50 UTC (rev 61)
@@ -22,7 +22,10 @@
package org.jboss.identity.model.roles;
import org.jboss.identity.model.IdentityType;
+import org.jboss.identity.model.policy.RelationshipPolicy;
+import java.util.List;
+
/**
* Type of Role
* @author Anil.Saldhana(a)redhat.com
@@ -54,4 +57,11 @@
{
return this.name();
}
+
+ public List<RelationshipPolicy<IdentityType, IdentityType>> getRelationshipPolicies()
+ {
+ return null;
+ }
+
+
}
\ No newline at end of file
15 years, 9 months
JBoss Identity SVN: r60 - in trunk: identity-api/src/main/java/org/jboss/identity/api/managers and 3 other directories.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2008-09-03 11:44:20 -0400 (Wed, 03 Sep 2008)
New Revision: 60
Added:
trunk/identity-api/src/main/java/org/jboss/identity/api/Transaction.java
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/session/Session.java
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java
Log:
- Connect Session with a Realm in IdentityManager
- Add simple notion of Transaction to Session
- In IdentityManager leave only methods managing Realm
- Remove references to the IdentityStore and IdentityStoreRepository from main API - IdentityManager
- Move all methods managing identity objects (CRUD and relationships) to Session
- Minor improvements in IdentityStore methods
- Make IdentityStoreRepository extends IdentityStore so expose all identity objects management methods to route them to actual store implementations
- Comment out RelationshipManager for now
Added: trunk/identity-api/src/main/java/org/jboss/identity/api/Transaction.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/Transaction.java (rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/Transaction.java 2008-09-03 15:44:20 UTC (rev 60)
@@ -0,0 +1,53 @@
+/*
+* 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.api;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Transaction
+{
+
+ /**
+ * Begin new transaction
+ */
+ void start();
+
+ /**
+ * Commit transaction - flush associated session
+ */
+ void commit();
+
+ /**
+ * Rollback transaction
+ */
+ void rollback();
+
+ /**
+ *
+ * @return
+ */
+ boolean isActive();
+
+}
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java 2008-09-03 07:49:37 UTC (rev 59)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java 2008-09-03 15:44:20 UTC (rev 60)
@@ -44,6 +44,9 @@
*/
public interface IdentityManager
{
+
+ // Realm operations
+
/**
* <p>Create a Realm or return an already
* created realm. Bootstrapping includes generating
@@ -60,61 +63,8 @@
* @return
*/
Realm bootstrap(String realmName, InputStream config);
-
- /**
- * Create a Session
- * @param sessionType
- * @param identityName
- * @return
- */
- Session createSession(String sessionType, String identityName);
-
- /**
- * <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);
-
- /**
- * <p>Create an identity in the realm</p>
- * @param realm
- * @param identityName
- * @return
- */
- Identity createIdentity(Realm realm, String identityName) throws IdentityException;
-
- /**
- * <p>Create a group in the realm</p>
- * @param realm
- * @param groupName
- * @return
- */
- Group createGroup(Realm realm, String groupName) throws IdentityException;
-
- /**
- * Create a group of a particular type
- * @param realm
- * @param groupName
- * @param groupType
- * @return
- */
- Group createGroup(Realm realm, String groupName, GroupType groupType)
- throws IdentityException;
-
- /**
- * <p>Create a role in the realm</p>
- * @param realm
- * @param roleName name of role
- * @param roleType Type of Role
- * @return
- */
- Role createRole(Realm realm, String roleName, RoleType roleType)
- throws IdentityException;
-
- /**
+ /**
* <p>Associate a relationship between two realms</p>
* @param realmA
* @param realmB
@@ -144,25 +94,30 @@
RelationshipType getRelationship(Realm fromRealm, Realm toRealm);
/**
- * <p>Returns relationship manager for a given realm</p>
- * @param realm
+ * <p>Return a realm</p>
+ * @param realmName
+ * @param shouldBootstrap Should we bootstrap if a realm does not exist?
* @return
- * @throws IdentityException
*/
- RelationshipManager getRelationshipManager(Realm realm) throws IdentityException;
+ Realm getRealm(String realmName, boolean shouldBootstrap);
+
+ // Session
+
/**
- * <p>Return the configured PersistenceManager</p>
+ * Create a Session
+ * @param realm
* @return
*/
- PersistenceManager getPersistenceManager();
-
+ Session createSession(Realm realm);
+
+
/**
- * Return the IdentityStoreRepository associated with
- * a particular realm
+ * Get current open session associated with a realm
* @param realm
* @return
*/
- IdentityStoreRepository getRepository(Realm realm);
+ Session getCurrentSession(Realm realm);
+
}
\ No newline at end of file
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java 2008-09-03 07:49:37 UTC (rev 59)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java 2008-09-03 15:44:20 UTC (rev 60)
@@ -2,7 +2,7 @@
* JBoss, Home of Professional Open Source.
* Copyright 2008, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
+ * 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
@@ -41,7 +41,7 @@
* @return
*/
IdentityStoreRepository getIdentityStoreRepository(Realm realm);
-
+
/**
* <p>Get the Identity Store configured for an identity type
* at the realm level </p>
@@ -51,5 +51,5 @@
* @return
*/
IdentityStore getIdentityStore(Realm realm, IdentityType identityType);
-
+
}
\ No newline at end of file
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java 2008-09-03 07:49:37 UTC (rev 59)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java 2008-09-03 15:44:20 UTC (rev 60)
@@ -1,181 +1,181 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.api.managers;
-
-import java.util.List;
-import java.util.Set;
-
-import org.jboss.identity.api.exception.PersistenceManagerNotFoundException;
-import org.jboss.identity.api.exception.SessionNotOpenException;
-import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.roles.Role;
-import org.jboss.identity.model.groups.Group;
-import org.jboss.identity.model.relation.RelationshipType;
-
-/**
- * <p>Manages the relationships between
- * roles, groups and identities within a realm</p>
- * @author Anil.Saldhana(a)redhat.com
- * @author boleslaw dot dawidowicz at redhat anotherdot com
- * @since Jul 10, 2008
- */
-public interface RelationshipManager
-{
- /**
- * <p>Associate a relationship between two groups</p>
- * @param groupA
- * @param groupB
- * @param relationshipType
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void associate(Group groupA, Group groupB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
- /**
- * Associate a relationship between one group and a list of other groups
- * @param groupA
- * @param groupB a list of groups which are related to groupA
- * @param relationshipType
- * @throws PersistenceManagerNotFoundException
- * @throws SessionNotOpenException
- */
- void associate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
-
-
- /**
- * <p>Associate a role with an Identity</p>
- * @param identity
- * @param aRole
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void associate(Identity identity, Role aRole)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
- /**
- * <p>Associate a list of roles with an Identity</p>
- * @param identity
- * @param aRoleList
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void associate(Identity identity, List<Role> aRoleList)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
- /**
- * <p>Associate a group with an identity</p>
- * @param identity
- * @param aGroup
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void associate(Identity identity, Group aGroup)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
- /**
- * <p>Associate a set of groups with an identity</p>
- * @param identity
- * @param aGroupSet
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void associate(Identity identity, Set<Group> aGroupSet)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
- /**
- * <p>Disassociate a relationship between two groups</p>
- * @param groupA
- * @param groupB
- * @param relationshipType
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void disassociate(Group groupA, Group groupB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
- /**
- * Disassociate a relationship between one group and a list of other groups
- * @param groupA
- * @param groupB
- * @param relationshipType
- * @throws PersistenceManagerNotFoundException
- * @throws SessionNotOpenException
- */
- void disassociate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
-
-
- /**
- * <p>Disassociate a role with an Identity</p>
- * @param identity
- * @param aRole
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void disassociate(Identity identity, Role aRole)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
- /**
- * <p>Disassociate a list of roles with an Identity</p>
- * @param identity
- * @param aRoleList
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void disassociate(Identity identity, List<Role> aRoleList)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
- /**
- * <p>Disassociate a group with an identity</p>
- * @param identity
- * @param aGroup
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void disassociate(Identity identity, Group aGroup)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
- /**
- * <p>Disassociate a set of groups with an identity</p>
- * @param identity
- * @param aGroupSet
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void disassociate(Identity identity, Set<Group> aGroupSet)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
-
- /**
- * @param fromGroup
- * @param toGroup
- * @return returns a relationship type between this and given group.
- */
- RelationshipType getRelationship(Group fromGroup, Group toGroup);
-
-
-
-
-}
\ No newline at end of file
+///*
+// * JBoss, Home of Professional Open Source.
+// * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+// * as indicated by the @author tags. See the copyright.txt file 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.api.managers;
+//
+//import java.util.List;
+//import java.util.Set;
+//
+//import org.jboss.identity.api.exception.PersistenceManagerNotFoundException;
+//import org.jboss.identity.api.exception.SessionNotOpenException;
+//import org.jboss.identity.model.Identity;
+//import org.jboss.identity.model.roles.Role;
+//import org.jboss.identity.model.groups.Group;
+//import org.jboss.identity.model.relation.RelationshipType;
+//
+///**
+// * <p>Manages the relationships between
+// * roles, groups and identities within a realm</p>
+// * @author Anil.Saldhana(a)redhat.com
+// * @author boleslaw dot dawidowicz at redhat anotherdot com
+// * @since Jul 10, 2008
+// */
+//public interface RelationshipManager
+//{
+// /**
+// * <p>Associate a relationship between two groups</p>
+// * @param groupA
+// * @param groupB
+// * @param relationshipType
+// * @throws PersistenceManagerNotFoundException PM not set
+// * @throws SessionNotOpenException session is not open
+// */
+// void associate(Group groupA, Group groupB, RelationshipType relationshipType)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+// /**
+// * Associate a relationship between one group and a list of other groups
+// * @param groupA
+// * @param groupB a list of groups which are related to groupA
+// * @param relationshipType
+// * @throws PersistenceManagerNotFoundException
+// * @throws SessionNotOpenException
+// */
+// void associate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+//
+//
+// /**
+// * <p>Associate a role with an Identity</p>
+// * @param identity
+// * @param aRole
+// * @throws PersistenceManagerNotFoundException PM not set
+// * @throws SessionNotOpenException session is not open
+// */
+// void associate(Identity identity, Role aRole)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+// /**
+// * <p>Associate a list of roles with an Identity</p>
+// * @param identity
+// * @param aRoleList
+// * @throws PersistenceManagerNotFoundException PM not set
+// * @throws SessionNotOpenException session is not open
+// */
+// void associate(Identity identity, List<Role> aRoleList)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+// /**
+// * <p>Associate a group with an identity</p>
+// * @param identity
+// * @param aGroup
+// * @throws PersistenceManagerNotFoundException PM not set
+// * @throws SessionNotOpenException session is not open
+// */
+// void associate(Identity identity, Group aGroup)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+// /**
+// * <p>Associate a set of groups with an identity</p>
+// * @param identity
+// * @param aGroupSet
+// * @throws PersistenceManagerNotFoundException PM not set
+// * @throws SessionNotOpenException session is not open
+// */
+// void associate(Identity identity, Set<Group> aGroupSet)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+// /**
+// * <p>Disassociate a relationship between two groups</p>
+// * @param groupA
+// * @param groupB
+// * @param relationshipType
+// * @throws PersistenceManagerNotFoundException PM not set
+// * @throws SessionNotOpenException session is not open
+// */
+// void disassociate(Group groupA, Group groupB, RelationshipType relationshipType)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+// /**
+// * Disassociate a relationship between one group and a list of other groups
+// * @param groupA
+// * @param groupB
+// * @param relationshipType
+// * @throws PersistenceManagerNotFoundException
+// * @throws SessionNotOpenException
+// */
+// void disassociate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+//
+//
+// /**
+// * <p>Disassociate a role with an Identity</p>
+// * @param identity
+// * @param aRole
+// * @throws PersistenceManagerNotFoundException PM not set
+// * @throws SessionNotOpenException session is not open
+// */
+// void disassociate(Identity identity, Role aRole)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+// /**
+// * <p>Disassociate a list of roles with an Identity</p>
+// * @param identity
+// * @param aRoleList
+// * @throws PersistenceManagerNotFoundException PM not set
+// * @throws SessionNotOpenException session is not open
+// */
+// void disassociate(Identity identity, List<Role> aRoleList)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+// /**
+// * <p>Disassociate a group with an identity</p>
+// * @param identity
+// * @param aGroup
+// * @throws PersistenceManagerNotFoundException PM not set
+// * @throws SessionNotOpenException session is not open
+// */
+// void disassociate(Identity identity, Group aGroup)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+// /**
+// * <p>Disassociate a set of groups with an identity</p>
+// * @param identity
+// * @param aGroupSet
+// * @throws PersistenceManagerNotFoundException PM not set
+// * @throws SessionNotOpenException session is not open
+// */
+// void disassociate(Identity identity, Set<Group> aGroupSet)
+// throws PersistenceManagerNotFoundException,SessionNotOpenException;
+//
+// /**
+// * @param fromGroup
+// * @param toGroup
+// * @return returns a relationship type between this and given group.
+// */
+// RelationshipType getRelationship(Group fromGroup, Group toGroup);
+//
+//
+//
+//
+//}
\ No newline at end of file
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/session/Session.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/session/Session.java 2008-09-03 07:49:37 UTC (rev 59)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/session/Session.java 2008-09-03 15:44:20 UTC (rev 60)
@@ -22,7 +22,23 @@
package org.jboss.identity.api.session;
import org.jboss.identity.api.exception.IdentityException;
+import org.jboss.identity.api.exception.SessionNotOpenException;
+import org.jboss.identity.api.Transaction;
+import org.jboss.identity.model.Identity;
+import org.jboss.identity.model.IdentityObject;
+import org.jboss.identity.model.IdentityType;
+import org.jboss.identity.model.relation.RelationshipType;
+import org.jboss.identity.model.roles.Role;
+import org.jboss.identity.model.roles.RoleType;
+import org.jboss.identity.model.groups.Group;
+import org.jboss.identity.model.groups.GroupType;
+import org.jboss.identity.model.domain.Realm;
+import java.util.List;
+import java.util.Set;
+import java.util.Collection;
+import java.util.Map;
+
/**
* <p>An Identity Session</p>
* @author boleslaw dot dawidowicz at redhat anotherdot com
@@ -60,4 +76,375 @@
* @return
*/
boolean isOpen();
+
+ /**
+ *
+ * @return
+ */
+ Transaction beginTransaction();
+
+ /**
+ * Transaction instance assosiated with this session
+ * @return
+ */
+ Transaction getTransaction();
+
+
+ // IDM methods
+
+ // Create
+
+ /**
+ * <p>Create an identity in the realm</p>
+ * @param identityName
+ * @return
+ */
+ Identity createIdentity(String identityName) throws IdentityException;
+
+ /**
+ * Create a group of a particular type
+ * @param groupName
+ * @param groupType
+ * @return
+ */
+ Group createGroup(String groupName, GroupType groupType)
+ throws IdentityException;
+
+ /**
+ * <p>Create a role in the realm</p>
+ * @param roleName name of role
+ * @param roleType Type of Role
+ * @return
+ */
+ Role createRole(String roleName, RoleType roleType)
+ throws IdentityException;
+
+ // Remove
+
+ /**
+ * Remove given identity
+ *
+ * @param identity
+ * @throws IdentityException
+ */
+ void removeIdentity(IdentityObject identity) throws IdentityException;
+
+ // Realtionships
+
+ /**
+ * <p>Associate a relationship between two groups</p>
+ * @param groupA
+ * @param groupB
+ * @param relationshipType
+ * @throws IdentityException
+ */
+ void associate(Group groupA, Group groupB, RelationshipType relationshipType)
+ throws IdentityException;
+
+ /**
+ * Associate a relationship between one group and a list of other groups
+ * @param groupA
+ * @param groupB a list of groups which are related to groupA
+ * @param relationshipType
+ * @throws IdentityException
+ */
+ void associate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
+ throws IdentityException;
+
+
+
+ /**
+ * <p>Associate a role with an Identity</p>
+ * @param identity
+ * @param aRole
+ * @throws IdentityException
+ */
+ void associate(Identity identity, Role aRole)
+ throws IdentityException;
+
+ /**
+ * <p>Associate a list of roles with an Identity</p>
+ * @param identity
+ * @param aRoleList
+ * @throws IdentityException
+ */
+ void associate(Identity identity, List<Role> aRoleList)
+ throws IdentityException;
+
+ /**
+ * <p>Associate a group with an identity</p>
+ * @param identity
+ * @param aGroup
+ * @throws IdentityException
+ */
+ void associate(Identity identity, Group aGroup)
+ throws IdentityException;
+
+ /**
+ * <p>Associate a set of groups with an identity</p>
+ * @param identity
+ * @param aGroupSet
+ * @throws IdentityException
+ */
+ void associate(Identity identity, Set<Group> aGroupSet)
+ throws IdentityException;
+
+ /**
+ * <p>Disassociate a relationship between two groups</p>
+ * @param groupA
+ * @param groupB
+ * @param relationshipType
+ * @throws IdentityException
+ */
+ void disassociate(Group groupA, Group groupB, RelationshipType relationshipType)
+ throws IdentityException;
+
+ /**
+ * Disassociate a relationship between one group and a list of other groups
+ * @param groupA
+ * @param groupB
+ * @param relationshipType
+ * @throws IdentityException
+ */
+ void disassociate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
+ throws IdentityException;
+
+
+
+ /**
+ * <p>Disassociate a role with an Identity</p>
+ * @param identity
+ * @param aRole
+ * @throws IdentityException
+ */
+ void disassociate(Identity identity, Role aRole)
+ throws IdentityException;
+
+ /**
+ * <p>Disassociate a list of roles with an Identity</p>
+ * @param identity
+ * @param aRoleList
+ * @throws IdentityException
+ */
+ void disassociate(Identity identity, List<Role> aRoleList)
+ throws IdentityException;
+
+ /**
+ * <p>Disassociate a group with an identity</p>
+ * @param identity
+ * @param aGroup
+ * @throws IdentityException
+ */
+ void disassociate(Identity identity, Group aGroup)
+ throws IdentityException;
+
+ /**
+ * <p>Disassociate a set of groups with an identity</p>
+ * @param identity
+ * @param aGroupSet
+ * @throws org.jboss.identity.api.exception.PersistenceManagerNotFoundException PM not set
+ * @throws SessionNotOpenException session is not open
+ */
+ void disassociate(Identity identity, Set<Group> aGroupSet)
+ throws IdentityException;
+
+ /**
+ * @param fromGroup
+ * @param toGroup
+ * @return returns a relationship type between this and given group.
+ */
+ RelationshipType getRelationship(Group fromGroup, Group toGroup);
+
+ // Relationship - abstract methods
+
+ /**
+ * Create directional relationship of a given type between identities
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @param relationshipType
+ * @throws IdentityException
+ */
+ <R extends RelationshipType> void createRelationship(IdentityObject fromIdentity,
+ IdentityObject toIdentity,
+ R relationshipType) throws IdentityException;
+
+ /**
+ * Remove relationship between identities. Relationships can be directional so
+ * order of parameters matters
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @param relationshipType
+ * @throws IdentityException
+ */
+ <R extends RelationshipType> void removeRelationship(IdentityObject fromIdentity,
+ IdentityObject toIdentity,
+ R relationshipType) throws IdentityException;
+
+ /**
+ * Remove all relationships between identities. Direction of relationships doesn't
+ * matter - all active relationships
+ * will be removed
+ *
+ * @param identity1
+ * @param identity2
+ * @throws IdentityException
+ */
+ void removeRelationships(IdentityObject identity1, IdentityObject identity2)
+ throws IdentityException;
+
+ /**
+ * Resolve relationship types between two identities. Relationships can be directional
+ * so order of parameters matters
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @return
+ * @throws IdentityException
+ */
+ Set<RelationshipType> resolveRelationships(IdentityObject fromIdentity, IdentityObject toIdentity)
+ throws IdentityException;
+
+
+ // Search operations
+
+ /**
+ * @param identityType
+ * @return a number of stored identities with a given type
+ * @throws IdentityException
+ */
+ <T extends IdentityType> int getIdentityTypeCount(T identityType)
+ throws IdentityException;
+
+ /**
+ * Find identity with a given name
+ *
+ * @param name
+ * @param identityType
+ * @return
+ * @throws IdentityException
+ */
+ IdentityObject findIdentityObject(String name, IdentityType identityType) throws IdentityException;
+
+ /**
+ * Find identity with a given id
+ *
+ * @param id
+ * @return
+ * @throws IdentityException
+ */
+ IdentityObject findIdentityObject(Object id) throws IdentityException;
+
+ /**
+ * Find identities with a given type paginated and ordered.
+ * If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated
+ * parameters will take no effect
+ *
+ * @param identityType
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdentityException
+ */
+ <T extends IdentityType> Collection<IdentityObject> findIdentityObject(T identityType,
+ int offset, int limit,
+ String orderedByAttributeName,
+ boolean ascending) throws IdentityException;
+
+ /**
+ * Find identities with a given attributes values. If the paginatedSearch or
+ * orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no effect
+ *
+ * @param identityType
+ * @param attributes
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdentityException
+ */
+ <T extends IdentityType> Collection<IdentityObject> findIdentityObject(T identityType,
+ Map<String, String[]> attributes,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending) throws IdentityException;
+
+ /**
+ * Find identites that have relationship with given identity. Relationships are directional (from parent to child).
+ * If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will
+ * take no effect
+ *
+ * @param identity
+ * @param relationshipType
+ * @param parent defines if given identity is parent or child side in the
+ * relationship - default is true (parent)
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdentityException
+ */
+ <R extends RelationshipType>Collection<IdentityObject> findIdentityObject(IdentityObject identity,
+ R relationshipType,
+ boolean parent,
+ int offset, int limit,
+ String orderedByAttributeName,
+ boolean ascending) throws IdentityException;
+
+ // Attributes
+
+ /**
+ * @param identityType
+ * @return names of supported attributes
+ * @throws IdentityException
+ */
+ <T extends IdentityType> Set<String> getSupportedAttributeNames(T identityType)
+ throws IdentityException;
+
+ /**
+ * Get attributes for the given identity
+ *
+ * @param identity
+ * @return
+ * @throws IdentityException
+ */
+ Map<String, String[]> getAttributes(IdentityObject identity) throws IdentityException;
+
+ /**
+ * Update attributes with new values - previous values will be overwritten
+ * @param identity
+ * @param attributes
+ * @throws IdentityException
+ */
+ void updateAttributes(IdentityObject identity, Map<String, String[]> attributes)
+ throws IdentityException;
+
+ /**
+ * Add new attributes - if attribute with given name already exists the values
+ * will be appended
+ *
+ * @param identity
+ * @param attributes
+ * @throws IdentityException
+ */
+ void addAttributes(IdentityObject identity, Map<String, String[]> attributes)
+ throws IdentityException;
+
+ /**
+ * Remove attributes
+ *
+ * @param identity
+ * @param attributes
+ */
+ void removeAttributes(IdentityObject identity, Set<String> attributes)
+ throws IdentityException;
+
+
}
\ No newline at end of file
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java 2008-09-03 07:49:37 UTC (rev 59)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java 2008-09-03 15:44:20 UTC (rev 60)
@@ -64,10 +64,11 @@
* Create new identity with a given name
*
* @param name
+ * @param identityType
* @return
* @throws IdentityException
*/
- IdentityObject createIdentity(String name) throws IdentityException;
+ IdentityObject createIdentity(String name, IdentityType identityType) throws IdentityException;
/**
* Remove given identity
@@ -89,10 +90,11 @@
* Find identity with a given name
*
* @param name
+ * @param identityType
* @return
* @throws IdentityException
*/
- IdentityObject findIdentity(String name) throws IdentityException;
+ IdentityObject findIdentity(String name, IdentityType identityType) throws IdentityException;
/**
* Find identity with a given id
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java 2008-09-03 07:49:37 UTC (rev 59)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java 2008-09-03 15:44:20 UTC (rev 60)
@@ -35,7 +35,7 @@
* @author Anil.Saldhana(a)redhat.com
* @since Jul 10, 2008
*/
-public interface IdentityStoreRepository
+public interface IdentityStoreRepository extends IdentityStore
{
/**
* @return a set of configured identity stores
@@ -53,10 +53,4 @@
*/
IdentityStore getIdentityStore(IdentityType identityType);
- /**
- * Register an identity store for a given identity type
- * @param identityType
- * @param identityStore
- */
- void register(IdentityType identityType, IdentityStore identityStore);
}
\ No newline at end of file
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java 2008-09-03 07:49:37 UTC (rev 59)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java 2008-09-03 15:44:20 UTC (rev 60)
@@ -61,14 +61,14 @@
- public IdentityObject createIdentity(String name) throws IdentityException
+ public IdentityObject createIdentity(String name, IdentityType type) throws IdentityException
{
//Is there one already available?
IdentityObject identity = this.findIdentity(name);
if(identity == null)
{
- identity = new SimpleIdentity(name);
- identities.add(identity);
+ identity = new SimpleIdentity(name);
+ identities.add(identity);
}
return identity;
}
@@ -101,13 +101,8 @@
return null;
}
- public IdentityObject findIdentity(String name) throws IdentityException
+ public IdentityObject findIdentity(String name, IdentityType identityType) throws IdentityException
{
- for(IdentityObject identity: identities)
- {
- if(name.equals(identity.getName()))
- return identity;
- }
return null;
}
15 years, 9 months
JBoss Identity SVN: r59 - in trunk: identity-model/src/main/java/org/jboss/identity/model/attribute and 2 other directories.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2008-09-03 03:49:37 -0400 (Wed, 03 Sep 2008)
New Revision: 59
Modified:
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java
Log:
- add getters for identities/groups into Identity
- fix breaking code
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2008-09-03 07:38:39 UTC (rev 58)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2008-09-03 07:49:37 UTC (rev 59)
@@ -60,14 +60,6 @@
return null;
}
- public void add(RelationshipPolicy<Group, Group> relationPolicy)
- {
- }
-
- public void addAll(Collection<RelationshipPolicy<Group, Group>> relationList)
- {
- }
-
public String getName()
{
return name;
@@ -78,11 +70,6 @@
return null;
}
- public List<RelationshipPolicy<Group, Group>> getRelationshipPolicies()
- {
- return null;
- }
-
public List<Role> getRoles()
{
return null;
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java 2008-09-03 07:38:39 UTC (rev 58)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java 2008-09-03 07:49:37 UTC (rev 59)
@@ -33,7 +33,7 @@
* @author Anil.Saldhana(a)redhat.com
* @since Jul 13, 2008
*/
-public class PasswordAttribute<T extends IdentityObject>
+public class PasswordAttribute<T extends IdentityType>
implements IdentityAttribute
{
/**
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java 2008-09-03 07:38:39 UTC (rev 58)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java 2008-09-03 07:49:37 UTC (rev 59)
@@ -65,21 +65,5 @@
*/
List<Group> getSubGroups();
- /**
- * Add a relationship policy
- * @param aRelationPolicy
- */
- void add(RelationshipPolicy<Group,Group> aRelationPolicy);
-
- /**
- * Add a collection of relationship policies
- * @param relationList
- */
- void addAll(Collection<RelationshipPolicy<Group,Group>> relationList);
-
- /**
- * Return a list of relationship policies
- * @return
- */
- List<RelationshipPolicy<Group,Group>> getRelationshipPolicies();
+
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java 2008-09-03 07:38:39 UTC (rev 58)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java 2008-09-03 07:49:37 UTC (rev 59)
@@ -22,7 +22,11 @@
package org.jboss.identity.model.groups;
import org.jboss.identity.model.IdentityType;
+import org.jboss.identity.model.policy.RelationshipPolicy;
+import java.util.Collection;
+import java.util.List;
+
/**
* Type of Group
* @author Anil.Saldhana(a)redhat.com
@@ -31,5 +35,22 @@
*/
public interface GroupType extends IdentityType
{
+ /**
+ * Add a relationship policy
+ * @param aRelationPolicy
+ */
+ void add(RelationshipPolicy<GroupType,GroupType> aRelationPolicy);
+ /**
+ * Add a collection of relationship policies
+ * @param relationList
+ */
+ void addAll(Collection<RelationshipPolicy<GroupType,GroupType>> relationList);
+
+ /**
+ * Return a list of relationship policies
+ * @return
+ */
+ List<RelationshipPolicy<GroupType,GroupType>> getRelationshipPolicies();
+
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java 2008-09-03 07:38:39 UTC (rev 58)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/groups/SimpleGroupType.java 2008-09-03 07:49:37 UTC (rev 59)
@@ -21,6 +21,11 @@
*/
package org.jboss.identity.model.groups;
+import org.jboss.identity.model.policy.RelationshipPolicy;
+
+import java.util.Collection;
+import java.util.List;
+
/**
* Simple Implementation of Group Type
* @author Anil.Saldhana(a)redhat.com
@@ -49,5 +54,20 @@
StringBuilder builder = new StringBuilder("Group[");
builder.append(name).append("]");
return builder.toString();
- }
+ }
+
+ public void add(RelationshipPolicy<GroupType, GroupType> aRelationPolicy)
+ {
+
+ }
+
+ public void addAll(Collection<RelationshipPolicy<GroupType, GroupType>> relationList)
+ {
+
+ }
+
+ public List<RelationshipPolicy<GroupType, GroupType>> getRelationshipPolicies()
+ {
+ return null;
+ }
}
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java 2008-09-03 07:38:39 UTC (rev 58)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java 2008-09-03 07:49:37 UTC (rev 59)
@@ -22,8 +22,11 @@
package org.jboss.identity.model.roles;
import org.jboss.identity.model.IdentityObject;
-import org.jboss.identity.model.roles.RoleType;
+import org.jboss.identity.model.Identity;
+import org.jboss.identity.model.groups.Group;
+import java.util.List;
+
/**
* Marker Interface represents a role
* @author Anil.Saldhana(a)redhat.com
@@ -36,4 +39,16 @@
* @return
*/
RoleType getRoleType();
+
+ /**
+ * Get a list of Identities
+ * @return
+ */
+ List<Identity> getIdentities();
+
+ /**
+ * Get a list of Groups
+ * @return
+ */
+ List<Group> getGroups();
}
\ No newline at end of file
15 years, 9 months
JBoss Identity SVN: r58 - trunk/identity-model/src/main/java/org/jboss/identity/model/policy.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2008-09-03 03:38:39 -0400 (Wed, 03 Sep 2008)
New Revision: 58
Modified:
trunk/identity-model/src/main/java/org/jboss/identity/model/policy/PasswordExpirationPolicy.java
trunk/identity-model/src/main/java/org/jboss/identity/model/policy/RelationshipPolicy.java
Log:
- policies refers to the IdentityType not IdentityObject instances
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/policy/PasswordExpirationPolicy.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/policy/PasswordExpirationPolicy.java 2008-09-02 18:33:23 UTC (rev 57)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/policy/PasswordExpirationPolicy.java 2008-09-03 07:38:39 UTC (rev 58)
@@ -21,14 +21,14 @@
*/
package org.jboss.identity.model.policy;
-import org.jboss.identity.model.IdentityObject;
+import org.jboss.identity.model.IdentityType;
/**
* Policy to govern Passwords
* @author Anil.Saldhana(a)redhat.com
* @since Jul 13, 2008
*/
-public interface PasswordExpirationPolicy<P extends IdentityObject>
+public interface PasswordExpirationPolicy<P extends IdentityType>
extends IdentityTypePolicy
{
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/policy/RelationshipPolicy.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/policy/RelationshipPolicy.java 2008-09-02 18:33:23 UTC (rev 57)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/policy/RelationshipPolicy.java 2008-09-03 07:38:39 UTC (rev 58)
@@ -21,14 +21,14 @@
*/
package org.jboss.identity.model.policy;
-import org.jboss.identity.model.IdentityObject;
+import org.jboss.identity.model.IdentityType;
/**
* A Policy that governs the Relationships
* @author Anil.Saldhana(a)redhat.com
* @since Jul 13, 2008
*/
-public interface RelationshipPolicy<P extends IdentityObject, Q extends IdentityObject>
+public interface RelationshipPolicy<P extends IdentityType, Q extends IdentityType>
extends IdentityTypePolicy
{
/**
15 years, 9 months
JBoss Identity SVN: r57 - in tags/portalPrototype: idm and 14 other directories.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2008-09-02 14:33:23 -0400 (Tue, 02 Sep 2008)
New Revision: 57
Added:
tags/portalPrototype/idm/
tags/portalPrototype/idm/pom.xml
tags/portalPrototype/idm/src/
tags/portalPrototype/idm/src/main/
tags/portalPrototype/idm/src/main/java/
tags/portalPrototype/idm/src/main/java/org/
tags/portalPrototype/idm/src/main/java/org/jboss/
tags/portalPrototype/idm/src/main/java/org/jboss/idm/
tags/portalPrototype/idm/src/main/java/org/jboss/idm/FeaturesDescription.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/Identity.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityOperationType.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityRepository.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityStore.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityStoreRepository.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityType.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/RelationshipType.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/Session.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/
tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEvent.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventBroadcaster.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventEmitter.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventListener.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/
tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/IdentityTypeNotSupportedException.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/IdmException.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/OperationNotSupportedException.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/RelationshipNotSupportedException.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/
tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/GenericEntityType.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/GenericRelationshipType.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/
tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/GroupEntity.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/GroupIdentityStore.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/Relationship.java
tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/UserEntity.java
tags/portalPrototype/idm/src/main/java/org/jboss/portal/
tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/
tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/IdentityException.java
tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/
tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Capabilities.java
tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/EntityType.java
tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Group.java
tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/GroupRelationshipType.java
tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/IdentityModule.java
tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Session.java
tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/User.java
tags/portalPrototype/idm/src/main/resources/
tags/portalPrototype/idm/src/test/
tags/portalPrototype/idm/src/test/java/
tags/portalPrototype/idm/src/test/resources/
Log:
copy of initial portalPrototype code - does not compile as pom.xml is not updated
Added: tags/portalPrototype/idm/pom.xml
===================================================================
--- tags/portalPrototype/idm/pom.xml (rev 0)
+++ tags/portalPrototype/idm/pom.xml 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,17 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.portal.identity</groupId>
+ <artifactId>module-parent</artifactId>
+ <relativePath>../build/pom.xml</relativePath>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>identity-idm</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Portal Identity Management</name>
+
+ <build></build>
+
+</project>
+
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/FeaturesDescription.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/FeaturesDescription.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/FeaturesDescription.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,114 @@
+/*
+* 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.idm;
+
+import org.jboss.idm.exceptions.IdentityTypeNotSupportedException;
+import org.jboss.idm.exceptions.IdmException;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface FeaturesDescription
+{
+ /**
+ * Operations related to the base set of methods in IdentityStore interface
+ */
+ public enum OperationType implements IdentityOperationType
+ {
+
+ // createIdentity
+ create,
+
+ // removeIdentity
+ remove,
+
+ // updateAttribute, updateAttributes, addAttributes
+ updateAttributes,
+
+ // resolveRelationships
+ resolveRelationships,
+
+ // createRelationship
+ modifyRelationships,
+
+ // pagination in findIdentities
+ paginatedSearch,
+
+ // ordering in findIdentities
+ orderedSearch;
+
+
+ public String getName()
+ {
+ return this.name();
+ }
+ }
+
+ /**
+ * @param identityType
+ * @return supported operations for given identity type
+ * @throws org.jboss.idm.exceptions.IdentityTypeNotSupportedException
+ */
+ public Set<IdentityOperationType> getSupportedOperations(IdentityType identityType) throws IdentityTypeNotSupportedException;
+
+ /**
+ * @param operationType
+ * @param identityType
+ * @return if given operation on given identity type is supported
+ * @throws IdentityTypeNotSupportedException
+ */
+ boolean isOperationSupported(IdentityOperationType operationType, IdentityType identityType) throws IdentityTypeNotSupportedException;
+
+ /**
+ * @param operationType
+ * @return set of identity types that can be processed with a given operation
+ * @throws org.jboss.idm.exceptions.IdmException
+ */
+ public Set<IdentityType> getSupportedIdentities(IdentityOperationType operationType);
+
+ /**
+ * @return set of identity types that can be persisted
+ */
+ Set<IdentityType> getSupportedIdentities();
+
+ /**
+ * @param identityType
+ * @return boolean describing if given identity type can be persisted or retrieved using this identity store
+ */
+ boolean isIdentitySupported(IdentityType identityType);
+
+ /**
+ * @param fromType
+ * @param toType
+ * @param relationshipType
+ * @return true is given relationship can be persisted or retrieved
+ * @throws org.jboss.idm.exceptions.IdmException
+ */
+ boolean isRelationshipSupported(IdentityType fromType, IdentityType toType, RelationshipType relationshipType) throws IdmException;
+
+
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/Identity.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/Identity.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/Identity.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,58 @@
+/*
+* 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.idm;
+
+import org.jboss.idm.IdentityType;
+
+/**
+ * User, role, group, organization, community or any other kind of identity
+ *
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Identity
+{
+
+ /**
+ * @return id of this identity
+ */
+ Object getId();
+
+ /**
+ * FQDN identifies the context of this object - identity store in which it is persisted and object id in this store
+ *
+ * @return full qualified domain name for this identity
+ */
+ String getFQDN();
+
+ /**
+ * @return type of this identity
+ */
+ IdentityType getType();
+
+ /**
+ * @return name of this identity
+ */
+ String getName();
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityOperationType.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityOperationType.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityOperationType.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,34 @@
+/*
+* 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.idm;
+
+/**
+ * Operation type supported by IdentityStore
+ *
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityOperationType
+{
+ String getName();
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityRepository.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityRepository.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityRepository.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,38 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.idm;
+
+/**
+ *
+ *
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityRepository
+{
+
+ Session createSession();
+
+ FeaturesDescription getSupportedFeatures();
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityStore.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityStore.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityStore.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,235 @@
+/*
+* 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.idm;
+
+import org.jboss.idm.exceptions.IdmException;
+import org.jboss.idm.exceptions.IdentityTypeNotSupportedException;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Represents identity data store. Expose all needed generic methods to manipulate and persist identity data.
+ *
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityStore
+{
+
+
+ // Informations about identity store and its capabilities
+
+ /**
+ * @return id of this identity store
+ */
+ String getId();
+
+
+ /**
+ * @return FeaturesDescription object describing what operation are supported by this store
+ */
+ FeaturesDescription getSupportedFeatures();
+
+
+ // Operations
+
+ /**
+ * Create new identity with a given name
+ *
+ * @param name
+ * @return
+ * @throws IdmException
+ */
+ Identity createIdentity(String name) throws IdmException;
+
+ /**
+ * Remove given identity
+ *
+ * @param identity
+ * @throws IdmException
+ */
+ void removeIdentity(Identity identity) throws IdmException;
+
+ /**
+ * @param identityType
+ * @return a number of stored identities with a given type
+ * @throws IdmException
+ */
+ int getIdentitiesCount(IdentityType identityType) throws IdmException;
+
+ /**
+ * Find identity with a given name
+ *
+ * @param name
+ * @return
+ * @throws IdmException
+ */
+ Identity findIdentity(String name) throws IdmException;
+
+ /**
+ * Find identity with a given id
+ *
+ * @param id
+ * @return
+ * @throws IdmException
+ */
+ Identity findIdentity(Object id) throws IdmException;
+
+ /**
+ * Find identities with a given type paginated and ordered. If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no effect
+ *
+ * @param identityType
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdmException
+ */
+ Collection<Identity> findIdentities(IdentityType identityType,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending) throws IdmException;
+
+ /**
+ * Find identities with a given attributes values. If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no effect
+ *
+ * @param identityType
+ * @param attributes
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdmException
+ */
+ Collection<Identity> findIdentities(IdentityType identityType, Map<String, String[]> attributes,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending) throws IdmException;
+
+ /**
+ * Find identites that have relationship with given identity. Relationships are directional (from parent to child).
+ * If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no effect
+ *
+ * @param identity
+ * @param relationshipType
+ * @param parent defines if given identity is parent or child side in the relationship - default is true (parent)
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdmException
+ */
+ Collection<Identity> findIdentities(Identity identity, RelationshipType relationshipType, boolean parent,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending) throws IdmException;
+
+ /**
+ * @param identityType
+ * @return names of supported attributes
+ * @throws IdmException
+ */
+ Set<String> getSupportedAttributeNames(IdentityType identityType) throws IdmException;
+
+ /**
+ * Get attributes for the given identity
+ *
+ * @param identity
+ * @return
+ * @throws IdmException
+ */
+ Map<String, String[]> getAttributes(Identity identity) throws IdmException;
+
+ /**
+ * Update attributes with new values - previous values will be overwritten
+ * @param identity
+ * @param attributes
+ * @throws IdmException
+ */
+ void updateAttributes(Identity identity, Map<String, String[]> attributes) throws IdmException;
+
+ /**
+ * Add new attributes - if attribute with given name already exists the values will be appended
+ *
+ * @param identity
+ * @param attributes
+ * @throws org.jboss.idm.exceptions.IdmException
+ */
+ void addAttributes(Identity identity, Map<String, String[]> attributes) throws IdmException;
+
+ /**
+ * Remove attributes
+ *
+ * @param identity
+ * @param attributes
+ */
+ void removeAttributes(Identity identity, Set<String> attributes) throws IdmException;
+
+ /**
+ * Create directional relationship of a given type between identities
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @param relationshipType
+ * @throws IdmException
+ */
+ void createRelationship(Identity fromIdentity, Identity toIdentity, RelationshipType relationshipType) throws IdmException;
+
+ /**
+ * Remove relationship between identities. Relationships can be directional so order of parameters matters
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @param relationshipType
+ * @throws IdmException
+ */
+ void removeRelationship(Identity fromIdentity, Identity toIdentity, RelationshipType relationshipType) throws IdmException;
+
+ /**
+ * Remove all relationships between identities. Direction of relationships doesn't matter - all active relationships
+ * will be removed
+ *
+ * @param identity1
+ * @param identity2
+ * @throws IdmException
+ */
+ void removeRelationships(Identity identity1, Identity identity2) throws IdmException;
+
+ /**
+ * Resolve relationship types between two identities. Relationships can be directional so order of parameters matters
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @return
+ * @throws IdmException
+ */
+ Set<RelationshipType> resolveRelationships(Identity fromIdentity, Identity toIdentity) throws IdmException;
+
+
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityStoreRepository.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityStoreRepository.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityStoreRepository.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,56 @@
+/*
+* 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.idm;
+
+import org.jboss.idm.IdentityStore;
+import org.jboss.idm.IdentityType;
+
+import java.util.Set;
+import java.util.Map;
+
+/**
+ * IdentityStoreRepository exposes identity object management operations and act as an entry point to many underlaying data stores.
+ * Its responsibility is to map identity objects, their state and relations between them across different identity stores.
+ *
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityStoreRepository extends IdentityStore
+{
+ /**
+ * @return a set of configured identity stores
+ */
+ Set<IdentityStore> getConfiguredIdentityStores();
+
+ /**
+ * @return mapping of IdentityType to the specific idenity store
+ */
+ Map<IdentityType, IdentityStore> getIdentityStoreMappings();
+
+ /**
+ * @param groupType
+ * @return proper identity store to store given identity type
+ */
+ IdentityStore getIdentityStore(IdentityType groupType);
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityType.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityType.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/IdentityType.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,69 @@
+/*
+* 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.idm;
+
+import org.jboss.idm.RelationshipType;
+
+import java.util.Set;
+
+/**
+ * Defines type of the identity and possible relationships it can have. Relationships can be directional - from parent to child -
+ * to map hierarchical structure like trees. Methods in this interface enable to resolve relationships in which this
+ * identity type can be parent side.
+ *
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityType
+{
+
+ /**
+ * @return Name of the IdentityType
+ */
+ String getName();
+
+ /**
+ * @param identityType
+ * @param relationshipType
+ * @return true/false for supported/unsupported relationship with this identity type on the parent side
+ */
+ boolean isRelationshipSupported(IdentityType identityType, RelationshipType relationshipType);
+
+ /**
+ * @param relationshipType
+ * @return set of identity types that can have given relationship with this identity type on the parent side
+ */
+ Set<IdentityType> getSupportedIdentities(RelationshipType relationshipType);
+
+ /**
+ * @return set of identity types that can relationships with this identity type on the parent side
+ */
+ Set<IdentityType> getSupportedIdentities();
+
+ /**
+ * @param identityType
+ * @return set of relationships supported for the given identity type on the parent side
+ */
+ Set<RelationshipType> getSupportedRelationships(IdentityType identityType);
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/RelationshipType.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/RelationshipType.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/RelationshipType.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,37 @@
+/*
+* 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.idm;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface RelationshipType
+{
+
+ /**
+ * @return get unique name identifying this relationship type
+ */
+ String getName();
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/Session.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/Session.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/Session.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,241 @@
+/*
+* 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.idm;
+
+import org.jboss.idm.exceptions.IdmException;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Session
+{
+
+ /**
+ * Close this session
+ */
+ void close() throws IdmException;
+
+ /**
+ * Save all pending changes
+ */
+ void save() throws IdmException;
+
+ /**
+ * Clear this session
+ */
+ void clear() throws IdmException;
+
+ /**
+ * Check if this session is open
+ * @return
+ */
+ boolean isOpen();
+
+ /**
+ * @return IdentityRepository this session was created for
+ */
+ IdentityRepository getRepository();
+
+
+ // Operations
+
+ /**
+ * Create new identity with a given name
+ *
+ * @param name
+ * @return
+ * @throws org.jboss.idm.exceptions.IdmException
+ */
+ Identity createIdentity(String name) throws IdmException;
+
+ /**
+ * Remove given identity
+ *
+ * @param identity
+ * @throws IdmException
+ */
+ void removeIdentity(Identity identity) throws IdmException;
+
+ /**
+ * @param identityType
+ * @return a number of stored identities with a given type
+ * @throws IdmException
+ */
+ int getIdentitiesCount(IdentityType identityType) throws IdmException;
+
+ /**
+ * Find identity with a given name
+ *
+ * @param name
+ * @return
+ * @throws IdmException
+ */
+ Identity findIdentity(String name) throws IdmException;
+
+ /**
+ * Find identity with a given id
+ *
+ * @param id
+ * @return
+ * @throws IdmException
+ */
+ Identity findIdentity(Object id) throws IdmException;
+
+ /**
+ * Find identities with a given type paginated and ordered. If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no effect
+ *
+ * @param identityType
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdmException
+ */
+ Collection<Identity> findIdentities(IdentityType identityType,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending) throws IdmException;
+
+ /**
+ * Find identities with a given attributes values. If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no effect
+ *
+ * @param identityType
+ * @param attributes
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdmException
+ */
+ Collection<Identity> findIdentities(IdentityType identityType, Map<String, String[]> attributes,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending) throws IdmException;
+
+ /**
+ * Find identites that have relationship with given identity. Relationships are directional (from parent to child).
+ * If the paginatedSearch or orderedSearch operations
+ * are not supported in this store implementation, dedicated parameters will take no effect
+ *
+ * @param identity
+ * @param relationshipType
+ * @param parent defines if given identity is parent or child side in the relationship - default is true (parent)
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ * @throws IdmException
+ */
+ Collection<Identity> findIdentities(Identity identity, RelationshipType relationshipType, boolean parent,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending) throws IdmException;
+
+ /**
+ * @param identityType
+ * @return names of supported attributes
+ * @throws IdmException
+ */
+ Set<String> getSupportedAttributeNames(IdentityType identityType) throws IdmException;
+
+ /**
+ * Get attributes for the given identity
+ *
+ * @param identity
+ * @return
+ * @throws IdmException
+ */
+ Map<String, String[]> getAttributes(Identity identity) throws IdmException;
+
+ /**
+ * Update attributes with new values - previous values will be overwritten
+ * @param identity
+ * @param attributes
+ * @throws IdmException
+ */
+ void updateAttributes(Identity identity, Map<String, String[]> attributes) throws IdmException;
+
+ /**
+ * Add new attributes - if attribute with given name already exists the values will be appended
+ *
+ * @param identity
+ * @param attributes
+ * @throws org.jboss.idm.exceptions.IdmException
+ */
+ void addAttributes(Identity identity, Map<String, String[]> attributes) throws IdmException;
+
+ /**
+ * Remove attributes
+ *
+ * @param identity
+ * @param attributes
+ */
+ void removeAttributes(Identity identity, Set<String> attributes) throws IdmException;
+
+ /**
+ * Create directional relationship of a given type between identities
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @param relationshipType
+ * @throws IdmException
+ */
+ void createRelationship(Identity fromIdentity, Identity toIdentity, RelationshipType relationshipType) throws IdmException;
+
+ /**
+ * Remove relationship between identities. Relationships can be directional so order of parameters matters
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @param relationshipType
+ * @throws IdmException
+ */
+ void removeRelationship(Identity fromIdentity, Identity toIdentity, RelationshipType relationshipType) throws IdmException;
+
+ /**
+ * Remove all relationships between identities. Direction of relationships doesn't matter - all active relationships
+ * will be removed
+ *
+ * @param identity1
+ * @param identity2
+ * @throws IdmException
+ */
+ void removeRelationships(Identity identity1, Identity identity2) throws IdmException;
+
+ /**
+ * Resolve relationship types between two identities. Relationships can be directional so order of parameters matters
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @return
+ * @throws IdmException
+ */
+ Set<RelationshipType> resolveRelationships(Identity fromIdentity, Identity toIdentity) throws IdmException;
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEvent.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEvent.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEvent.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,31 @@
+/*
+* 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.idm.event;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentityEvent
+{
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventBroadcaster.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventBroadcaster.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventBroadcaster.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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.idm.event;
+
+/**
+ * Interface that allow event firing.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface IdentityEventBroadcaster
+{
+ /**
+ * Fire an event.
+ *
+ * @param event the event to fire
+ */
+ void fireEvent(IdentityEvent event);
+}
\ No newline at end of file
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventEmitter.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventEmitter.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventEmitter.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.idm.event;
+
+/**
+ * Interface that allows registration management of identity event listeners.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface IdentityEventEmitter
+{
+ /**
+ * Add a listener.
+ *
+ * @param listener the listener for all identity events
+ */
+ void addListener(IdentityEventListener listener);
+
+ /**
+ * Remove a listener.
+ *
+ * @param listener the listener
+ */
+ void removeListener(IdentityEventListener listener);
+}
\ No newline at end of file
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventListener.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventListener.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/event/IdentityEventListener.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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.idm.event;
+
+/**
+ * An event listener.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface IdentityEventListener
+{
+ /**
+ * Fire event on the listener.
+ *
+ * @param event the identity event
+ */
+ void onEvent(IdentityEvent event);
+}
\ No newline at end of file
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/IdentityTypeNotSupportedException.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/IdentityTypeNotSupportedException.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/IdentityTypeNotSupportedException.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,31 @@
+/*
+* 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.idm.exceptions;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentityTypeNotSupportedException extends IdmException
+{
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/IdmException.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/IdmException.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/IdmException.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,49 @@
+/*
+* 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.idm.exceptions;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdmException extends Exception
+{
+ public IdmException()
+ {
+ }
+
+ public IdmException(String message)
+ {
+ super(message);
+ }
+
+ public IdmException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public IdmException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/OperationNotSupportedException.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/OperationNotSupportedException.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/OperationNotSupportedException.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,33 @@
+/*
+* 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.idm.exceptions;
+
+import org.jboss.idm.exceptions.IdmException;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class OperationNotSupportedException extends IdmException
+{
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/RelationshipNotSupportedException.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/RelationshipNotSupportedException.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/exceptions/RelationshipNotSupportedException.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,31 @@
+/*
+* 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.idm.exceptions;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class RelationshipNotSupportedException
+{
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/GenericEntityType.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/GenericEntityType.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/GenericEntityType.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,133 @@
+/*
+* 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.idm.generic;
+
+import org.jboss.idm.IdentityType;
+import org.jboss.idm.RelationshipType;
+
+import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public enum GenericEntityType implements IdentityType
+{
+ USER,
+
+ ROLE,
+
+ ROLE_GROUP;
+
+ private final static Map<IdentityType, Set<RelationshipType>> roleRelationships = new HashMap<IdentityType, Set<RelationshipType>>();
+ private final static Map<IdentityType, Set<RelationshipType>> roleGroupRelationships = new HashMap<IdentityType, Set<RelationshipType>>();
+
+
+ static
+ {
+
+ Set<RelationshipType> nested = new HashSet<RelationshipType>();
+ nested.add(GenericRelationshipType.NESTED);
+
+ // ROLE
+ // can nest other users
+
+ roleRelationships.put(GenericEntityType.USER, nested);
+
+
+ // ROLE_GROUP
+ // can nest other roles
+
+ roleGroupRelationships.put(GenericEntityType.ROLE, nested);
+
+
+
+
+ }
+
+
+
+ public String getName()
+ {
+ return this.name();
+ }
+
+ public boolean isRelationshipSupported(IdentityType identityType, RelationshipType relationshipType)
+ {
+ Set<RelationshipType> relTypes = getRelationships().get(identityType);
+
+ if (relTypes != null && relTypes.contains(relationshipType))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public Set<IdentityType> getSupportedIdentities(RelationshipType relationshipType)
+ {
+ return getRelationships().keySet();
+ }
+
+ public Set<IdentityType> getSupportedIdentities()
+ {
+ return getRelationships().keySet();
+ }
+
+ public Set<RelationshipType> getSupportedRelationships(IdentityType identityType)
+ {
+
+ Set types = getRelationships().get(identityType);
+
+ if (types != null)
+ {
+ return types;
+ }
+
+ return Collections.emptySet();
+ }
+
+
+ private Map<IdentityType, Set<RelationshipType>> getRelationships()
+ {
+ if (this.getName().equals(ROLE.getName()))
+ {
+ return Collections.unmodifiableMap(roleRelationships);
+ }
+ else if (this.getName().equals(ROLE_GROUP.getName()))
+ {
+ return Collections.unmodifiableMap(roleGroupRelationships);
+ }
+
+ // USER or anything else
+
+ return Collections.emptyMap();
+
+ }
+
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/GenericRelationshipType.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/GenericRelationshipType.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/GenericRelationshipType.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,39 @@
+/*
+* 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.idm.generic;
+
+import org.jboss.idm.RelationshipType;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public enum GenericRelationshipType implements RelationshipType
+{
+ NESTED;
+
+ public String getName()
+ {
+ return this.name();
+ }
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/GroupEntity.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/GroupEntity.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/GroupEntity.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,53 @@
+/*
+* 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.idm.generic.model;
+
+import org.jboss.idm.IdentityType;
+import org.jboss.idm.Identity;
+
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface GroupEntity extends Identity
+{
+ Object getId();
+
+ String getName();
+
+ IdentityType getType();
+
+ Map<String, String[]> getAttributes();
+
+ Object getParentId();
+
+ Collection<Relationship> getFromRelations();
+
+ Collection<Relationship> getToRelations();
+
+ Collection<UserEntity> getUserEntities();
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/GroupIdentityStore.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/GroupIdentityStore.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/GroupIdentityStore.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,42 @@
+/*
+* 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.idm.generic.model;
+
+import org.jboss.idm.IdentityStore;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface GroupIdentityStore extends IdentityStore
+{
+
+ boolean isUserStore();
+
+ boolean supportExternalGroupRelationships();
+
+
+ // TODO: Set of needed methods
+
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/Relationship.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/Relationship.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/Relationship.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,40 @@
+/*
+* 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.idm.generic.model;
+
+import org.jboss.idm.RelationshipType;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Relationship
+{
+
+ GroupEntity getFrom();
+
+ GroupEntity getTo();
+
+ RelationshipType getType();
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/UserEntity.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/UserEntity.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/idm/generic/model/UserEntity.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,45 @@
+/*
+* 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.idm.generic.model;
+
+import org.jboss.idm.Identity;
+
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface UserEntity extends Identity
+{
+
+ Object getId();
+
+ String getUserName();
+
+ Map<String, String[]> getAttributes();
+
+ Collection<GroupEntity> getGroupEntities();
+
+}
\ No newline at end of file
Added: tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/IdentityException.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/IdentityException.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/IdentityException.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,49 @@
+/*
+* 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.portal.identity;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public class IdentityException extends Exception
+{
+ public IdentityException()
+ {
+ }
+
+ public IdentityException(String message)
+ {
+ super(message);
+ }
+
+ public IdentityException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public IdentityException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Capabilities.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Capabilities.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Capabilities.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,78 @@
+/*
+* 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.portal.identity.api;
+
+import org.jboss.idm.exceptions.IdentityTypeNotSupportedException;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Capabilities
+{
+
+ /**
+ * Operations related to the base set of methods in IdentityStore interface
+ */
+ public enum OperationType
+ {
+
+ create,
+
+ remove,
+
+ updateAttributes,
+
+ modifyRelationships,
+
+ paginatedSearch,
+
+ orderedSearch;
+
+ }
+
+ /**
+ * @param entityType
+ * @return supported operations for given identity type
+ * @throws org.jboss.idm.exceptions.IdentityTypeNotSupportedException
+ */
+ public Set<OperationType> getSupportedOperations(EntityType entityType) throws IdentityTypeNotSupportedException;
+
+ /**
+ * @param operationType
+ * @param entityType
+ * @return if given operation on given identity type is supported
+ * @throws IdentityTypeNotSupportedException
+ */
+ boolean isOperationSupported(OperationType operationType, EntityType entityType) throws IdentityTypeNotSupportedException;
+
+ /**
+ * @param operationType
+ * @return set of identity types that can be processed with a given operation
+ * @throws org.jboss.idm.exceptions.IdmException
+ */
+ public Set<EntityType> getSupportedEntities(OperationType operationType);
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/EntityType.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/EntityType.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/EntityType.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,212 @@
+/*
+* 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.portal.identity.api;
+
+import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public enum EntityType
+{
+ // User
+ USER,
+
+ // Administration group - just to group users for common admin tasks
+ ADMINISTRATION,
+
+ // Organization (location, division, department, team...)
+ ORGANIZATION,
+
+ // Business role (manager, director, leader...)
+ BUSINESS,
+
+ // JEE security role
+ JEE,
+
+ // Community of users
+ COMMUNITY;
+
+ private final static Map<EntityType, Set<GroupRelationshipType>> administrationRelationships = new HashMap<EntityType, Set<GroupRelationshipType>>();
+ private final static Map<EntityType, Set<GroupRelationshipType>> organizationRelationships = new HashMap<EntityType, Set<GroupRelationshipType>>();
+ private final static Map<EntityType, Set<GroupRelationshipType>> businessRelationships = new HashMap<EntityType, Set<GroupRelationshipType>>();
+ private final static Map<EntityType, Set<GroupRelationshipType>> jeeRelationships = new HashMap<EntityType, Set<GroupRelationshipType>>();
+ private final static Map<EntityType, Set<GroupRelationshipType>> communityRelationships = new HashMap<EntityType, Set<GroupRelationshipType>>();
+
+ static
+ {
+
+ Set<GroupRelationshipType> all = new HashSet<GroupRelationshipType>();
+ all.add(GroupRelationshipType.HIERARCHICAL);
+ all.add(GroupRelationshipType.IMPLY);
+
+ Set<GroupRelationshipType> imply = new HashSet<GroupRelationshipType>();
+ imply.add(GroupRelationshipType.IMPLY);
+
+ Set<GroupRelationshipType> hierarchical = new HashSet<GroupRelationshipType>();
+ hierarchical.add(GroupRelationshipType.HIERARCHICAL);
+
+ // USER
+ //
+ // Is always child in the relationship so nothing is defined
+
+ // ADMINISTRATION
+ //
+ // Can contain USER and other ADMINISTRATION entities.
+ // Can imply any other identity type
+
+ administrationRelationships.put(EntityType.USER, hierarchical);
+ administrationRelationships.put(EntityType.ADMINISTRATION, all);
+ administrationRelationships.put(EntityType.ORGANIZATION, imply);
+ administrationRelationships.put(EntityType.BUSINESS, imply);
+ administrationRelationships.put(EntityType.JEE, imply);
+ administrationRelationships.put(EntityType.COMMUNITY, imply);
+
+ // ORGANIZATION
+ //
+ // Can contain USER, ORGANIZATION and BUSINESS entities
+ // Can imply any other identity type
+
+ organizationRelationships.put(EntityType.USER, hierarchical);
+ organizationRelationships.put(EntityType.ADMINISTRATION, imply);
+ organizationRelationships.put(EntityType.ORGANIZATION, all);
+ organizationRelationships.put(EntityType.BUSINESS, all);
+ organizationRelationships.put(EntityType.JEE, imply);
+ organizationRelationships.put(EntityType.COMMUNITY, imply);
+
+ // BUSINESS
+ //
+ // Can contain USER and other BUSINESS entities
+ // Can imply any other identity type
+
+ businessRelationships.put(EntityType.USER, hierarchical);
+ businessRelationships.put(EntityType.ADMINISTRATION, imply);
+ businessRelationships.put(EntityType.ORGANIZATION, imply);
+ businessRelationships.put(EntityType.BUSINESS, all);
+ businessRelationships.put(EntityType.JEE, imply);
+ businessRelationships.put(EntityType.COMMUNITY, imply);
+
+ // JEE
+ //
+ // Can contain USER entities
+ // Can imply any other identity type
+
+ jeeRelationships.put(EntityType.USER, hierarchical);
+ jeeRelationships.put(EntityType.ADMINISTRATION, imply);
+ jeeRelationships.put(EntityType.ORGANIZATION, imply);
+ jeeRelationships.put(EntityType.BUSINESS, imply);
+ jeeRelationships.put(EntityType.JEE, imply);
+ jeeRelationships.put(EntityType.COMMUNITY, imply);
+
+
+ // COMMUNITY
+ //
+ // Can contain USER and and other COMMUNITY entities
+ // Can imply any other identity type
+
+ communityRelationships.put(EntityType.USER, hierarchical);
+ communityRelationships.put(EntityType.ADMINISTRATION, imply);
+ communityRelationships.put(EntityType.ORGANIZATION, imply);
+ communityRelationships.put(EntityType.BUSINESS, imply);
+ communityRelationships.put(EntityType.JEE, imply);
+ communityRelationships.put(EntityType.COMMUNITY, all);
+
+ }
+
+
+
+ public String getName()
+ {
+ return this.name();
+ }
+
+ public boolean isRelationshipSupported(EntityType identityType, GroupRelationshipType relationshipType)
+ {
+ Set<GroupRelationshipType> relTypes = getRelationships().get(identityType);
+
+ if (relTypes != null && relTypes.contains(relationshipType))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public Set<EntityType> getSupportedIdentities(GroupRelationshipType relationshipType)
+ {
+ return getRelationships().keySet();
+ }
+
+ public Set<EntityType> getSupportedIdentities()
+ {
+ return getRelationships().keySet();
+ }
+
+ public Set<GroupRelationshipType> getSupportedRelationships(EntityType identityType)
+ {
+
+ Set types = getRelationships().get(identityType);
+
+ if (types != null)
+ {
+ return types;
+ }
+
+ return Collections.emptySet();
+ }
+
+
+ private Map<EntityType, Set<GroupRelationshipType>> getRelationships()
+ {
+ if (this.getName().equals(ADMINISTRATION.getName()))
+ {
+ return Collections.unmodifiableMap(administrationRelationships);
+ }
+ else if (this.getName().equals(ORGANIZATION.getName()))
+ {
+ return Collections.unmodifiableMap(organizationRelationships);
+ }
+ else if (this.getName().equals(BUSINESS.getName()))
+ {
+ return Collections.unmodifiableMap(businessRelationships);
+ }
+ else if (this.getName().equals(JEE.getName()))
+ {
+ return Collections.unmodifiableMap(jeeRelationships);
+ }
+ else if (this.getName().equals(COMMUNITY.getName()))
+ {
+ return Collections.unmodifiableMap(communityRelationships);
+ }
+
+ // USER or anything else
+
+ return Collections.emptyMap();
+
+ }
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Group.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Group.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Group.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,81 @@
+/*
+* 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.portal.identity.api;
+
+import java.util.Map;
+
+/**
+ *
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Group
+{
+
+ /**
+ * @return id of this identity
+ */
+ Object getId();
+
+ /**
+ * FQDN identifies the context of this object
+ *
+ * @return full qualified domain name for this identity
+ */
+ String getFQDN();
+
+ /**
+ * @return type of this identity
+ */
+ EntityType getType();
+
+ /**
+ * @return name of this identity
+ */
+ String getName();
+
+
+ /**
+ * @return group display name
+ */
+ String getDisplayName();
+
+ /**
+ * @return description
+ */
+ String getDescription();
+
+ /**
+ * @return map containing group attributes
+ */
+ Map<String, String[]> getAttributes();
+
+ /**
+ * @return id of parent group for the relations of RelationType.HIERARCHICAL. If the parent id is null, this object
+ * is a child of a root group in the store
+ */
+ Object getParentId();
+
+
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/GroupRelationshipType.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/GroupRelationshipType.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/GroupRelationshipType.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,34 @@
+/*
+* 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.portal.identity.api;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public enum GroupRelationshipType
+{
+ HIERARCHICAL,
+ IMPLY;
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/IdentityModule.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/IdentityModule.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/IdentityModule.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,46 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.identity.api;
+
+/**
+ * IdentityModule
+ *
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface IdentityModule
+{
+
+ /**
+ * @return Capabilities object describing operations supported by identity module with current configuration
+ */
+ Capabilities getCapabilities();
+
+ /**
+ * @return new session
+ */
+ Session createSession();
+
+
+
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Session.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Session.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/Session.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,284 @@
+/*
+* 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.portal.identity.api;
+
+import org.jboss.portal.identity.IdentityException;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface Session
+{
+ /**
+ * Close this session
+ */
+ void close() throws IdentityException;
+
+ /**
+ * Save all pending changes
+ */
+ void save() throws IdentityException;
+
+ /**
+ * Clear this session
+ */
+ void clear() throws IdentityException;
+
+ /**
+ * Check if this session is open
+ * @return
+ */
+ boolean isOpen();
+
+
+ // Users
+ /**
+ * Create new user in the data store
+ *
+ * @param userName
+ * @return
+ */
+ User createUser(String userName);
+
+ /**
+ * Remove user from the the data store
+ *
+ * @param user
+ * @return
+ */
+ boolean removeUser(User user);
+
+ /**
+ * Find user with a given user name
+ *
+ *
+ * @param userName
+ * @return
+ */
+ User findUser(String userName);
+
+ /**
+ * Find user with a given id
+ * @param id
+ * @return
+ */
+ User findUser(Object id);
+
+ /**
+ * Find users with a given properties values
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated parameters will take no effect
+ *
+ * @param properties
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ */
+ Collection<Group> findUsers(Map<String, String[]> properties,
+ int offset, int limit, String orderedByAttributeName, boolean ascending);
+
+
+ /**
+ * Update user attribute values
+ *
+ * @param user
+ * @param attrName
+ * @param values
+ * @return
+ */
+ boolean updateAttribute(User user, String attrName, String[] values);
+
+ /**
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated parameters will take no effect
+ *
+ * @param user
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return a set of groups that this user belongs to
+ */
+ Collection<Group> getGroups(User user, int offset, int limit, String orderedByAttributeName, boolean ascending);
+
+ /**
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated parameters will take no effect
+ *
+ * @param user
+ * @param entityType
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return a set of groups with a given groupType that this user belongs to
+ */
+ Collection<Group> getGroups(User user, EntityType entityType,
+ int offset, int limit, String orderedByAttributeName, boolean ascending);
+
+ /**
+ * Assign a set of groups to this user. All other group associations will be overwritten
+ *
+ * @param user
+ * @param groups
+ * @return
+ */
+ boolean assignGroups(User user, Set<Group> groups);
+
+
+ // Groups
+
+ /**
+ * Create new group in the data store
+ *
+ * @param groupName
+ * @return
+ */
+ Group createGroup(String groupName, EntityType type);
+
+ /**
+ * Remove group from the data store
+ *
+ * @param group
+ * @return
+ */
+ boolean removeGroup(Group group);
+
+ /**
+ * Find group with a given name
+ *
+ * @param name
+ * @return
+ */
+ Group findGroup(String name);
+
+ /**
+ * Find Group with a given object id
+ *
+ * @param id
+ * @return
+ */
+ Group findGroup(Object id);
+
+ /**
+ * Find Group with a given group type
+ *
+ * @param entityType
+ * @return
+ */
+ Group findGroup(EntityType entityType);
+
+ /**
+ * Find groups with a given attributes values
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated parameters will take no effect
+ *
+ * @param properties
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return
+ */
+ Collection<Group> findGroups(Map<String, String[]> properties,
+ int offset, int limit, String orderedByAttributeName, boolean ascending);
+
+ /**
+ * Update user attribute values
+ *
+ * @param attrName
+ * @param values
+ * @return
+ */
+ boolean updateAttribute(Group group, String attrName, String[] values);
+
+ /**
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated parameters will take no effect
+ *
+ * @param group
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return set of users assigned to this group. Depending on the underlaying implementation and datastore it may
+ * affect performance
+ */
+ Collection<User> getUsers(Group group, int offset, int limit, String orderedByAttributeName, boolean ascending);
+
+ /**
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated parameters will take no effect
+ *
+ * @param group
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return set of groups that are either children of this group or implied for this group
+ */
+ Collection<Group> getGroups(Group group, int offset, int limit, String orderedByAttributeName, boolean ascending);
+
+ /**
+ * If the paginatedSearch or orderedSearch operations are not supported, dedicated parameters will take no effect
+ *
+ * @param group
+ * @param type of the relation
+ * @param offset
+ * @param limit 0 means unlimited page size
+ * @param orderedByAttributeName can be null
+ * @param ascending default true
+ * @return set of groups that have given relation type with this group and the direction of the relation is towords
+ * this group
+ */
+ Collection<Group> getGroups(Group group, GroupRelationshipType type,
+ int offset, int limit, String orderedByAttributeName, boolean ascending);
+
+ /**
+ * @param fromGroup
+ * @param toGroup
+ * @return returns a relationship type between this and given group.
+ */
+ GroupRelationshipType getRelationship(Group fromGroup, Group toGroup);
+
+ /**
+ * Assign a set of groups to this group. All other group associations (with this relation type) for this group
+ * will be overrwitten
+ *
+ * @param fromGroup
+ * @param toGroups
+ * @param type
+ * @return
+ */
+ boolean assignGroups(Group fromGroup, Set<Group> toGroups, GroupRelationshipType type);
+
+ /**
+ * Assign a set of users to this group. All other user associations will be overwritten for this group
+ *
+ * @param group
+ * @param users
+ * @return
+ */
+ boolean assignUsers(Group group, Set<User> users);
+}
Added: tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/User.java
===================================================================
--- tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/User.java (rev 0)
+++ tags/portalPrototype/idm/src/main/java/org/jboss/portal/identity/api/User.java 2008-09-02 18:33:23 UTC (rev 57)
@@ -0,0 +1,64 @@
+/*
+* 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.portal.identity.api;
+
+import org.jboss.idm.Identity;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface User
+{
+
+ /**
+ * @return id of this identity
+ */
+ Object getId();
+
+ /**
+ * FQDN identifies the context of this object
+ *
+ * @return full qualified domain name for this identity
+ */
+ String getFQDN();
+
+ /**
+ * @return name of this identity
+ */
+ String getName();
+
+ /**
+ * @return user email
+ */
+ String getEmail();
+
+ /**
+ * @return map containing user attributes
+ */
+ Map<String, String[]> getAttributes();
+
+}
15 years, 9 months
JBoss Identity SVN: r55 - tags.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2008-09-02 14:27:43 -0400 (Tue, 02 Sep 2008)
New Revision: 55
Added:
tags/portalPrototype/
Log:
copy code of initial portal prototype
15 years, 9 months
JBoss Identity SVN: r54 - in trunk: identity-impl/src/main/java/org/jboss/identity/impl/types and 3 other directories.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2008-09-02 14:26:12 -0400 (Tue, 02 Sep 2008)
New Revision: 54
Removed:
trunk/identity-model/src/main/java/org/jboss/identity/model/Role.java
trunk/identity-model/src/main/java/org/jboss/identity/model/RoleType.java
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityManager.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStore.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStoreRepository.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalPersistenceManager.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRealm.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRelationshipManager.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalSession.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/test/portal/PortalIdentityUnitTestCase.java
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityObject.java
Log:
- Make RelationshipManager be assosiated with one realm. Extract realm-realm relationship methods to IdentityManager and link both classes.
- Make IdentityManager expose PersistanceManager instead of IdentityStoreRepository as PersistanceManager resolves mapping realm/repository anyway
- Comment out rest of portal test classes temporarily to have less work during refactorings
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -24,9 +24,12 @@
import java.io.InputStream;
import org.jboss.identity.api.exception.IdentityException;
+import org.jboss.identity.api.exception.PersistenceManagerNotFoundException;
+import org.jboss.identity.api.exception.SessionNotOpenException;
import org.jboss.identity.api.session.Session;
import org.jboss.identity.api.store.IdentityStoreRepository;
import org.jboss.identity.model.Identity;
+import org.jboss.identity.model.relation.RelationshipType;
import org.jboss.identity.model.roles.Role;
import org.jboss.identity.model.roles.RoleType;
import org.jboss.identity.model.domain.Realm;
@@ -109,8 +112,52 @@
*/
Role createRole(Realm realm, String roleName, RoleType roleType)
throws IdentityException;
-
+
+
/**
+ * <p>Associate a relationship between two realms</p>
+ * @param realmA
+ * @param realmB
+ * @param relationshipType
+ * @throws org.jboss.identity.api.exception.PersistenceManagerNotFoundException PM not set
+ * @throws org.jboss.identity.api.exception.SessionNotOpenException session is not open
+ */
+ void associate(Realm realmA, Realm realmB, RelationshipType relationshipType)
+ throws PersistenceManagerNotFoundException, SessionNotOpenException;
+
+ /**
+ * <p>Disassociate a relationship between two realms</p>
+ * @param realmA
+ * @param realmB
+ * @param relationshipType
+ * @throws PersistenceManagerNotFoundException PM not set
+ * @throws SessionNotOpenException session is not open
+ */
+ void disassociate(Realm realmA, Realm realmB, RelationshipType relationshipType)
+ throws PersistenceManagerNotFoundException,SessionNotOpenException;
+
+ /**
+ * @param fromRealm
+ * @param toRealm
+ * @return returns a relationship type between this and given Realm.
+ */
+ RelationshipType getRelationship(Realm fromRealm, Realm toRealm);
+
+ /**
+ * <p>Returns relationship manager for a given realm</p>
+ * @param realm
+ * @return
+ * @throws IdentityException
+ */
+ RelationshipManager getRelationshipManager(Realm realm) throws IdentityException;
+
+ /**
+ * <p>Return the configured PersistenceManager</p>
+ * @return
+ */
+ PersistenceManager getPersistenceManager();
+
+ /**
* Return the IdentityStoreRepository associated with
* a particular realm
* @param realm
@@ -118,11 +165,4 @@
*/
IdentityStoreRepository getRepository(Realm realm);
- /**
- * Set the IdentityStoreRepository for a realm
- * @param realm
- * @param identityStoreRepository
- */
- void setRepository(Realm realm, IdentityStoreRepository identityStoreRepository);
-
}
\ No newline at end of file
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -29,6 +29,7 @@
/**
* Manages the Identity Stores
* @author Anil.Saldhana(a)redhat.com
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
* @since Jul 10, 2008
*/
public interface PersistenceManager
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -28,13 +28,12 @@
import org.jboss.identity.api.exception.SessionNotOpenException;
import org.jboss.identity.model.Identity;
import org.jboss.identity.model.roles.Role;
-import org.jboss.identity.model.domain.Realm;
import org.jboss.identity.model.groups.Group;
import org.jboss.identity.model.relation.RelationshipType;
/**
* <p>Manages the relationships between
- * roles, groups, identities and realms</p>
+ * roles, groups and identities within a realm</p>
* @author Anil.Saldhana(a)redhat.com
* @author boleslaw dot dawidowicz at redhat anotherdot com
* @since Jul 10, 2008
@@ -63,59 +62,46 @@
void associate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
throws PersistenceManagerNotFoundException,SessionNotOpenException;
- /**
- * <p>Associate a relationship between two realms</p>
- * @param realmA
- * @param realmB
- * @param relationshipType
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void associate(Realm realmA, Realm realmB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
+
/**
* <p>Associate a role with an Identity</p>
- * @param realm
* @param identity
* @param aRole
* @throws PersistenceManagerNotFoundException PM not set
* @throws SessionNotOpenException session is not open
*/
- void associate(Realm realm, Identity identity, Role aRole)
+ void associate(Identity identity, Role aRole)
throws PersistenceManagerNotFoundException,SessionNotOpenException;
/**
* <p>Associate a list of roles with an Identity</p>
- * @param realm
* @param identity
* @param aRoleList
* @throws PersistenceManagerNotFoundException PM not set
* @throws SessionNotOpenException session is not open
*/
- void associate(Realm realm, Identity identity, List<Role> aRoleList)
+ void associate(Identity identity, List<Role> aRoleList)
throws PersistenceManagerNotFoundException,SessionNotOpenException;
/**
* <p>Associate a group with an identity</p>
- * @param realm
* @param identity
* @param aGroup
* @throws PersistenceManagerNotFoundException PM not set
* @throws SessionNotOpenException session is not open
*/
- void associate(Realm realm,Identity identity, Group aGroup)
+ void associate(Identity identity, Group aGroup)
throws PersistenceManagerNotFoundException,SessionNotOpenException;
/**
* <p>Associate a set of groups with an identity</p>
- * @param realm
* @param identity
* @param aGroupSet
* @throws PersistenceManagerNotFoundException PM not set
* @throws SessionNotOpenException session is not open
*/
- void associate(Realm realm,Identity identity, Set<Group> aGroupSet)
+ void associate(Identity identity, Set<Group> aGroupSet)
throws PersistenceManagerNotFoundException,SessionNotOpenException;
/**
@@ -140,59 +126,46 @@
void disassociate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
throws PersistenceManagerNotFoundException,SessionNotOpenException;
- /**
- * <p>Disassociate a relationship between two realms</p>
- * @param realmA
- * @param realmB
- * @param relationshipType
- * @throws PersistenceManagerNotFoundException PM not set
- * @throws SessionNotOpenException session is not open
- */
- void disassociate(Realm realmA, Realm realmB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException,SessionNotOpenException;
+
/**
* <p>Disassociate a role with an Identity</p>
- * @param realm
* @param identity
* @param aRole
* @throws PersistenceManagerNotFoundException PM not set
* @throws SessionNotOpenException session is not open
*/
- void disassociate(Realm realm, Identity identity, Role aRole)
+ void disassociate(Identity identity, Role aRole)
throws PersistenceManagerNotFoundException,SessionNotOpenException;
/**
* <p>Disassociate a list of roles with an Identity</p>
- * @param realm
* @param identity
* @param aRoleList
* @throws PersistenceManagerNotFoundException PM not set
* @throws SessionNotOpenException session is not open
*/
- void disassociate(Realm realm, Identity identity, List<Role> aRoleList)
+ void disassociate(Identity identity, List<Role> aRoleList)
throws PersistenceManagerNotFoundException,SessionNotOpenException;
/**
* <p>Disassociate a group with an identity</p>
- * @param realm
* @param identity
* @param aGroup
* @throws PersistenceManagerNotFoundException PM not set
* @throws SessionNotOpenException session is not open
*/
- void disassociate(Realm realm,Identity identity, Group aGroup)
+ void disassociate(Identity identity, Group aGroup)
throws PersistenceManagerNotFoundException,SessionNotOpenException;
/**
* <p>Disassociate a set of groups with an identity</p>
- * @param realm
* @param identity
* @param aGroupSet
* @throws PersistenceManagerNotFoundException PM not set
* @throws SessionNotOpenException session is not open
*/
- void disassociate(Realm realm,Identity identity, Set<Group> aGroupSet)
+ void disassociate(Identity identity, Set<Group> aGroupSet)
throws PersistenceManagerNotFoundException,SessionNotOpenException;
/**
@@ -202,22 +175,7 @@
*/
RelationshipType getRelationship(Group fromGroup, Group toGroup);
- /**
- * @param fromRealm
- * @param toRealm
- * @return returns a relationship type between this and given Realm.
- */
- RelationshipType getRelationship(Realm fromRealm, Realm toRealm);
+
- /**
- * <p>Return the configured PersistenceManager</p>
- * @return
- */
- PersistenceManager getPersistenceManager();
-
- /**
- * <p>Set the PersistenceManager</p>
- * @param persistenceManager
- */
- void setPersistenceManager(PersistenceManager persistenceManager);
+
}
\ No newline at end of file
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -45,6 +45,16 @@
this.name = name;
}
+ public Object getId()
+ {
+ return null;
+ }
+
+ public String getFQDN()
+ {
+ return null;
+ }
+
public IdentityType getIdentityType()
{
return null;
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -34,6 +34,8 @@
/**
* Very simple identity
* @author Anil.Saldhana(a)redhat.com
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
+ *
* @since Aug 6, 2008
*/
public class SimpleIdentity implements Identity
@@ -53,7 +55,17 @@
{
this.name = n;
}
-
+
+ public Object getId()
+ {
+ return null;
+ }
+
+ public String getFQDN()
+ {
+ return null;
+ }
+
public List<IdentityAttribute> getAttributes()
{
return Collections.unmodifiableList(attributes);
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityManager.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityManager.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityManager.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -23,86 +23,86 @@
import java.io.InputStream;
-import org.jboss.identity.api.exception.IdentityException;
-import org.jboss.identity.api.managers.IdentityManager;
-import org.jboss.identity.api.session.Session;
-import org.jboss.identity.api.store.IdentityStoreRepository;
-import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.roles.Role;
-import org.jboss.identity.model.roles.RoleType;
-import org.jboss.identity.model.domain.Realm;
-import org.jboss.identity.model.groups.Group;
-import org.jboss.identity.model.groups.GroupType;
+//import org.jboss.identity.api.exception.IdentityException;
+//import org.jboss.identity.api.managers.IdentityManager;
+//import org.jboss.identity.api.session.Session;
+//import org.jboss.identity.api.store.IdentityStoreRepository;
+//import org.jboss.identity.model.Identity;
+//import org.jboss.identity.model.roles.Role;
+//import org.jboss.identity.model.roles.RoleType;
+//import org.jboss.identity.model.domain.Realm;
+//import org.jboss.identity.model.groups.Group;
+//import org.jboss.identity.model.groups.GroupType;
/**
* Implements the Portal Identity Manager
* @author Anil.Saldhana(a)redhat.com
* @since Jul 22, 2008
*/
-public class PortalIdentityManager implements IdentityManager
-{
- private PortalRealm portalRealm = new PortalRealm();
-
- private IdentityStoreRepository repository;
-
- public Realm bootstrap(String realmName)
- {
- return portalRealm;
- }
-
- public Realm bootstrap(String realmName, InputStream config)
- {
- //TODO: handle config
- return portalRealm;
- }
-
- public Group createGroup(Realm realm, String groupName)
- throws IdentityException
- {
-// IdentityStore identityStore = this.repository.getIdentityStore(IdentityTypeEnum.IDENTITY);
-// if(identityStore == null)
-// throw new IllegalStateException("Identity Store is null");
-// return identityStore.createGroup(groupName);
- return null;
- }
-
- public Group createGroup(Realm realm, String groupName, GroupType groupType)
- throws IdentityException
- {
- return null;
- }
-
- public Identity createIdentity(Realm realm, String identityName) throws IdentityException
- {
-// IdentityStore identityStore = this.repository.getIdentityStore(IdentityTypeEnum.IDENTITY);
-// if(identityStore == null)
-// throw new IllegalStateException("Identity Store is null");
-// return identityStore.createIdentity(identityName);
- return null;
- }
-
- public Role createRole(Realm realm, String roleName, RoleType roleType)
- {
- return null;
- }
-
- public Session createSession(String sessionType, String identityName)
- {
- return PortalSession.newSession();
- }
-
- public Realm getRealm(String realmName, boolean shouldBootstrap)
- {
- return portalRealm;
- }
-
- public IdentityStoreRepository getRepository(Realm realm)
- {
- return repository;
- }
-
- public void setRepository(Realm realm, IdentityStoreRepository identityStoreRepository)
- {
- this.repository = identityStoreRepository;
- }
-}
\ No newline at end of file
+//public class PortalIdentityManager implements IdentityManager
+//{
+// private PortalRealm portalRealm = new PortalRealm();
+//
+// private IdentityStoreRepository repository;
+//
+// public Realm bootstrap(String realmName)
+// {
+// return portalRealm;
+// }
+//
+// public Realm bootstrap(String realmName, InputStream config)
+// {
+// //TODO: handle config
+// return portalRealm;
+// }
+//
+// public Group createGroup(Realm realm, String groupName)
+// throws IdentityException
+// {
+//// IdentityStore identityStore = this.repository.getIdentityStore(IdentityTypeEnum.IDENTITY);
+//// if(identityStore == null)
+//// throw new IllegalStateException("Identity Store is null");
+//// return identityStore.createGroup(groupName);
+// return null;
+// }
+//
+// public Group createGroup(Realm realm, String groupName, GroupType groupType)
+// throws IdentityException
+// {
+// return null;
+// }
+//
+// public Identity createIdentity(Realm realm, String identityName) throws IdentityException
+// {
+//// IdentityStore identityStore = this.repository.getIdentityStore(IdentityTypeEnum.IDENTITY);
+//// if(identityStore == null)
+//// throw new IllegalStateException("Identity Store is null");
+//// return identityStore.createIdentity(identityName);
+// return null;
+// }
+//
+// public Role createRole(Realm realm, String roleName, RoleType roleType)
+// {
+// return null;
+// }
+//
+// public Session createSession(String sessionType, String identityName)
+// {
+// return PortalSession.newSession();
+// }
+//
+// public Realm getRealm(String realmName, boolean shouldBootstrap)
+// {
+// return portalRealm;
+// }
+//
+// public IdentityStoreRepository getRepository(Realm realm)
+// {
+// return repository;
+// }
+//
+// public void setRepository(Realm realm, IdentityStoreRepository identityStoreRepository)
+// {
+// this.repository = identityStoreRepository;
+// }
+//}
\ No newline at end of file
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStore.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStore.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStore.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -21,19 +21,19 @@
*/
package org.jboss.test.identity.impl.portal;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Set;
+//import java.io.IOException;
+//import java.util.Collection;
+//import java.util.Map;
+//import java.util.Set;
+//
+//import org.jboss.identity.api.exception.IdentityException;
+//import org.jboss.identity.api.store.FeaturesDescription;
+//import org.jboss.identity.api.store.IdentityStore;
+//import org.jboss.identity.model.Identity;
+//import org.jboss.identity.model.IdentityType;
+//import org.jboss.identity.model.groups.Group;
+//import org.jboss.identity.model.relation.RelationshipType;
-import org.jboss.identity.api.exception.IdentityException;
-import org.jboss.identity.api.store.FeaturesDescription;
-import org.jboss.identity.api.store.IdentityStore;
-import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.IdentityType;
-import org.jboss.identity.model.groups.Group;
-import org.jboss.identity.model.relation.RelationshipType;
-
/**
* Portal identity store
* @author Anil.Saldhana(a)redhat.com
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStoreRepository.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStoreRepository.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStoreRepository.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -1,63 +1,63 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.identity.impl.portal;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.identity.api.store.IdentityStore;
-import org.jboss.identity.api.store.IdentityStoreRepository;
-import org.jboss.identity.model.IdentityType;
-
-/**
- * IdentityStoreRepository for portal realm
- * @author Anil.Saldhana(a)redhat.com
- * @since Aug 1, 2008
- */
-public class PortalIdentityStoreRepository implements IdentityStoreRepository
-{
- private Map<IdentityType,IdentityStore> storeMap =
- new HashMap<IdentityType, IdentityStore>();
-
- public Set<IdentityStore> getConfiguredIdentityStores()
- {
- return new HashSet<IdentityStore>(this.storeMap.values());
- }
-
- public IdentityStore getIdentityStore(IdentityType identityType)
- {
- return this.storeMap.get(identityType);
- }
-
- public Map<IdentityType, IdentityStore> getIdentityStoreMappings()
- {
- return Collections.unmodifiableMap(storeMap);
- }
-
- public void register(IdentityType identityType, IdentityStore identityStore)
- {
- this.storeMap.put(identityType, identityStore);
- }
-}
\ No newline at end of file
+///*
+// * JBoss, Home of Professional Open Source.
+// * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+// * as indicated by the @author tags. See the copyright.txt file 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.test.identity.impl.portal;
+//
+//import java.util.Collections;
+//import java.util.HashMap;
+//import java.util.HashSet;
+//import java.util.Map;
+//import java.util.Set;
+//
+//import org.jboss.identity.api.store.IdentityStore;
+//import org.jboss.identity.api.store.IdentityStoreRepository;
+//import org.jboss.identity.model.IdentityType;
+//
+///**
+// * IdentityStoreRepository for portal realm
+// * @author Anil.Saldhana(a)redhat.com
+// * @since Aug 1, 2008
+// */
+//public class PortalIdentityStoreRepository implements IdentityStoreRepository
+//{
+// private Map<IdentityType,IdentityStore> storeMap =
+// new HashMap<IdentityType, IdentityStore>();
+//
+// public Set<IdentityStore> getConfiguredIdentityStores()
+// {
+// return new HashSet<IdentityStore>(this.storeMap.values());
+// }
+//
+// public IdentityStore getIdentityStore(IdentityType identityType)
+// {
+// return this.storeMap.get(identityType);
+// }
+//
+// public Map<IdentityType, IdentityStore> getIdentityStoreMappings()
+// {
+// return Collections.unmodifiableMap(storeMap);
+// }
+//
+// public void register(IdentityType identityType, IdentityStore identityStore)
+// {
+// this.storeMap.put(identityType, identityStore);
+// }
+//}
\ No newline at end of file
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalPersistenceManager.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalPersistenceManager.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalPersistenceManager.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -1,51 +1,51 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.identity.impl.portal;
-
-import org.jboss.identity.api.managers.PersistenceManager;
-import org.jboss.identity.api.store.IdentityStore;
-import org.jboss.identity.api.store.IdentityStoreRepository;
-import org.jboss.identity.model.IdentityType;
-import org.jboss.identity.model.domain.Realm;
-
-/**
- * Portal Persistence Manager
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 22, 2008
- */
-public class PortalPersistenceManager implements PersistenceManager
-{
- public IdentityStoreRepository getIdentityStoreRepository(Realm realm)
- {
- return null;
- }
-
- public IdentityStore getIdentityStore(Realm realm, IdentityType identityType)
- {
- return null;
- }
-
- public IdentityStoreRepository getIdentityStoreRepository()
- {
- return null;
- }
-}
\ No newline at end of file
+///*
+// * JBoss, Home of Professional Open Source.
+// * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+// * as indicated by the @author tags. See the copyright.txt file 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.test.identity.impl.portal;
+//
+//import org.jboss.identity.api.managers.PersistenceManager;
+//import org.jboss.identity.api.store.IdentityStore;
+//import org.jboss.identity.api.store.IdentityStoreRepository;
+//import org.jboss.identity.model.IdentityType;
+//import org.jboss.identity.model.domain.Realm;
+//
+///**
+// * Portal Persistence Manager
+// * @author Anil.Saldhana(a)redhat.com
+// * @since Jul 22, 2008
+// */
+//public class PortalPersistenceManager implements PersistenceManager
+//{
+// public IdentityStoreRepository getIdentityStoreRepository(Realm realm)
+// {
+// return null;
+// }
+//
+// public IdentityStore getIdentityStore(Realm realm, IdentityType identityType)
+// {
+// return null;
+// }
+//
+// public IdentityStoreRepository getIdentityStoreRepository()
+// {
+// return null;
+// }
+//}
\ No newline at end of file
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRealm.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRealm.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRealm.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -1,58 +1,58 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.identity.impl.portal;
-
-import org.jboss.identity.model.domain.ModelRoot;
-import org.jboss.identity.model.domain.Realm;
-import org.jboss.identity.model.domain.SimpleModelRoot;
-
-/**
- * Represents a Portal Realm
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 22, 2008
- */
-public class PortalRealm implements Realm
-{
- private ModelRoot identityModelRoot, groupModelRoot, relationshipModelRoot;
-
- public void createModelRoots()
- {
- identityModelRoot = new SimpleModelRoot("Identity");
- groupModelRoot = new SimpleModelRoot("Group");
- relationshipModelRoot = new SimpleModelRoot("Relationship");
- }
-
- public ModelRoot getGroupModelRoot()
- {
- return this.groupModelRoot;
- }
-
- public ModelRoot getIdentityModelRoot()
- {
- return this.identityModelRoot;
- }
-
- public ModelRoot getRelationshipModelRoot()
- {
- return this.relationshipModelRoot;
- }
-}
\ No newline at end of file
+///*
+// * JBoss, Home of Professional Open Source.
+// * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+// * as indicated by the @author tags. See the copyright.txt file 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.test.identity.impl.portal;
+//
+//import org.jboss.identity.model.domain.ModelRoot;
+//import org.jboss.identity.model.domain.Realm;
+//import org.jboss.identity.model.domain.SimpleModelRoot;
+//
+///**
+// * Represents a Portal Realm
+// * @author Anil.Saldhana(a)redhat.com
+// * @since Jul 22, 2008
+// */
+//public class PortalRealm implements Realm
+//{
+// private ModelRoot identityModelRoot, groupModelRoot, relationshipModelRoot;
+//
+// public void createModelRoots()
+// {
+// identityModelRoot = new SimpleModelRoot("Identity");
+// groupModelRoot = new SimpleModelRoot("Group");
+// relationshipModelRoot = new SimpleModelRoot("Relationship");
+// }
+//
+// public ModelRoot getGroupModelRoot()
+// {
+// return this.groupModelRoot;
+// }
+//
+// public ModelRoot getIdentityModelRoot()
+// {
+// return this.identityModelRoot;
+// }
+//
+// public ModelRoot getRelationshipModelRoot()
+// {
+// return this.relationshipModelRoot;
+// }
+//}
\ No newline at end of file
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRelationshipManager.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRelationshipManager.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRelationshipManager.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -21,112 +21,112 @@
*/
package org.jboss.test.identity.impl.portal;
-import java.util.List;
-import java.util.Set;
+//import java.util.List;
+//import java.util.Set;
+//
+//import org.jboss.identity.api.exception.PersistenceManagerNotFoundException;
+//import org.jboss.identity.api.exception.SessionNotOpenException;
+//import org.jboss.identity.api.managers.PersistenceManager;
+//import org.jboss.identity.api.managers.RelationshipManager;
+//import org.jboss.identity.model.Identity;
+//import org.jboss.identity.model.roles.Role;
+//import org.jboss.identity.model.domain.Realm;
+//import org.jboss.identity.model.groups.Group;
+//import org.jboss.identity.model.relation.RelationshipType;
-import org.jboss.identity.api.exception.PersistenceManagerNotFoundException;
-import org.jboss.identity.api.exception.SessionNotOpenException;
-import org.jboss.identity.api.managers.PersistenceManager;
-import org.jboss.identity.api.managers.RelationshipManager;
-import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.roles.Role;
-import org.jboss.identity.model.domain.Realm;
-import org.jboss.identity.model.groups.Group;
-import org.jboss.identity.model.relation.RelationshipType;
-
/**
* @author Anil.Saldhana(a)redhat.com
* @since Jul 22, 2008
*/
-public class PortalRelationshipManager implements RelationshipManager
-{
- public void associate(Group groupA, Group groupB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException, SessionNotOpenException
- {
- }
-
-
- public void associate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException, SessionNotOpenException
- {
- }
-
- public void associate(Realm realmA, Realm realmB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException, SessionNotOpenException
- {
- }
-
- public void associate(Realm realm, Identity identity, Role role) throws PersistenceManagerNotFoundException,
- SessionNotOpenException
- {
- }
-
- public void associate(Realm realm, Identity identity, List<Role> roleList)
- throws PersistenceManagerNotFoundException, SessionNotOpenException
- {
- }
-
- public void associate(Realm realm, Identity identity, Group group) throws PersistenceManagerNotFoundException,
- SessionNotOpenException
- {
- }
-
- public void associate(Realm realm, Identity identity, Set<Group> groupSet)
- throws PersistenceManagerNotFoundException, SessionNotOpenException
- {
- }
-
- public void disassociate(Group groupA, Group groupB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException, SessionNotOpenException
- {
- }
-
- public void disassociate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException, SessionNotOpenException
- {
- }
-
- public void disassociate(Realm realmA, Realm realmB, RelationshipType relationshipType)
- throws PersistenceManagerNotFoundException, SessionNotOpenException
- {
- }
-
- public void disassociate(Realm realm, Identity identity, Role role) throws PersistenceManagerNotFoundException,
- SessionNotOpenException
- {
- }
-
- public void disassociate(Realm realm, Identity identity, List<Role> roleList)
- throws PersistenceManagerNotFoundException, SessionNotOpenException
- {
- }
-
- public void disassociate(Realm realm, Identity identity, Group group) throws PersistenceManagerNotFoundException,
- SessionNotOpenException
- {
- }
-
- public void disassociate(Realm realm, Identity identity, Set<Group> groupSet)
- throws PersistenceManagerNotFoundException, SessionNotOpenException
- {
- }
-
- public PersistenceManager getPersistenceManager()
- {
- return null;
- }
-
- public RelationshipType getRelationship(Group fromGroup, Group toGroup)
- {
- return null;
- }
-
- public RelationshipType getRelationship(Realm fromRealm, Realm toRealm)
- {
- return null;
- }
-
- public void setPersistenceManager(PersistenceManager persistenceManager)
- {
- }
-}
\ No newline at end of file
+//public class PortalRelationshipManager implements RelationshipManager
+//{
+// public void associate(Group groupA, Group groupB, RelationshipType relationshipType)
+// throws PersistenceManagerNotFoundException, SessionNotOpenException
+// {
+// }
+//
+//
+// public void associate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
+// throws PersistenceManagerNotFoundException, SessionNotOpenException
+// {
+// }
+//
+// public void associate(Realm realmA, Realm realmB, RelationshipType relationshipType)
+// throws PersistenceManagerNotFoundException, SessionNotOpenException
+// {
+// }
+//
+// public void associate(Realm realm, Identity identity, Role role) throws PersistenceManagerNotFoundException,
+// SessionNotOpenException
+// {
+// }
+//
+// public void associate(Realm realm, Identity identity, List<Role> roleList)
+// throws PersistenceManagerNotFoundException, SessionNotOpenException
+// {
+// }
+//
+// public void associate(Realm realm, Identity identity, Group group) throws PersistenceManagerNotFoundException,
+// SessionNotOpenException
+// {
+// }
+//
+// public void associate(Realm realm, Identity identity, Set<Group> groupSet)
+// throws PersistenceManagerNotFoundException, SessionNotOpenException
+// {
+// }
+//
+// public void disassociate(Group groupA, Group groupB, RelationshipType relationshipType)
+// throws PersistenceManagerNotFoundException, SessionNotOpenException
+// {
+// }
+//
+// public void disassociate(Group groupA, List<Group> groupB, RelationshipType relationshipType)
+// throws PersistenceManagerNotFoundException, SessionNotOpenException
+// {
+// }
+//
+// public void disassociate(Realm realmA, Realm realmB, RelationshipType relationshipType)
+// throws PersistenceManagerNotFoundException, SessionNotOpenException
+// {
+// }
+//
+// public void disassociate(Realm realm, Identity identity, Role role) throws PersistenceManagerNotFoundException,
+// SessionNotOpenException
+// {
+// }
+//
+// public void disassociate(Realm realm, Identity identity, List<Role> roleList)
+// throws PersistenceManagerNotFoundException, SessionNotOpenException
+// {
+// }
+//
+// public void disassociate(Realm realm, Identity identity, Group group) throws PersistenceManagerNotFoundException,
+// SessionNotOpenException
+// {
+// }
+//
+// public void disassociate(Realm realm, Identity identity, Set<Group> groupSet)
+// throws PersistenceManagerNotFoundException, SessionNotOpenException
+// {
+// }
+//
+// public PersistenceManager getPersistenceManager()
+// {
+// return null;
+// }
+//
+// public RelationshipType getRelationship(Group fromGroup, Group toGroup)
+// {
+// return null;
+// }
+//
+// public RelationshipType getRelationship(Realm fromRealm, Realm toRealm)
+// {
+// return null;
+// }
+//
+// public void setPersistenceManager(PersistenceManager persistenceManager)
+// {
+// }
+//}
\ No newline at end of file
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalSession.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalSession.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalSession.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -1,90 +1,90 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.test.identity.impl.portal;
-
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.jboss.identity.api.exception.IdentityException;
-import org.jboss.identity.api.session.Session;
-import org.jboss.identity.api.session.SessionState;
-
-/**
- * Portal Session
- * @author Anil.Saldhana(a)redhat.com
- * @since Jul 22, 2008
- */
-public class PortalSession implements Session
-{
- private static ConcurrentHashMap<String,PortalSession>
- portalSessions = new ConcurrentHashMap<String,PortalSession>();
-
- private String id = UUID.randomUUID().toString();
-
- private SessionState state;
-
- private PortalSession()
- {
- }
-
- public String getId()
- {
- return id;
- }
-
- public void clear() throws IdentityException
- {
- }
-
- public void close() throws IdentityException
- {
- state = SessionState.CLOSED;
- }
-
- public boolean isOpen()
- {
- return state != SessionState.CLOSED;
- }
-
- public void open() throws IdentityException
- {
- if(!isOpen())
- state = SessionState.OPEN;
- }
-
- public void save() throws IdentityException
- {
- }
-
- public static PortalSession getSession(String id)
- {
- //TODO: handle security better
- return portalSessions.get(id);
- }
-
- public static PortalSession newSession()
- {
- PortalSession newPortalSession = new PortalSession();
- portalSessions.put(newPortalSession.id, newPortalSession);
- return newPortalSession;
- }
-}
\ No newline at end of file
+///*
+// * JBoss, Home of Professional Open Source.
+// * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+// * as indicated by the @author tags. See the copyright.txt file 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.test.identity.impl.portal;
+//
+//import java.util.UUID;
+//import java.util.concurrent.ConcurrentHashMap;
+//
+//import org.jboss.identity.api.exception.IdentityException;
+//import org.jboss.identity.api.session.Session;
+//import org.jboss.identity.api.session.SessionState;
+//
+///**
+// * Portal Session
+// * @author Anil.Saldhana(a)redhat.com
+// * @since Jul 22, 2008
+// */
+//public class PortalSession implements Session
+//{
+// private static ConcurrentHashMap<String,PortalSession>
+// portalSessions = new ConcurrentHashMap<String,PortalSession>();
+//
+// private String id = UUID.randomUUID().toString();
+//
+// private SessionState state;
+//
+// private PortalSession()
+// {
+// }
+//
+// public String getId()
+// {
+// return id;
+// }
+//
+// public void clear() throws IdentityException
+// {
+// }
+//
+// public void close() throws IdentityException
+// {
+// state = SessionState.CLOSED;
+// }
+//
+// public boolean isOpen()
+// {
+// return state != SessionState.CLOSED;
+// }
+//
+// public void open() throws IdentityException
+// {
+// if(!isOpen())
+// state = SessionState.OPEN;
+// }
+//
+// public void save() throws IdentityException
+// {
+// }
+//
+// public static PortalSession getSession(String id)
+// {
+// //TODO: handle security better
+// return portalSessions.get(id);
+// }
+//
+// public static PortalSession newSession()
+// {
+// PortalSession newPortalSession = new PortalSession();
+// portalSessions.put(newPortalSession.id, newPortalSession);
+// return newPortalSession;
+// }
+//}
\ No newline at end of file
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/test/portal/PortalIdentityUnitTestCase.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/test/portal/PortalIdentityUnitTestCase.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/test/portal/PortalIdentityUnitTestCase.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -23,22 +23,22 @@
import junit.framework.TestCase;
-import org.jboss.identity.api.managers.IdentityManager;
-import org.jboss.identity.api.managers.RelationshipManager;
-import org.jboss.identity.api.store.IdentityStore;
-import org.jboss.identity.api.store.IdentityStoreRepository;
-import org.jboss.identity.impl.store.FileBasedIdentityStore;
-import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.IdentityType;
-import org.jboss.identity.model.groups.Group;
-import org.jboss.identity.model.groups.GroupType;
-import org.jboss.identity.model.groups.SimpleGroupType;
-import org.jboss.identity.model.relation.HierarchicalRelationshipType;
-import org.jboss.identity.model.relation.RelationshipType;
-import org.jboss.test.identity.impl.portal.PortalIdentityManager;
-import org.jboss.test.identity.impl.portal.PortalIdentityStoreRepository;
-import org.jboss.test.identity.impl.portal.PortalRealm;
-import org.jboss.test.identity.impl.portal.PortalRelationshipManager;
+//import org.jboss.identity.api.managers.IdentityManager;
+//import org.jboss.identity.api.managers.RelationshipManager;
+//import org.jboss.identity.api.store.IdentityStore;
+//import org.jboss.identity.api.store.IdentityStoreRepository;
+//import org.jboss.identity.impl.store.FileBasedIdentityStore;
+//import org.jboss.identity.model.Identity;
+//import org.jboss.identity.model.IdentityType;
+//import org.jboss.identity.model.groups.Group;
+//import org.jboss.identity.model.groups.GroupType;
+//import org.jboss.identity.model.groups.SimpleGroupType;
+//import org.jboss.identity.model.relation.HierarchicalRelationshipType;
+//import org.jboss.identity.model.relation.RelationshipType;
+////import org.jboss.test.identity.impl.portal.PortalIdentityManager;
+//import org.jboss.test.identity.impl.portal.PortalIdentityStoreRepository;
+//import org.jboss.test.identity.impl.portal.PortalRealm;
+//import org.jboss.test.identity.impl.portal.PortalRelationshipManager;
/**
* Portal identity unit test
@@ -50,23 +50,23 @@
// private IdentityType IDENTITY = IdentityTypeEnum.IDENTITY;
// private IdentityType GROUP = IdentityTypeEnum.GROUP;
- private RelationshipType hierarchy = new HierarchicalRelationshipType();
- private RelationshipManager relationshipManager = new PortalRelationshipManager();
- private IdentityManager identityManager = new PortalIdentityManager();
- private PortalRealm portalRealm ;
- private PortalIdentityStoreRepository portalRepository;
- private IdentityStore portalIdentityStore;
+// private RelationshipType hierarchy = new HierarchicalRelationshipType();
+// private RelationshipManager relationshipManager = new PortalRelationshipManager();
+// private IdentityManager identityManager = new PortalIdentityManager();
+// private PortalRealm portalRealm ;
+// private PortalIdentityStoreRepository portalRepository;
+// private IdentityStore portalIdentityStore;
+//
+// protected void setUp() throws Exception
+// {
+// portalRealm = (PortalRealm) identityManager.bootstrap("portal");
+// portalRealm.createModelRoots();
+// portalRepository = new PortalIdentityStoreRepository();
+// identityManager.setRepository(portalRealm, portalRepository);
+// portalIdentityStore = new FileBasedIdentityStore();
+//// portalRepository.register(IDENTITY, portalIdentityStore);
+// }
- protected void setUp() throws Exception
- {
- portalRealm = (PortalRealm) identityManager.bootstrap("portal");
- portalRealm.createModelRoots();
- portalRepository = new PortalIdentityStoreRepository();
- identityManager.setRepository(portalRealm, portalRepository);
- portalIdentityStore = new FileBasedIdentityStore();
-// portalRepository.register(IDENTITY, portalIdentityStore);
- }
-
public void testPortalIdentityOrganizationType() throws Exception
{
bootstrapOrganizationType();
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityObject.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityObject.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityObject.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -35,12 +35,23 @@
{
/**
+ * @return id of this identity object
+ */
+ Object getId();
+
+ /**
+ * FQDN identifies the context of this object - realm, identity store in which it is persisted and object id in this store
+ *
+ * @return full qualified domain name for this identity
+ */
+ String getFQDN();
+
+ /**
* <p>Return the name of the identity</p>
* @return
*/
String getName();
-
/**
* <p>Return type of this identity object</p>
* @return
Deleted: trunk/identity-model/src/main/java/org/jboss/identity/model/Role.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/Role.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/Role.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.model;
-
-/**
- * Marker Interface represents a role
- * @author Anil.Saldhana(a)redhat.com
- * @since Jun 30, 2008
- */
-public interface Role extends IdentityType
-{
- /**
- * Get the type of role
- * @return
- */
- RoleType getRoleType();
-}
\ No newline at end of file
Deleted: trunk/identity-model/src/main/java/org/jboss/identity/model/RoleType.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/RoleType.java 2008-09-02 17:53:24 UTC (rev 53)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/RoleType.java 2008-09-02 18:26:12 UTC (rev 54)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.model;
-
-/**
- * Type of Role
- * @author Anil.Saldhana(a)redhat.com
- * @since Jun 30, 2008
- */
-public enum RoleType
-{
- /**
- * Plain Role
- */
- REGULAR,
- /**
- * A role that is nested within another
- */
- NESTED,
- /**
- * A role that is part of an hierarchy
- * (Eg. LDAP Role)
- */
- HIERARCHICAL,
- /**
- * Custom Role
- */
- CUSTOM;
-}
\ No newline at end of file
15 years, 9 months
JBoss Identity SVN: r53 - in trunk: identity-api/src/main/java/org/jboss/identity/api/session and 10 other directories.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2008-09-02 13:53:24 -0400 (Tue, 02 Sep 2008)
New Revision: 53
Added:
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityObject.java
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java
trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java
Removed:
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityTypeEnum.java
Modified:
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api/session/SessionState.java
trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java
trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityManager.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStore.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRelationshipManager.java
trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/test/portal/PortalIdentityUnitTestCase.java
trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java
trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java
trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java
trunk/identity-model/src/main/java/org/jboss/identity/model/policy/PasswordExpirationPolicy.java
trunk/identity-model/src/main/java/org/jboss/identity/model/policy/RelationshipPolicy.java
Log:
- Make IdentityType separate class from identities inheritance.
- Added IdentityObject as abstract interface that Identity/Role/Group interfaces extend. IdentityObject contain IdentityType.
- Refactor all other interfaces accordingly
- Comment out portal testcases for now
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/IdentityManager.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -27,8 +27,8 @@
import org.jboss.identity.api.session.Session;
import org.jboss.identity.api.store.IdentityStoreRepository;
import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.Role;
-import org.jboss.identity.model.RoleType;
+import org.jboss.identity.model.roles.Role;
+import org.jboss.identity.model.roles.RoleType;
import org.jboss.identity.model.domain.Realm;
import org.jboss.identity.model.groups.Group;
import org.jboss.identity.model.groups.GroupType;
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -27,7 +27,7 @@
import org.jboss.identity.api.exception.PersistenceManagerNotFoundException;
import org.jboss.identity.api.exception.SessionNotOpenException;
import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.Role;
+import org.jboss.identity.model.roles.Role;
import org.jboss.identity.model.domain.Realm;
import org.jboss.identity.model.groups.Group;
import org.jboss.identity.model.relation.RelationshipType;
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/session/SessionState.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/session/SessionState.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/session/SessionState.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -28,5 +28,5 @@
*/
public enum SessionState
{
- OPEN, CLOSED,ACTIVE;
+ OPEN, CLOSED, ACTIVE;
}
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -58,7 +58,7 @@
/**
* @param operationType
* @return set of identity types that can be processed with a given operation
- * @throws org.jboss.idm.exceptions.IdmException
+ * @throws org.jboss.identity.api.exception.IdentityException
*/
public Set<IdentityType> getSupportedIdentities(OperationType operationType);
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -27,7 +27,7 @@
import java.util.Set;
import org.jboss.identity.api.exception.IdentityException;
-import org.jboss.identity.model.Identity;
+import org.jboss.identity.model.IdentityObject;
import org.jboss.identity.model.IdentityType;
import org.jboss.identity.model.groups.Group;
import org.jboss.identity.model.relation.RelationshipType;
@@ -67,7 +67,7 @@
* @return
* @throws IdentityException
*/
- Identity createIdentity(String name) throws IdentityException;
+ IdentityObject createIdentity(String name) throws IdentityException;
/**
* Remove given identity
@@ -75,14 +75,14 @@
* @param identity
* @throws IdentityException
*/
- void removeIdentity(Identity identity) throws IdentityException;
+ void removeIdentity(IdentityObject identity) throws IdentityException;
/**
* @param identityType
* @return a number of stored identities with a given type
* @throws IdentityException
*/
- <T extends IdentityType> int getIdentitiesCount(T identityType)
+ <T extends IdentityType> int getIdentitiesCount(T identityType)
throws IdentityException;
/**
@@ -92,7 +92,7 @@
* @return
* @throws IdentityException
*/
- Identity findIdentity(String name) throws IdentityException;
+ IdentityObject findIdentity(String name) throws IdentityException;
/**
* Find identity with a given id
@@ -101,7 +101,7 @@
* @return
* @throws IdentityException
*/
- Identity findIdentity(Object id) throws IdentityException;
+ IdentityObject findIdentity(Object id) throws IdentityException;
/**
* Find identities with a given type paginated and ordered.
@@ -117,7 +117,7 @@
* @return
* @throws IdentityException
*/
- <T extends IdentityType> Collection<Identity> findIdentities(T identityType,
+ <T extends IdentityType> Collection<IdentityObject> findIdentities(T identityType,
int offset, int limit,
String orderedByAttributeName,
boolean ascending) throws IdentityException;
@@ -136,7 +136,7 @@
* @return
* @throws IdentityException
*/
- <T extends IdentityType> Collection<Identity> findIdentities(T identityType,
+ <T extends IdentityType> Collection<IdentityObject> findIdentities(T identityType,
Map<String, String[]> attributes,
int offset, int limit,
String orderedByAttributeName, boolean ascending) throws IdentityException;
@@ -158,7 +158,7 @@
* @return
* @throws IdentityException
*/
- <R extends RelationshipType> Collection<Identity> findIdentities(Identity identity,
+ <R extends RelationshipType>Collection<IdentityObject> findIdentities(IdentityObject identity,
R relationshipType,
boolean parent,
int offset, int limit,
@@ -180,7 +180,7 @@
* @return
* @throws IdentityException
*/
- Map<String, String[]> getAttributes(Identity identity) throws IdentityException;
+ Map<String, String[]> getAttributes(IdentityObject identity) throws IdentityException;
/**
* Update attributes with new values - previous values will be overwritten
@@ -188,7 +188,7 @@
* @param attributes
* @throws IdentityException
*/
- void updateAttributes(Identity identity, Map<String, String[]> attributes)
+ void updateAttributes(IdentityObject identity, Map<String, String[]> attributes)
throws IdentityException;
/**
@@ -199,7 +199,7 @@
* @param attributes
* @throws IdentityException
*/
- void addAttributes(Identity identity, Map<String, String[]> attributes)
+ void addAttributes(IdentityObject identity, Map<String, String[]> attributes)
throws IdentityException;
/**
@@ -208,7 +208,7 @@
* @param identity
* @param attributes
*/
- void removeAttributes(Identity identity, Set<String> attributes)
+ void removeAttributes(IdentityObject identity, Set<String> attributes)
throws IdentityException;
/**
@@ -219,8 +219,8 @@
* @param relationshipType
* @throws IdentityException
*/
- <R extends RelationshipType> void createRelationship(Identity fromIdentity,
- Identity toIdentity,
+ <R extends RelationshipType> void createRelationship(IdentityObject fromIdentity,
+ IdentityObject toIdentity,
R relationshipType) throws IdentityException;
/**
@@ -232,8 +232,8 @@
* @param relationshipType
* @throws IdentityException
*/
- <R extends RelationshipType> void removeRelationship(Identity fromIdentity,
- Identity toIdentity,
+ <R extends RelationshipType> void removeRelationship(IdentityObject fromIdentity,
+ IdentityObject toIdentity,
R relationshipType) throws IdentityException;
/**
@@ -245,7 +245,7 @@
* @param identity2
* @throws IdentityException
*/
- void removeRelationships(Identity identity1, Identity identity2)
+ void removeRelationships(IdentityObject identity1, IdentityObject identity2)
throws IdentityException;
/**
@@ -257,29 +257,7 @@
* @return
* @throws IdentityException
*/
- Set<RelationshipType> resolveRelationships(Identity fromIdentity, Identity toIdentity)
+ Set<RelationshipType> resolveRelationships(IdentityObject fromIdentity, IdentityObject toIdentity)
throws IdentityException;
- /**
- * Create a Group
- * @param groupName
- * @return
- * @throws IdentityException
- */
- Group createGroup(String groupName) throws IdentityException;
-
-
- /**
- * Find a group
- * @param groupName
- * @return
- */
- Group findGroup(String groupName);
-
- /**
- * Remove a group
- * @param group
- * @throws IdentityException
- */
- void removeGroup(Group group) throws IdentityException;
}
\ No newline at end of file
Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -48,7 +48,7 @@
Map<IdentityType, IdentityStore> getIdentityStoreMappings();
/**
- * @param groupType
+ * @param identityType
* @return proper identity store to store given identity type
*/
IdentityStore getIdentityStore(IdentityType identityType);
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/store/FileBasedIdentityStore.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -31,10 +31,9 @@
import org.jboss.identity.api.exception.IdentityException;
import org.jboss.identity.api.store.FeaturesDescription;
import org.jboss.identity.api.store.IdentityStore;
-import org.jboss.identity.impl.types.SimpleGroup;
import org.jboss.identity.impl.types.SimpleIdentity;
-import org.jboss.identity.model.Identity;
import org.jboss.identity.model.IdentityType;
+import org.jboss.identity.model.IdentityObject;
import org.jboss.identity.model.groups.Group;
import org.jboss.identity.model.relation.RelationshipType;
@@ -47,11 +46,11 @@
{
//TODO: Handle file semantics
- private List<Identity> identities = new ArrayList<Identity>();
+ private List<IdentityObject> identities = new ArrayList<IdentityObject>();
private List<Group> groups = new ArrayList<Group>();
- public void addAttributes(Identity identity, Map<String, String[]> attributes)
+ public void addAttributes(IdentityObject identity, Map<String, String[]> attributes)
throws IdentityException
{
}
@@ -60,10 +59,12 @@
{
}
- public Identity createIdentity(String name) throws IdentityException
+
+
+ public IdentityObject createIdentity(String name) throws IdentityException
{
//Is there one already available?
- Identity identity = this.findIdentity(name);
+ IdentityObject identity = this.findIdentity(name);
if(identity == null)
{
identity = new SimpleIdentity(name);
@@ -72,41 +73,14 @@
return identity;
}
- public <R extends RelationshipType> void createRelationship(Identity fromIdentity,
- Identity toIdentity,
+ public <R extends RelationshipType> void createRelationship(IdentityObject fromIdentity,
+ IdentityObject toIdentity,
R relationshipType)
throws IdentityException
{
}
- public Group createGroup(String groupName) throws IdentityException
- {
- Group group = findGroup(groupName);
- if(group == null)
- {
- group = new SimpleGroup(groupName);
- groups.add(group);
- }
- return group;
- }
-
-
- public Group findGroup(String groupName)
- {
- for(Group group: groups)
- {
- if(group.getName().equals(groupName))
- return group;
- }
- return null;
- }
-
- public void removeGroup(Group group) throws IdentityException
- {
- groups.remove(group);
- }
-
- public <T extends IdentityType> Collection<Identity> findIdentities(T identityType,
+ public <T extends IdentityType> Collection<IdentityObject> findIdentities(T identityType,
int offset,
int limit,
String orderedByAttributeName, boolean ascending) throws IdentityException
@@ -114,7 +88,7 @@
return null;
}
- public <T extends IdentityType> Collection<Identity> findIdentities(T identityType,
+ public <T extends IdentityType> Collection<IdentityObject> findIdentities(T identityType,
Map<String, String[]> attributes, int offset,
int limit, String orderedByAttributeName, boolean ascending)
throws IdentityException
@@ -122,17 +96,14 @@
return null;
}
- public Collection<Identity> findIdentities(Identity identity,
- RelationshipType relationshipType, boolean parent,
- int offset, int limit, String orderedByAttributeName,
- boolean ascending) throws IdentityException
+ public <T extends IdentityType> Set<String> getSupportedAttributeNames(T identityType) throws IdentityException
{
return null;
}
- public Identity findIdentity(String name) throws IdentityException
+ public IdentityObject findIdentity(String name) throws IdentityException
{
- for(Identity identity: identities)
+ for(IdentityObject identity: identities)
{
if(name.equals(identity.getName()))
return identity;
@@ -140,12 +111,12 @@
return null;
}
- public Identity findIdentity(Object id) throws IdentityException
+ public IdentityObject findIdentity(Object id) throws IdentityException
{
return null;
}
- public Map<String, String[]> getAttributes(Identity identity)
+ public Map<String, String[]> getAttributes(IdentityObject identity)
throws IdentityException
{
return null;
@@ -156,14 +127,13 @@
return null;
}
- public int getIdentitiesCount(IdentityType identityType)
- throws IdentityException
+
+ public <T extends IdentityType> int getIdentitiesCount(T identityType) throws IdentityException
{
return 0;
}
- public Set<String> getSupportedAttributeNames(IdentityType identityType)
- throws IdentityException
+ public <R extends RelationshipType> Collection<IdentityObject> findIdentities(IdentityObject identity, R relationshipType, boolean parent, int offset, int limit, String orderedByAttributeName, boolean ascending) throws IdentityException
{
return null;
}
@@ -173,35 +143,35 @@
return null;
}
- public void removeAttributes(Identity identity, Set<String> attributes)
+ public void removeAttributes(IdentityObject identity, Set<String> attributes)
throws IdentityException
{
}
- public void removeIdentity(Identity identity) throws IdentityException
+ public void removeIdentity(IdentityObject identity) throws IdentityException
{
}
- public <R extends RelationshipType> void removeRelationship(Identity fromIdentity,
- Identity toIdentity,
+ public <R extends RelationshipType> void removeRelationship(IdentityObject fromIdentity,
+ IdentityObject toIdentity,
R relationshipType)
throws IdentityException
{
}
- public void removeRelationships(Identity identity1, Identity identity2)
+ public void removeRelationships(IdentityObject identity1, IdentityObject identity2)
throws IdentityException
{
}
- public Set<RelationshipType> resolveRelationships(Identity fromIdentity,
- Identity toIdentity)
+ public Set<RelationshipType> resolveRelationships(IdentityObject fromIdentity,
+ IdentityObject toIdentity)
throws IdentityException
{
return null;
}
- public void updateAttributes(Identity identity, Map<String, String[]> attributes)
+ public void updateAttributes(IdentityObject identity, Map<String, String[]> attributes)
throws IdentityException
{
}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleGroup.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -25,7 +25,8 @@
import java.util.List;
import org.jboss.identity.model.IdentityAttribute;
-import org.jboss.identity.model.Role;
+import org.jboss.identity.model.roles.Role;
+import org.jboss.identity.model.IdentityType;
import org.jboss.identity.model.groups.Group;
import org.jboss.identity.model.policy.PolicyValidationException;
import org.jboss.identity.model.policy.RelationshipPolicy;
@@ -43,7 +44,12 @@
{
this.name = name;
}
-
+
+ public IdentityType getIdentityType()
+ {
+ return null;
+ }
+
public void add(RelationshipPolicy<Group, Group> relationPolicy)
{
}
Modified: trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java
===================================================================
--- trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-impl/src/main/java/org/jboss/identity/impl/types/SimpleIdentity.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -26,7 +26,8 @@
import org.jboss.identity.model.Identity;
import org.jboss.identity.model.IdentityAttribute;
-import org.jboss.identity.model.Role;
+import org.jboss.identity.model.roles.Role;
+import org.jboss.identity.model.IdentityType;
import org.jboss.identity.model.groups.Group;
import org.jboss.identity.model.policy.PolicyValidationException;
@@ -36,7 +37,13 @@
* @since Aug 6, 2008
*/
public class SimpleIdentity implements Identity
-{
+{
+
+ public IdentityType getIdentityType()
+ {
+ return null;
+ }
+
protected String name;
protected List<IdentityAttribute> attributes = Collections.emptyList();
protected List<Group> groups = Collections.emptyList();
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityManager.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityManager.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityManager.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -26,12 +26,10 @@
import org.jboss.identity.api.exception.IdentityException;
import org.jboss.identity.api.managers.IdentityManager;
import org.jboss.identity.api.session.Session;
-import org.jboss.identity.api.store.IdentityStore;
import org.jboss.identity.api.store.IdentityStoreRepository;
import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.IdentityTypeEnum;
-import org.jboss.identity.model.Role;
-import org.jboss.identity.model.RoleType;
+import org.jboss.identity.model.roles.Role;
+import org.jboss.identity.model.roles.RoleType;
import org.jboss.identity.model.domain.Realm;
import org.jboss.identity.model.groups.Group;
import org.jboss.identity.model.groups.GroupType;
@@ -44,9 +42,9 @@
public class PortalIdentityManager implements IdentityManager
{
private PortalRealm portalRealm = new PortalRealm();
-
+
private IdentityStoreRepository repository;
-
+
public Realm bootstrap(String realmName)
{
return portalRealm;
@@ -61,10 +59,11 @@
public Group createGroup(Realm realm, String groupName)
throws IdentityException
{
- IdentityStore identityStore = this.repository.getIdentityStore(IdentityTypeEnum.IDENTITY);
- if(identityStore == null)
- throw new IllegalStateException("Identity Store is null");
- return identityStore.createGroup(groupName);
+// IdentityStore identityStore = this.repository.getIdentityStore(IdentityTypeEnum.IDENTITY);
+// if(identityStore == null)
+// throw new IllegalStateException("Identity Store is null");
+// return identityStore.createGroup(groupName);
+ return null;
}
public Group createGroup(Realm realm, String groupName, GroupType groupType)
@@ -75,10 +74,11 @@
public Identity createIdentity(Realm realm, String identityName) throws IdentityException
{
- IdentityStore identityStore = this.repository.getIdentityStore(IdentityTypeEnum.IDENTITY);
- if(identityStore == null)
- throw new IllegalStateException("Identity Store is null");
- return identityStore.createIdentity(identityName);
+// IdentityStore identityStore = this.repository.getIdentityStore(IdentityTypeEnum.IDENTITY);
+// if(identityStore == null)
+// throw new IllegalStateException("Identity Store is null");
+// return identityStore.createIdentity(identityName);
+ return null;
}
public Role createRole(Realm realm, String roleName, RoleType roleType)
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStore.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStore.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalIdentityStore.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -39,120 +39,120 @@
* @author Anil.Saldhana(a)redhat.com
* @since Jul 22, 2008
*/
-public class PortalIdentityStore implements IdentityStore
-{
- public void addAttributes(Identity identity, Map<String, String[]> attributes) throws IdentityException
- {
- }
-
- public Identity createIdentity(String name) throws IdentityException
- {
- return null;
- }
-
- public Identity findIdentity(String name) throws IdentityException
- {
- return null;
- }
-
- public Identity findIdentity(Object id) throws IdentityException
- {
- return null;
- }
-
- public Map<String, String[]> getAttributes(Identity identity) throws IdentityException
- {
- return null;
- }
-
- public String getId()
- {
-
- return null;
- }
-
- public FeaturesDescription getSupportedFeatures()
- {
- return null;
- }
-
- public void removeAttributes(Identity identity, Set<String> attributes) throws IdentityException
- {
- }
-
- public void removeIdentity(Identity identity) throws IdentityException
- {
- }
-
- public void removeRelationships(Identity identity1, Identity identity2) throws IdentityException
- {
- }
-
- public Set<RelationshipType> resolveRelationships(Identity fromIdentity, Identity toIdentity)
- throws IdentityException
- {
- return null;
- }
-
- public void updateAttributes(Identity identity, Map<String, String[]> attributes) throws IdentityException
- {
- }
-
- public void bootstrap() throws IOException
- {
- }
-
- public Group createGroup(String groupName) throws IdentityException
- {
- return null;
- }
-
- public <R extends RelationshipType> void createRelationship(Identity fromIdentity, Identity toIdentity,
- R relationshipType) throws IdentityException
- {
- }
-
- public Group findGroup(String groupName)
- {
- return null;
- }
-
- public <T extends IdentityType> Collection<Identity> findIdentities(T identityType, int offset, int limit,
- String orderedByAttributeName, boolean ascending) throws IdentityException
- {
- return null;
- }
-
- public <T extends IdentityType> Collection<Identity> findIdentities(T identityType,
- Map<String, String[]> attributes, int offset, int limit, String orderedByAttributeName, boolean ascending)
- throws IdentityException
- {
- return null;
- }
-
- public <R extends RelationshipType> Collection<Identity> findIdentities(Identity identity, R relationshipType,
- boolean parent, int offset, int limit, String orderedByAttributeName, boolean ascending)
- throws IdentityException
- {
- return null;
- }
-
- public <T extends IdentityType> int getIdentitiesCount(T identityType) throws IdentityException
- {
- return 0;
- }
-
- public <T extends IdentityType> Set<String> getSupportedAttributeNames(T identityType) throws IdentityException
- {
- return null;
- }
-
- public void removeGroup(Group group) throws IdentityException
- {
- }
-
- public <R extends RelationshipType> void removeRelationship(Identity fromIdentity, Identity toIdentity,
- R relationshipType) throws IdentityException
- {
- }
-}
\ No newline at end of file
+//public class PortalIdentityStore implements IdentityStore
+//{
+// public void addAttributes(Identity identity, Map<String, String[]> attributes) throws IdentityException
+// {
+// }
+//
+// public Identity createIdentity(String name) throws IdentityException
+// {
+// return null;
+// }
+//
+// public Identity findIdentity(String name) throws IdentityException
+// {
+// return null;
+// }
+//
+// public Identity findIdentity(Object id) throws IdentityException
+// {
+// return null;
+// }
+//
+// public Map<String, String[]> getAttributes(Identity identity) throws IdentityException
+// {
+// return null;
+// }
+//
+// public String getId()
+// {
+//
+// return null;
+// }
+//
+// public FeaturesDescription getSupportedFeatures()
+// {
+// return null;
+// }
+//
+// public void removeAttributes(Identity identity, Set<String> attributes) throws IdentityException
+// {
+// }
+//
+// public void removeIdentity(Identity identity) throws IdentityException
+// {
+// }
+//
+// public void removeRelationships(Identity identity1, Identity identity2) throws IdentityException
+// {
+// }
+//
+// public Set<RelationshipType> resolveRelationships(Identity fromIdentity, Identity toIdentity)
+// throws IdentityException
+// {
+// return null;
+// }
+//
+// public void updateAttributes(Identity identity, Map<String, String[]> attributes) throws IdentityException
+// {
+// }
+//
+// public void bootstrap() throws IOException
+// {
+// }
+//
+// public Group createGroup(String groupName) throws IdentityException
+// {
+// return null;
+// }
+//
+// public <R extends RelationshipType> void createRelationship(Identity fromIdentity, Identity toIdentity,
+// R relationshipType) throws IdentityException
+// {
+// }
+//
+// public Group findGroup(String groupName)
+// {
+// return null;
+// }
+//
+// public <T extends IdentityType> Collection<Identity> findIdentities(T identityType, int offset, int limit,
+// String orderedByAttributeName, boolean ascending) throws IdentityException
+// {
+// return null;
+// }
+//
+// public <T extends IdentityType> Collection<Identity> findIdentities(T identityType,
+// Map<String, String[]> attributes, int offset, int limit, String orderedByAttributeName, boolean ascending)
+// throws IdentityException
+// {
+// return null;
+// }
+//
+// public <R extends RelationshipType> Collection<Identity> findIdentities(Identity identity, R relationshipType,
+// boolean parent, int offset, int limit, String orderedByAttributeName, boolean ascending)
+// throws IdentityException
+// {
+// return null;
+// }
+//
+// public <T extends IdentityType> int getIdentitiesCount(T identityType) throws IdentityException
+// {
+// return 0;
+// }
+//
+// public <T extends IdentityType> Set<String> getSupportedAttributeNames(T identityType) throws IdentityException
+// {
+// return null;
+// }
+//
+// public void removeGroup(Group group) throws IdentityException
+// {
+// }
+//
+// public <R extends RelationshipType> void removeRelationship(Identity fromIdentity, Identity toIdentity,
+// R relationshipType) throws IdentityException
+// {
+// }
+//}
\ No newline at end of file
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRelationshipManager.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRelationshipManager.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/portal/PortalRelationshipManager.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -29,7 +29,7 @@
import org.jboss.identity.api.managers.PersistenceManager;
import org.jboss.identity.api.managers.RelationshipManager;
import org.jboss.identity.model.Identity;
-import org.jboss.identity.model.Role;
+import org.jboss.identity.model.roles.Role;
import org.jboss.identity.model.domain.Realm;
import org.jboss.identity.model.groups.Group;
import org.jboss.identity.model.relation.RelationshipType;
Modified: trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/test/portal/PortalIdentityUnitTestCase.java
===================================================================
--- trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/test/portal/PortalIdentityUnitTestCase.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-impl/src/test/java/org/jboss/test/identity/impl/test/portal/PortalIdentityUnitTestCase.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -30,7 +30,6 @@
import org.jboss.identity.impl.store.FileBasedIdentityStore;
import org.jboss.identity.model.Identity;
import org.jboss.identity.model.IdentityType;
-import org.jboss.identity.model.IdentityTypeEnum;
import org.jboss.identity.model.groups.Group;
import org.jboss.identity.model.groups.GroupType;
import org.jboss.identity.model.groups.SimpleGroupType;
@@ -48,8 +47,8 @@
*/
public class PortalIdentityUnitTestCase extends TestCase
{
- private IdentityType IDENTITY = IdentityTypeEnum.IDENTITY;
- private IdentityType GROUP = IdentityTypeEnum.GROUP;
+// private IdentityType IDENTITY = IdentityTypeEnum.IDENTITY;
+// private IdentityType GROUP = IdentityTypeEnum.GROUP;
private RelationshipType hierarchy = new HierarchicalRelationshipType();
private RelationshipManager relationshipManager = new PortalRelationshipManager();
@@ -65,7 +64,7 @@
portalRepository = new PortalIdentityStoreRepository();
identityManager.setRepository(portalRealm, portalRepository);
portalIdentityStore = new FileBasedIdentityStore();
- portalRepository.register(IDENTITY, portalIdentityStore);
+// portalRepository.register(IDENTITY, portalIdentityStore);
}
public void testPortalIdentityOrganizationType() throws Exception
@@ -87,55 +86,55 @@
//***************************************************
// Create the Group Model
//***************************************************
- GroupType organizationGroupType = new SimpleGroupType("Organization");
- Group redhatGroup = identityManager.createGroup(portalRealm, "RedHat",
- organizationGroupType);
+// GroupType organizationGroupType = new SimpleGroupType("Organization");
+// Group redhatGroup = identityManager.createGroup(portalRealm, "RedHat",
+// organizationGroupType);
+//
+// Group jbossGroup = identityManager.createGroup(portalRealm, "JBoss",
+// organizationGroupType);
+// Group rhelGroup = identityManager.createGroup(portalRealm, "RHEL",
+// organizationGroupType);
+//
+// relationshipManager.associate(redhatGroup, jbossGroup, hierarchy);
+// relationshipManager.associate(redhatGroup, rhelGroup, hierarchy);
+//
+// Group itGroup = identityManager.createGroup(portalRealm, "IT",
+// organizationGroupType);
+// Group hrGroup = identityManager.createGroup(portalRealm, "HR",
+// organizationGroupType);
+//
+// relationshipManager.associate(jbossGroup, itGroup, hierarchy);
+// relationshipManager.associate(jbossGroup, hrGroup, hierarchy);
+//
+// Group projectsGroup = identityManager.createGroup(portalRealm, "Projects",
+// organizationGroupType);
+// Group supportGroup = identityManager.createGroup(portalRealm, "Support",
+// organizationGroupType);
+//
+// relationshipManager.associate(itGroup, projectsGroup, hierarchy);
+// relationshipManager.associate(itGroup, supportGroup, hierarchy);
+//
+// Group portalGroup = identityManager.createGroup(portalRealm, "Portal",
+// organizationGroupType);
+// Group jbpmGroup = identityManager.createGroup(portalRealm, "jBPM",
+// organizationGroupType);
+// Group soaGroup = identityManager.createGroup(portalRealm, "SOA",
+// organizationGroupType);
+//
+// relationshipManager.associate(projectsGroup, portalGroup, hierarchy);
+// relationshipManager.associate(projectsGroup, jbpmGroup, hierarchy);
+// relationshipManager.associate(projectsGroup, soaGroup, hierarchy);
- Group jbossGroup = identityManager.createGroup(portalRealm, "JBoss",
- organizationGroupType);
- Group rhelGroup = identityManager.createGroup(portalRealm, "RHEL",
- organizationGroupType);
-
- relationshipManager.associate(redhatGroup, jbossGroup, hierarchy);
- relationshipManager.associate(redhatGroup, rhelGroup, hierarchy);
-
- Group itGroup = identityManager.createGroup(portalRealm, "IT",
- organizationGroupType);
- Group hrGroup = identityManager.createGroup(portalRealm, "HR",
- organizationGroupType);
-
- relationshipManager.associate(jbossGroup, itGroup, hierarchy);
- relationshipManager.associate(jbossGroup, hrGroup, hierarchy);
-
- Group projectsGroup = identityManager.createGroup(portalRealm, "Projects",
- organizationGroupType);
- Group supportGroup = identityManager.createGroup(portalRealm, "Support",
- organizationGroupType);
-
- relationshipManager.associate(itGroup, projectsGroup, hierarchy);
- relationshipManager.associate(itGroup, supportGroup, hierarchy);
-
- Group portalGroup = identityManager.createGroup(portalRealm, "Portal",
- organizationGroupType);
- Group jbpmGroup = identityManager.createGroup(portalRealm, "jBPM",
- organizationGroupType);
- Group soaGroup = identityManager.createGroup(portalRealm, "SOA",
- organizationGroupType);
- relationshipManager.associate(projectsGroup, portalGroup, hierarchy);
- relationshipManager.associate(projectsGroup, jbpmGroup, hierarchy);
- relationshipManager.associate(projectsGroup, soaGroup, hierarchy);
-
-
//***************************************************
// Create the Identity Model
//***************************************************
//Create Identities - julien, theute and associate with portal group
- Identity julien = identityManager.createIdentity(portalRealm, "julien");
- Identity theute = identityManager.createIdentity(portalRealm, "theute");
-
- relationshipManager.associate(portalRealm, julien, portalGroup);
- relationshipManager.associate(portalRealm, theute, portalGroup);
+// Identity julien = identityManager.createIdentity(portalRealm, "julien");
+// Identity theute = identityManager.createIdentity(portalRealm, "theute");
+//
+// relationshipManager.associate(portalRealm, julien, portalGroup);
+// relationshipManager.associate(portalRealm, theute, portalGroup);
}
@@ -147,62 +146,66 @@
//***************************************************
// Create the Group Model
//***************************************************
- GroupType businessGroupType = new SimpleGroupType("Business");
- Group rolesGroup = identityManager.createGroup(portalRealm, "Roles",
- businessGroupType);
-
- Group developersGroup = identityManager.createGroup(portalRealm,
- "Developers",
- businessGroupType);
- Group managementGroup = identityManager.createGroup(portalRealm,
- "Management",
- businessGroupType);
-
- relationshipManager.associate(rolesGroup, developersGroup, hierarchy);
- relationshipManager.associate(rolesGroup, managementGroup, hierarchy);
-
- Group portalProjectLeadGroup = identityManager.createGroup(portalRealm,
- "Portal Project Lead",
- businessGroupType);
- Group portalProductLeadGroup = identityManager.createGroup(portalRealm,
- "Portal Product Lead",
- businessGroupType);
-
- relationshipManager.associate(developersGroup, portalProjectLeadGroup, hierarchy);
- relationshipManager.associate(developersGroup, portalProductLeadGroup, hierarchy);
-
- Group commonFrameworkManagerGroup = identityManager.createGroup(portalRealm,
- "Common Framework Manager",
- businessGroupType);
-
- relationshipManager.associate(managementGroup,
- commonFrameworkManagerGroup, hierarchy);
-
- //***************************************************
- // Create the Identity Model
- //***************************************************
- //Create Identities - julien, theute and associate with portal group
- Identity julien = identityManager.createIdentity(portalRealm, "julien");
- Identity theute = identityManager.createIdentity(portalRealm, "theute");
- //bgeorges for common framework manager group
- Identity bgeorges = identityManager.createIdentity(portalRealm, "bgeorges");
-
- relationshipManager.associate(portalRealm, julien, portalProjectLeadGroup);
- relationshipManager.associate(portalRealm, theute, portalProductLeadGroup);
- relationshipManager.associate(portalRealm, bgeorges, commonFrameworkManagerGroup);
+// GroupType businessGroupType = new SimpleGroupType("Business");
+// Group rolesGroup = identityManager.createGroup(portalRealm, "Roles",
+// businessGroupType);
+//
+// Group developersGroup = identityManager.createGroup(portalRealm,
+// "Developers",
+// businessGroupType);
+// Group managementGroup = identityManager.createGroup(portalRealm,
+// "Management",
+// businessGroupType);
+//
+// relationshipManager.associate(rolesGroup, developersGroup, hierarchy);
+// relationshipManager.associate(rolesGroup, managementGroup, hierarchy);
+//
+// Group portalProjectLeadGroup = identityManager.createGroup(portalRealm,
+// "Portal Project Lead",
+// businessGroupType);
+// Group portalProductLeadGroup = identityManager.createGroup(portalRealm,
+// "Portal Product Lead",
+// businessGroupType);
+//
+// relationshipManager.associate(developersGroup, portalProjectLeadGroup, hierarchy);
+// relationshipManager.associate(developersGroup, portalProductLeadGroup, hierarchy);
+//
+// Group commonFrameworkManagerGroup = identityManager.createGroup(portalRealm,
+// "Common Framework Manager",
+// businessGroupType);
+//
+// relationshipManager.associate(managementGroup,
+// commonFrameworkManagerGroup, hierarchy);
+//
+// //***************************************************
+// // Create the Identity Model
+// //***************************************************
+// //Create Identities - julien, theute and associate with portal group
+// Identity julien = identityManager.createIdentity(portalRealm, "julien");
+// Identity theute = identityManager.createIdentity(portalRealm, "theute");
+// //bgeorges for common framework manager group
+// Identity bgeorges = identityManager.createIdentity(portalRealm, "bgeorges");
+//
+// relationshipManager.associate(portalRealm, julien, portalProjectLeadGroup);
+// relationshipManager.associate(portalRealm, theute, portalProductLeadGroup);
+// relationshipManager.associate(portalRealm, bgeorges, commonFrameworkManagerGroup);
+//
+// portalIdentityStore.findIdentities(commonFrameworkManagerGroup, hierarchy, true, 0, 0, "", true);
}
private void searchOrganizationType() throws Exception
{
- IdentityStoreRepository repo = identityManager.getRepository(portalRealm);
- assertEquals(repo, portalRepository);
- //Get the IdentityStore for identities
- IdentityStore identityStore = repo.getIdentityStore(IdentityTypeEnum.IDENTITY);
- assertNotNull("IdentityStore is not null", identityStore);
- assertEquals("Portal Identity Store",portalIdentityStore,
- repo.getIdentityStore(IDENTITY));
-
- Identity julien = portalIdentityStore.findIdentity("julien");
- assertNotNull(julien);
+// IdentityStoreRepository repo = identityManager.getRepository(portalRealm);
+// assertEquals(repo, portalRepository);
+// //Get the IdentityStore for identities
+// IdentityStore identityStore = repo.getIdentityStore(IdentityTypeEnum.IDENTITY);
+// assertNotNull("IdentityStore is not null", identityStore);
+// assertEquals("Portal Identity Store",portalIdentityStore,
+// repo.getIdentityStore(IDENTITY));
+//
+//
+//
+// Identity julien = portalIdentityStore.findIdentity("julien");
+// assertNotNull(julien);
}
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/Identity.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -24,14 +24,18 @@
import java.util.List;
import org.jboss.identity.model.groups.Group;
+import org.jboss.identity.model.roles.Role;
/**
* Represents an Identity
* @author Anil.Saldhana(a)redhat.com
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
* @since Jun 30, 2008
*/
-public interface Identity extends IdentityType
-{
+public interface Identity extends IdentityObject
+{
+
+
/**
* <p>Return a list of Roles</p>
* @return
Added: trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityObject.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityObject.java (rev 0)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityObject.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -0,0 +1,61 @@
+/*
+* 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.model;
+
+import org.jboss.identity.model.policy.PolicyValidationException;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @author Anil.Saldhana(a)redhat.com
+ * @version : 0.1 $
+ */
+public abstract interface IdentityObject
+{
+
+ /**
+ * <p>Return the name of the identity</p>
+ * @return
+ */
+ String getName();
+
+
+ /**
+ * <p>Return type of this identity object</p>
+ * @return
+ */
+ IdentityType getIdentityType();
+
+ /**
+ * <p>Return a list of attributes</p>
+ * @return
+ */
+ List<IdentityAttribute> getAttributes();
+
+ /**
+ * Validate configured Policies
+ * @throws org.jboss.identity.model.policy.PolicyValidationException
+ */
+ void validatePolicy() throws PolicyValidationException;
+}
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityType.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -29,25 +29,16 @@
* Marker Interface representing
* an object of the Identity Model
* @author Anil.Saldhana(a)redhat.com
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
* @since Jul 10, 2008
*/
public interface IdentityType
{
/**
- * <p>Return the name of the identity</p>
+ * <p>Return the name of the identity type</p>
* @return
*/
String getName();
- /**
- * <p>Return a list of attributes</p>
- * @return
- */
- List<IdentityAttribute> getAttributes();
-
- /**
- * Validate configured Policies
- * @throws PolicyValidationException
- */
- void validatePolicy() throws PolicyValidationException;
+
}
\ No newline at end of file
Deleted: trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityTypeEnum.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityTypeEnum.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/IdentityTypeEnum.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.model;
-
-import java.util.List;
-
-import org.jboss.identity.model.policy.PolicyValidationException;
-
-/**
- * Type constant
- * @author Anil.Saldhana(a)redhat.com
- * @since Aug 6, 2008
- */
-public enum IdentityTypeEnum implements IdentityType
-{
- IDENTITY, GROUP;
-
- public List<IdentityAttribute> getAttributes()
- {
- return null;
- }
-
- public String getName()
- {
- return null;
- }
-
- public void validatePolicy() throws PolicyValidationException
- {
- }
-}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/attribute/PasswordAttribute.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -25,6 +25,7 @@
import org.jboss.identity.model.IdentityAttribute;
import org.jboss.identity.model.IdentityType;
+import org.jboss.identity.model.IdentityObject;
import org.jboss.identity.model.policy.PasswordExpirationPolicy;
/**
@@ -32,7 +33,7 @@
* @author Anil.Saldhana(a)redhat.com
* @since Jul 13, 2008
*/
-public class PasswordAttribute<T extends IdentityType>
+public class PasswordAttribute<T extends IdentityObject>
implements IdentityAttribute
{
/**
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/groups/Group.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -27,16 +27,17 @@
import java.util.Collection;
import java.util.List;
-import org.jboss.identity.model.IdentityType;
-import org.jboss.identity.model.Role;
+import org.jboss.identity.model.roles.Role;
+import org.jboss.identity.model.IdentityObject;
import org.jboss.identity.model.policy.RelationshipPolicy;
/**
* Represents a Group
* @author Anil.Saldhana(a)redhat.com
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
* @since Jul 9, 2008
*/
-public interface Group extends IdentityType
+public interface Group extends IdentityObject
{
/**
* <p>Get the name</p>
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/groups/GroupType.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -21,16 +21,15 @@
*/
package org.jboss.identity.model.groups;
+import org.jboss.identity.model.IdentityType;
+
/**
* Type of Group
* @author Anil.Saldhana(a)redhat.com
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw Dawidowicz</a>
* @since Jul 11, 2008
*/
-public interface GroupType
+public interface GroupType extends IdentityType
{
- /**
- * Get the name of the type of group
- * @return
- */
- String getName();
+
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/policy/PasswordExpirationPolicy.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/policy/PasswordExpirationPolicy.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/policy/PasswordExpirationPolicy.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -21,14 +21,14 @@
*/
package org.jboss.identity.model.policy;
-import org.jboss.identity.model.IdentityType;
+import org.jboss.identity.model.IdentityObject;
/**
* Policy to govern Passwords
* @author Anil.Saldhana(a)redhat.com
* @since Jul 13, 2008
*/
-public interface PasswordExpirationPolicy<P extends IdentityType>
+public interface PasswordExpirationPolicy<P extends IdentityObject>
extends IdentityTypePolicy
{
}
\ No newline at end of file
Modified: trunk/identity-model/src/main/java/org/jboss/identity/model/policy/RelationshipPolicy.java
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/policy/RelationshipPolicy.java 2008-09-02 17:36:05 UTC (rev 52)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/policy/RelationshipPolicy.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -21,14 +21,14 @@
*/
package org.jboss.identity.model.policy;
-import org.jboss.identity.model.IdentityType;
+import org.jboss.identity.model.IdentityObject;
/**
* A Policy that governs the Relationships
* @author Anil.Saldhana(a)redhat.com
* @since Jul 13, 2008
*/
-public interface RelationshipPolicy<P extends IdentityType, Q extends IdentityType>
+public interface RelationshipPolicy<P extends IdentityObject, Q extends IdentityObject>
extends IdentityTypePolicy
{
/**
Copied: trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java (from rev 46, trunk/identity-model/src/main/java/org/jboss/identity/model/Role.java)
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java (rev 0)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/roles/Role.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.model.roles;
+
+import org.jboss.identity.model.IdentityObject;
+import org.jboss.identity.model.roles.RoleType;
+
+/**
+ * Marker Interface represents a role
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jun 30, 2008
+ */
+public interface Role extends IdentityObject
+{
+ /**
+ * Get the type of role
+ * @return
+ */
+ RoleType getRoleType();
+}
\ No newline at end of file
Copied: trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java (from rev 46, trunk/identity-model/src/main/java/org/jboss/identity/model/RoleType.java)
===================================================================
--- trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java (rev 0)
+++ trunk/identity-model/src/main/java/org/jboss/identity/model/roles/RoleType.java 2008-09-02 17:53:24 UTC (rev 53)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.model.roles;
+
+import org.jboss.identity.model.IdentityType;
+
+/**
+ * Type of Role
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Jun 30, 2008
+ */
+public enum RoleType implements IdentityType
+{
+
+ /**
+ * Plain Role
+ */
+ REGULAR,
+ /**
+ * A role that is nested within another
+ */
+ NESTED,
+ /**
+ * A role that is part of an hierarchy
+ * (Eg. LDAP Role)
+ */
+ HIERARCHICAL,
+ /**
+ * Custom Role
+ */
+ CUSTOM;
+
+
+ public String getName()
+ {
+ return this.name();
+ }
+}
\ No newline at end of file
15 years, 9 months
JBoss Identity SVN: r52 - tags/initialProposal.
by jboss-identity-commits@lists.jboss.org
Author: bdaw
Date: 2008-09-02 13:36:05 -0400 (Tue, 02 Sep 2008)
New Revision: 52
Added:
tags/initialProposal/assembly/
tags/initialProposal/identity-api/
tags/initialProposal/identity-impl/
tags/initialProposal/identity-model/
tags/initialProposal/parent/
tags/initialProposal/pom.xml
Log:
cleanup
Copied: tags/initialProposal/assembly (from rev 50, tags/initialProposal/trunk/assembly)
Copied: tags/initialProposal/identity-api (from rev 50, tags/initialProposal/trunk/identity-api)
Copied: tags/initialProposal/identity-impl (from rev 50, tags/initialProposal/trunk/identity-impl)
Copied: tags/initialProposal/identity-model (from rev 50, tags/initialProposal/trunk/identity-model)
Copied: tags/initialProposal/parent (from rev 50, tags/initialProposal/trunk/parent)
Copied: tags/initialProposal/pom.xml (from rev 50, tags/initialProposal/trunk/pom.xml)
===================================================================
--- tags/initialProposal/pom.xml (rev 0)
+++ tags/initialProposal/pom.xml 2008-09-02 17:36:05 UTC (rev 52)
@@ -0,0 +1,23 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>jboss-identity-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.identity</groupId>
+ <artifactId>jboss-identity-pom</artifactId>
+ <packaging>pom</packaging>
+ <name>JBoss Identity - Aggregator</name>
+ <url>http://labs.jboss.org/portal/jbosssecurity/</url>
+ <description>JBoss Identity is the identity project for JEMS projects</description>
+
+ <modules>
+ <module>parent</module>
+ <module>identity-model</module>
+ <module>identity-api</module>
+ <module>identity-impl</module>
+ <module>assembly</module>
+ </modules>
+</project>
15 years, 9 months