[jboss-identity-commits] JBoss Identity SVN: r22 - in trunk/identity-api/src/main/java/org/jboss/identity/api: event and 3 other directories.

jboss-identity-commits at lists.jboss.org jboss-identity-commits at lists.jboss.org
Thu Jul 10 15:52:21 EDT 2008


Author: anil.saldhana at jboss.com
Date: 2008-07-10 15:52:21 -0400 (Thu, 10 Jul 2008)
New Revision: 22

Added:
   trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java
   trunk/identity-api/src/main/java/org/jboss/identity/api/store/
   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-api/src/main/java/org/jboss/identity/api/store/OperationType.java
Modified:
   trunk/identity-api/src/main/java/org/jboss/identity/api/event/IdentityEvent.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
Log:
JBID-8: Identity Store

Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/event/IdentityEvent.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/event/IdentityEvent.java	2008-07-10 19:51:41 UTC (rev 21)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/event/IdentityEvent.java	2008-07-10 19:52:21 UTC (rev 22)
@@ -23,7 +23,7 @@
 package org.jboss.identity.api.event;
 
 /**
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
  * @version : 0.1 $
  */
 public class IdentityEvent

Added: 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	                        (rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/PersistenceManager.java	2008-07-10 19:52:21 UTC (rev 22)
@@ -0,0 +1,59 @@
+/*
+ * 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 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;
+
+/**
+ * Manages the Identity Stores
+ * @author Anil.Saldhana at redhat.com
+ * @since Jul 10, 2008
+ */
+public interface PersistenceManager
+{
+   /**
+    * Return the IdentityStoreRepository configured
+    * @return
+    */
+   IdentityStoreRepository getIdentityStoreRepository();
+   
+   /**
+    * <p>Get the Identity Store configured for a realm</p>
+    * <p>May be Null in which case you have to search on
+    * the identity type</p>
+    * @param realm
+    * @return
+    */
+   IdentityStore getIdentityStore(Realm realm);
+   
+   /**
+    * <p>Get the Identity Store configured for an identity type
+    * at the realm level </p>
+    * @param realm
+    * @param identityType
+    * @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-07-10 19:51:41 UTC (rev 21)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/RelationshipManager.java	2008-07-10 19:52:21 UTC (rev 22)
@@ -24,6 +24,7 @@
 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.Role;
@@ -35,7 +36,7 @@
  * <p>Manages the relationships between
  * roles, groups, identities and realms</p>
  * @author Anil.Saldhana at redhat.com
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
  * @since Jul 10, 2008
  */
 public interface RelationshipManager
@@ -45,120 +46,132 @@
     * @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 SessionNotOpenException;
+   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 SessionNotOpenException;
+   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)
-   throws SessionNotOpenException;
+   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)
-   throws SessionNotOpenException;
+   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)
-   throws SessionNotOpenException;
+   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)
-   throws SessionNotOpenException;
+   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 SessionNotOpenException;
+   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 SessionNotOpenException;
+   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)
-   throws SessionNotOpenException;
+   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)
-   throws SessionNotOpenException;
+   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)
-   throws SessionNotOpenException;
+   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)
-   throws SessionNotOpenException;
+   throws PersistenceManagerNotFoundException,SessionNotOpenException;
   
    /**
     * @param fromGroup
@@ -173,4 +186,16 @@
     * @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-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-07-10 19:51:41 UTC (rev 21)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/session/Session.java	2008-07-10 19:52:21 UTC (rev 22)
@@ -25,7 +25,7 @@
 
 /**
  * <p>An Identity Session</p>
- * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
  * @author Anil.Saldhana at redhat.com
  * @since Jul 10, 2008
  */

