Author: bdaw
Date: 2008-06-04 14:59:16 -0400 (Wed, 04 Jun 2008)
New Revision: 10923
Added:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/RelationshipType.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/IdentityRepository.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/Relationship.java
Removed:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/Relation.java
Modified:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/Group.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/IdentityModule.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/User.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/GroupEntity.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/IdentityStore.java
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/UserEntity.java
Log:
some refactorings
Modified:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/Group.java
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/Group.java 2008-06-04
18:41:14 UTC (rev 10922)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/Group.java 2008-06-04
18:59:16 UTC (rev 10923)
@@ -25,6 +25,7 @@
import java.util.Map;
import java.util.Set;
+import java.util.Collection;
/**
*
@@ -56,12 +57,11 @@
/**
* Update user attribute values
- * @param group
* @param attrName
* @param values
* @return
*/
- public boolean updateAttribute(Group group, String attrName, String[] values);
+ public boolean updateAttribute(String attrName, String[] values);
/**
* @return id of parent group for the relations of RelationType.HIERARCHICAL. If the
parent id is null, this object
@@ -84,13 +84,13 @@
* @return set of groups that have given relation type with this group and the
direction of the relation is towords
* this group
*/
- public Set<Group> getGroups(RelationType type);
+ public Set<Group> getGroups(RelationshipType type);
/**
* @param group
- * @return returns a relation type between this and given group.
+ * @return returns a relationship type between this and given group.
*/
- public RelationType getRelation(Group group);
+ public RelationshipType getRelationship(Group group);
/**
* Assign a set of groups to this group. All other group associations (with this
relation type) for this group
@@ -99,7 +99,7 @@
* @param type
* @return
*/
- public boolean assignGroups(Set<Group> toGroups, RelationType type);
+ public boolean assignGroups(Set<Group> toGroups, RelationshipType type);
/**
* Assign a set of users to this group. All other user associations will be
overwritten for this group
Modified:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/IdentityModule.java
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/IdentityModule.java 2008-06-04
18:41:14 UTC (rev 10922)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/IdentityModule.java 2008-06-04
18:59:16 UTC (rev 10923)
@@ -25,6 +25,7 @@
import java.util.Map;
import java.util.Set;
+import java.util.Collection;
/**
* IdentityModule exposes operations to creat/destroy/find users and roles. Methods to
manipulate those objects and
Copied:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/RelationshipType.java
(from rev 10922,
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/RelationType.java)
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/RelationshipType.java
(rev 0)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/RelationshipType.java 2008-06-04
18:59:16 UTC (rev 10923)
@@ -0,0 +1,35 @@
+/*
+* 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.identity2.api;
+
+/**
+ * Relationship between two groups
+ */
+public enum RelationshipType
+{
+ // Tree like hierarchy (parent -> children)
+ HIERARCHICAL,
+
+ // Implied
+ IMPLIED
+}
Modified:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/User.java
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/User.java 2008-06-04
18:41:14 UTC (rev 10922)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/api/User.java 2008-06-04
18:59:16 UTC (rev 10923)
@@ -24,6 +24,7 @@
import java.util.Map;
import java.util.Set;
+import java.util.Collection;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
@@ -49,12 +50,11 @@
/**
* Update user attribute values
- * @param user
* @param attrName
* @param values
* @return
*/
- public boolean updateAttribute(User user, String attrName, String[] values);
+ public boolean updateAttribute(String attrName, String[] values);
/**
* @return a set of groups that this user belongs to
Modified:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/GroupEntity.java
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/GroupEntity.java 2008-06-04
18:41:14 UTC (rev 10922)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/GroupEntity.java 2008-06-04
18:59:16 UTC (rev 10923)
@@ -26,6 +26,8 @@
import java.util.List;
import java.util.Map;
+import java.util.Set;
+import java.util.Collection;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
@@ -33,20 +35,20 @@
*/
public interface GroupEntity
{
- public Object getId();
+ Object getId();
- public String getName();
+ String getName();
- public GroupType getType();
+ GroupType getType();
- public Map<String, String[]> getAttributes();
+ Map<String, String[]> getAttributes();
- public Object getParentId();
+ Object getParentId();
- public List<Relation> getFromRelations();
+ Collection<Relationship> getFromRelations();
- public List<Relation> getToRelations();
+ Collection<Relationship> getToRelations();
- public List<UserEntity> getUserEntities();
+ Collection<UserEntity> getUserEntities();
}
Copied:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/IdentityRepository.java
(from rev 10922,
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/IdentityService.java)
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/IdentityRepository.java
(rev 0)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/IdentityRepository.java 2008-06-04
18:59:16 UTC (rev 10923)
@@ -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.portal.identity2.spi;
+
+import java.util.Set;
+
+/**
+ * IdentityRepositoryexposes identity object management operations and act as an entry
point to the 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 IdentityRepository
+{
+ Set<IdentityStore> getConfiguredIdentityStores();
+}
Modified:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/IdentityStore.java
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/IdentityStore.java 2008-06-04
18:41:14 UTC (rev 10922)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/IdentityStore.java 2008-06-04
18:59:16 UTC (rev 10923)
@@ -35,11 +35,11 @@
public interface IdentityStore
{
- public String getIdentityStoreId();
+ String getIdentityStoreId();
- public Set<GroupType> getSupportedGroupTypes();
+ Set<GroupType> getSupportedGroupTypes();
- public boolean isUserStore();
+ boolean isUserStore();
// TODO: Set of needed methods
Deleted:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/Relation.java
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/Relation.java 2008-06-04
18:41:14 UTC (rev 10922)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/Relation.java 2008-06-04
18:59:16 UTC (rev 10923)
@@ -1,39 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.jboss.portal.identity2.spi;
-
-import org.jboss.portal.identity2.api.RelationType;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
- * @version : 0.1 $
- */
-public interface Relation
-{
- public GroupEntity getFrom();
-
- public GroupEntity getTo();
-
- public RelationType getType();
-
-}
Copied:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/Relationship.java
(from rev 10922,
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/Relation.java)
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/Relationship.java
(rev 0)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/Relationship.java 2008-06-04
18:59:16 UTC (rev 10923)
@@ -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.portal.identity2.spi;
+
+import org.jboss.portal.identity2.api.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();
+
+}
Modified:
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/UserEntity.java
===================================================================
---
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/UserEntity.java 2008-06-04
18:41:14 UTC (rev 10922)
+++
modules/identity/trunk/identity/src/main/java/org/jboss/portal/identity2/spi/UserEntity.java 2008-06-04
18:59:16 UTC (rev 10923)
@@ -24,6 +24,7 @@
import java.util.List;
import java.util.Map;
+import java.util.Collection;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
@@ -32,12 +33,12 @@
public interface UserEntity
{
- public Object getId();
+ Object getId();
- public String getUserName();
+ String getUserName();
- public Map<String, String[]> getAttributes();
+ Map<String, String[]> getAttributes();
- public List<GroupEntity> getGroupEntities();
+ Collection<GroupEntity> getGroupEntities();
}