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