Added: 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	                        (rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDescription.java	2008-07-10 19:52:21 UTC (rev 22)
@@ -0,0 +1,86 @@
+/*
+ * 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.store;
+
+import java.util.Set;
+
+import org.jboss.identity.api.exception.IdentityException;
+import org.jboss.identity.api.exception.IdentityTypeNotSupportedException;
+import org.jboss.identity.model.IdentityType;
+import org.jboss.identity.model.relation.RelationshipType;
+
+/**
+ * Describe the features supported by an Identity Store
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
+ * @author Anil.Saldhana at redhat.com
+ * @since Jul 10, 2008
+ */
+public interface FeaturesDescription
+{
+   /**
+    * Get the supported operations
+    * @param identityType a type representing identity, role, group
+    * @return supported operations for given identity type
+    * @throws IdentityTypeNotSupportedException
+    */
+   public Set<OperationType> getSupportedOperations(IdentityType identityType) 
+   throws IdentityTypeNotSupportedException;
+
+   /**
+    * @param operationType
+    * @param identityType
+    * @return if given operation on given identity type is supported
+    * @throws IdentityTypeNotSupportedException
+    */
+   boolean isOperationSupported(OperationType 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(OperationType 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 IdentityException
+    */
+   boolean isRelationshipSupported(IdentityType fromType, IdentityType toType, 
+         RelationshipType relationshipType)  
+   throws IdentityException;
+}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStore.java	2008-07-10 19:52:21 UTC (rev 22)
@@ -0,0 +1,238 @@
+/*
+ * 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.store;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.identity.api.exception.IdentityException;
+import org.jboss.identity.model.Identity;
+import org.jboss.identity.model.IdentityType;
+import org.jboss.identity.model.relation.RelationshipType;
+
+/**
+ * Represents an Identity Store
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
+ * @author Anil.Saldhana at redhat.com
+ * @since Jul 10, 2008
+ */
+public interface IdentityStore
+{
+   /**
+    * @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 IdentityException
+    */
+   Identity createIdentity(String name) throws IdentityException;
+
+   /**
+    * Remove given identity
+    *
+    * @param identity
+    * @throws IdentityException
+    */
+   void removeIdentity(Identity identity) throws IdentityException;
+
+   /**
+    * @param identityType
+    * @return a number of stored identities with a given type  
+    * @throws IdentityException
+    */
+   int getIdentitiesCount(IdentityType identityType) throws IdentityException;
+
+   /**
+    * Find identity with a given name
+    *
+    * @param name
+    * @return
+    * @throws IdentityException
+    */
+   Identity findIdentity(String name) throws IdentityException;
+
+   /**
+    * Find identity with a given id
+    *
+    * @param id
+    * @return
+    * @throws IdentityException
+    */
+   Identity findIdentity(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
+    */
+   Collection<Identity> findIdentities(IdentityType 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
+    */
+   Collection<Identity> findIdentities(IdentityType 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
+    */
+    Collection<Identity> findIdentities(Identity identity, 
+                                        RelationshipType relationshipType, 
+                                        boolean parent,
+                                        int offset, int limit,
+                                       String orderedByAttributeName, 
+                                       boolean ascending) throws IdentityException;
+
+   /**
+    * @param identityType
+    * @return names of supported attributes
+    * @throws IdentityException
+    */
+   Set<String> getSupportedAttributeNames(IdentityType identityType) 
+   throws IdentityException;
+
+   /**
+    * Get attributes for the given identity
+    *
+    * @param identity
+    * @return
+    * @throws IdentityException
+    */
+   Map<String, String[]> getAttributes(Identity identity) throws IdentityException;
+
+   /**
+    * Update attributes with new values - previous values will be overwritten
+    * @param identity
+    * @param attributes
+    * @throws IdentityException
+    */
+   void updateAttributes(Identity 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 org.jboss.idm.exceptions.IdentityException
+    */
+   void addAttributes(Identity identity, Map<String, String[]> attributes) throws IdentityException;
+
+   /**
+    * Remove attributes
+    *
+    * @param identity
+    * @param attributes
+    */
+   void removeAttributes(Identity identity, Set<String> attributes) throws IdentityException;
+
+   /**
+    * Create directional relationship of a given type between identities
+    *
+    * @param fromIdentity
+    * @param toIdentity
+    * @param relationshipType
+    * @throws IdentityException
+    */
+   void createRelationship(Identity fromIdentity, Identity toIdentity, RelationshipType relationshipType) throws IdentityException;
+
+   /**
+    * Remove relationship between identities. Relationships can be directional so order of parameters matters 
+    *
+    * @param fromIdentity
+    * @param toIdentity
+    * @param relationshipType
+    * @throws IdentityException
+    */
+   void removeRelationship(Identity fromIdentity, Identity toIdentity, RelationshipType 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(Identity identity1, Identity 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(Identity fromIdentity, Identity toIdentity) throws IdentityException;
+
+}
\ No newline at end of file

Added: 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	                        (rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityStoreRepository.java	2008-07-10 19:52:21 UTC (rev 22)
@@ -0,0 +1,55 @@
+/*
+ * 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.store;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.identity.model.IdentityType;
+
+/** 
+ * IdentityStoreRepository exposes identity object management 
+ * operations and act as an entry point to many underlying data stores.
+ * Its responsibility is to map identity objects, their state and relations 
+ * sbetween them across different identity stores.
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
+ * @author Anil.Saldhana at redhat.com
+ * @since Jul 10, 2008
+ */
+public interface IdentityStoreRepository
+{
+   /**
+    * @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: trunk/identity-api/src/main/java/org/jboss/identity/api/store/OperationType.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api/store/OperationType.java	                        (rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/OperationType.java	2008-07-10 19:52:21 UTC (rev 22)
@@ -0,0 +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.identity.api.store;
+
+/**
+ * Operations supported by the Identity Stores
+ * @author boleslaw dot dawidowicz at redhat anotherdot com
+ * @author Anil.Saldhana at redhat.com
+ * @since Jul 10, 2008
+ */
+public enum OperationType 
+{
+   // 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();
+   }
+}
\ No newline at end of file




More information about the jboss-identity-commits mailing list