From jboss-identity-commits at lists.jboss.org Thu Jul 10 15:52:22 2008 Content-Type: multipart/mixed; boundary="===============0315269218146744892==" MIME-Version: 1.0 From: jboss-identity-commits at lists.jboss.org To: jboss-identity-commits at lists.jboss.org Subject: [jboss-identity-commits] JBoss Identity SVN: r22 - in trunk/identity-api/src/main/java/org/jboss/identity/api: event and 3 other directories. Date: Thu, 10 Jul 2008 15:52:21 -0400 Message-ID: --===============0315269218146744892== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: anil.saldhana(a)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/Persist= enceManager.java trunk/identity-api/src/main/java/org/jboss/identity/api/store/ trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesDe= scription.java trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentitySt= ore.java trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentitySt= oreRepository.java trunk/identity-api/src/main/java/org/jboss/identity/api/store/OperationT= ype.java Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/event/IdentityEv= ent.java trunk/identity-api/src/main/java/org/jboss/identity/api/managers/Relatio= nshipManager.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/Ide= ntityEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity-api/src/main/java/org/jboss/identity/api/event/IdentityE= vent.java 2008-07-10 19:51:41 UTC (rev 21) +++ trunk/identity-api/src/main/java/org/jboss/identity/api/event/IdentityE= vent.java 2008-07-10 19:52:21 UTC (rev 22) @@ -23,7 +23,7 @@ package org.jboss.identity.api.event; = /** - * @author Boleslaw Dawidowicz + * @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/Per= sistenceManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity-api/src/main/java/org/jboss/identity/api/managers/Persis= tenceManager.java (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/Persis= tenceManager.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(a)redhat.com + * @since Jul 10, 2008 + */ +public interface PersistenceManager +{ + /** + * Return the IdentityStoreRepository configured + * @return + */ + IdentityStoreRepository getIdentityStoreRepository(); + = + /** + *

Get the Identity Store configured for a realm

+ *

May be Null in which case you have to search on + * the identity type

+ * @param realm + * @return + */ + IdentityStore getIdentityStore(Realm realm); + = + /** + *

Get the Identity Store configured for an identity type + * at the realm level

+ * @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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity-api/src/main/java/org/jboss/identity/api/managers/Relati= onshipManager.java 2008-07-10 19:51:41 UTC (rev 21) +++ trunk/identity-api/src/main/java/org/jboss/identity/api/managers/Relati= onshipManager.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.PersistenceManagerNotFoundExceptio= n; import org.jboss.identity.api.exception.SessionNotOpenException; import org.jboss.identity.model.Identity; import org.jboss.identity.model.Role; @@ -35,7 +36,7 @@ *

Manages the relationships between * roles, groups, identities and realms

* @author Anil.Saldhana(a)redhat.com - * @author Boleslaw Dawidowicz + * @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 relationshi= pType) - throws SessionNotOpenException; + throws PersistenceManagerNotFoundException,SessionNotOpenException; = /** *

Associate a relationship between two realms

* @param realmA * @param realmB * @param relationshipType + * @throws PersistenceManagerNotFoundException PM not set * @throws SessionNotOpenException session is not open */ void associate(Realm realmA, Realm realmB, RelationshipType relationshi= pType) - throws SessionNotOpenException; + throws PersistenceManagerNotFoundException,SessionNotOpenException; = /** *

Associate a role with an Identity

* @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; = /** *

Associate a list of roles with an Identity

* @param realm * @param identity * @param aRoleList + * @throws PersistenceManagerNotFoundException PM not set * @throws SessionNotOpenException session is not open */ void associate(Realm realm, Identity identity, List aRoleList) - throws SessionNotOpenException; + throws PersistenceManagerNotFoundException,SessionNotOpenException; = /** *

Associate a group with an identity

* @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; = /** *

Associate a set of groups with an identity

* @param realm * @param identity * @param aGroupSet + * @throws PersistenceManagerNotFoundException PM not set * @throws SessionNotOpenException session is not open */ void associate(Realm realm,Identity identity, Set aGroupSet) - throws SessionNotOpenException; + throws PersistenceManagerNotFoundException,SessionNotOpenException; = /** *

Disassociate a relationship between two groups

* @param groupA * @param groupB * @param relationshipType + * @throws PersistenceManagerNotFoundException PM not set * @throws SessionNotOpenException session is not open */ void disassociate(Group groupA, Group groupB, RelationshipType relation= shipType) - throws SessionNotOpenException; + throws PersistenceManagerNotFoundException,SessionNotOpenException; = /** *

Disassociate a relationship between two realms

* @param realmA * @param realmB * @param relationshipType + * @throws PersistenceManagerNotFoundException PM not set * @throws SessionNotOpenException session is not open */ void disassociate(Realm realmA, Realm realmB, RelationshipType relation= shipType) - throws SessionNotOpenException; + throws PersistenceManagerNotFoundException,SessionNotOpenException; = /** *

Disassociate a role with an Identity

* @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; = /** *

Disassociate a list of roles with an Identity

* @param realm * @param identity * @param aRoleList + * @throws PersistenceManagerNotFoundException PM not set * @throws SessionNotOpenException session is not open */ void disassociate(Realm realm, Identity identity, List aRoleList) - throws SessionNotOpenException; + throws PersistenceManagerNotFoundException,SessionNotOpenException; = /** *

Disassociate a group with an identity

* @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; = /** *

Disassociate a set of groups with an identity

* @param realm * @param identity * @param aGroupSet + * @throws PersistenceManagerNotFoundException PM not set * @throws SessionNotOpenException session is not open */ void disassociate(Realm realm,Identity identity, Set 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); + = + /** + *

Return the configured PersistenceManager

+ * @return + */ + PersistenceManager getPersistenceManager(); + = + /** + *

Set the PersistenceManager

+ * @param persistenceManager + */ + void setPersistenceManager(PersistenceManager persistenceManager); } \ No newline at end of file Modified: trunk/identity-api/src/main/java/org/jboss/identity/api/session/S= ession.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 @@ = /** *

An Identity Session

- * @author Boleslaw Dawidowicz + * @author boleslaw dot dawidowicz at redhat anotherdot com * @author Anil.Saldhana(a)redhat.com * @since Jul 10, 2008 */ Added: trunk/identity-api/src/main/java/org/jboss/identity/api/store/Featur= esDescription.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesD= escription.java (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/FeaturesD= escription.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(a)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 getSupportedOperations(IdentityType identityT= ype) = + 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 IdentityTypeNotSupportedExcepti= on; + + = + /** + * @param operationType + * @return set of identity types that can be processed with a given ope= ration + * @throws org.jboss.idm.exceptions.IdmException + */ + public Set getSupportedIdentities(OperationType operation= Type); + + /** + * @return set of identity types that can be persisted + */ + Set getSupportedIdentities(); + + /** + * @param identityType + * @return boolean describing if given identity type can be persisted o= r 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 toT= ype, = + RelationshipType relationshipType) = + throws IdentityException; +} \ No newline at end of file Added: trunk/identity-api/src/main/java/org/jboss/identity/api/store/Identi= tyStore.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityS= tore.java (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityS= tore.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(a)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 IdentityExcept= ion; + + /** + * 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 findIdentities(IdentityType identityType, + int offset, int limit, + String orderedByAttributeName, = + boolean ascending) throws IdentityE= xception; + + /** + * Find identities with a given attributes values. If the paginatedSear= ch 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 findIdentities(IdentityType identityType, Map attributes, + int offset, int limit, + String orderedByAttributeName, bool= ean ascending) throws IdentityException; + + /** + * Find identites that have relationship with given identity. Relations= hips 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 t= he 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 findIdentities(Identity identity, = + RelationshipType relationshipType, = + boolean parent, + int offset, int limit, + String orderedByAttributeName, = + boolean ascending) throws IdentityE= xception; + + /** + * @param identityType + * @return names of supported attributes + * @throws IdentityException + */ + Set getSupportedAttributeNames(IdentityType identityType) = + throws IdentityException; + + /** + * Get attributes for the given identity + * + * @param identity + * @return + * @throws IdentityException + */ + Map getAttributes(Identity identity) throws IdentityE= xception; + + /** + * Update attributes with new values - previous values will be overwrit= ten + * @param identity + * @param attributes + * @throws IdentityException + */ + void updateAttributes(Identity identity, Map attribut= es) 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 attributes)= throws IdentityException; + + /** + * Remove attributes + * + * @param identity + * @param attributes + */ + void removeAttributes(Identity identity, Set 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, Rel= ationshipType relationshipType) throws IdentityException; + + /** + * Remove relationship between identities. Relationships can be directi= onal so order of parameters matters = + * + * @param fromIdentity + * @param toIdentity + * @param relationshipType + * @throws IdentityException + */ + void removeRelationship(Identity fromIdentity, Identity toIdentity, Rel= ationshipType relationshipType) throws IdentityException; + + /** + * Remove all relationships between identities. Direction of relationsh= ips 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 resolveRelationships(Identity fromIdentity, Ident= ity toIdentity) throws IdentityException; + +} \ No newline at end of file Added: trunk/identity-api/src/main/java/org/jboss/identity/api/store/Identi= tyStoreRepository.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityS= toreRepository.java (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/IdentityS= toreRepository.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 relation= s = + * sbetween them across different identity stores. + * @author boleslaw dot dawidowicz at redhat anotherdot com + * @author Anil.Saldhana(a)redhat.com + * @since Jul 10, 2008 + */ +public interface IdentityStoreRepository +{ + /** + * @return a set of configured identity stores + */ + Set getConfiguredIdentityStores(); + + /** + * @return mapping of IdentityType to the specific idenity store + */ + Map 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/Operat= ionType.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/identity-api/src/main/java/org/jboss/identity/api/store/Operation= Type.java (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api/store/Operation= Type.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(a)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 --===============0315269218146744892==--