From jboss-identity-commits at lists.jboss.org Sat Sep 20 15:34:04 2008 Content-Type: multipart/mixed; boundary="===============7437725456364075836==" 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: r98 - in trunk/identity-api/src/main/java/org/jboss/identity: api2 and 1 other directory. Date: Sat, 20 Sep 2008 15:34:03 -0400 Message-ID: --===============7437725456364075836== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: bdaw Date: 2008-09-20 15:34:02 -0400 (Sat, 20 Sep 2008) New Revision: 98 Added: trunk/identity-api/src/main/java/org/jboss/identity/api2/ trunk/identity-api/src/main/java/org/jboss/identity/api2/Group.java trunk/identity-api/src/main/java/org/jboss/identity/api2/GroupType.java trunk/identity-api/src/main/java/org/jboss/identity/api2/Identity.java trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentitySession= .java trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentitySession= Factory.java trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentityType.ja= va trunk/identity-api/src/main/java/org/jboss/identity/api2/PersistenceMana= ger.java trunk/identity-api/src/main/java/org/jboss/identity/api2/ProfileManager.= java trunk/identity-api/src/main/java/org/jboss/identity/api2/Realm.java trunk/identity-api/src/main/java/org/jboss/identity/api2/RealmManager.ja= va trunk/identity-api/src/main/java/org/jboss/identity/api2/RelationshipMan= ager.java trunk/identity-api/src/main/java/org/jboss/identity/api2/RelationshipTyp= e.java trunk/identity-api/src/main/java/org/jboss/identity/api2/Role.java trunk/identity-api/src/main/java/org/jboss/identity/api2/RoleType.java trunk/identity-api/src/main/java/org/jboss/identity/api2/SessionState.ja= va trunk/identity-api/src/main/java/org/jboss/identity/api2/Transaction.java Log: - Different approach to the API Copied: trunk/identity-api/src/main/java/org/jboss/identity/api2/Group.java= (from rev 84, trunk/identity-api/src/main/java/org/jboss/identity/api/Grou= p.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/api2/Group.java = (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/Group.java 200= 8-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,47 @@ +/* + * 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.api2; + +/** + * Represents a Group + * @author Anil.Saldhana(a)redhat.com + * @author Boleslaw D= awidowicz + * @since Jul 9, 2008 + */ +public interface Group extends IdentityType +{ + + /** + * @return description + */ + String getDescription(); + + /** + * @return + */ + GroupType getGroupType(); + + +} \ No newline at end of file Copied: trunk/identity-api/src/main/java/org/jboss/identity/api2/GroupType.= java (from rev 84, trunk/identity-api/src/main/java/org/jboss/identity/api/= GroupType.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/api2/GroupType.java= (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/GroupType.java= 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,38 @@ +/* + * 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.api2; + +/** + * Type of Group + * @author Anil.Saldhana(a)redhat.com + * @author Boleslaw D= awidowicz + * @since Jul 11, 2008 + */ +public interface GroupType +{ + + /** + * @return group type name + */ + String getName(); + +} \ No newline at end of file Copied: trunk/identity-api/src/main/java/org/jboss/identity/api2/Identity.j= ava (from rev 84, trunk/identity-api/src/main/java/org/jboss/identity/api/I= dentity.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/api2/Identity.java = (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/Identity.java = 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,38 @@ +/* + * 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.api2; + +/** + * Represents an Identity + * @author Anil.Saldhana(a)redhat.com + * @author Boleslaw D= awidowicz + * @since Jun 30, 2008 + */ +public interface Identity extends IdentityType +{ + /** + * Whether this is a virtual + * identity (such as a pseudonym) + * @return true (virtual identity) + */ + boolean isVirtual(); +} \ No newline at end of file Added: trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentitySes= sion.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/api2/IdentitySessio= n.java (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentitySessio= n.java 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,104 @@ +/* + * 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.api2; + + +import org.jboss.identity.exception.IdentityException; + +import java.util.List; +import java.util.Set; +import java.util.Collection; +import java.util.Map; + +/** + * Expose all identity management operations within a given realm + * + *

An Identity Session

+ * @author boleslaw dot dawidowicz at redhat anotherdot com + * @author Anil.Saldhana(a)redhat.com + * @since Jul 10, 2008 + */ +public interface IdentitySession +{ + + /** + * @return Name of the realm this session is connected to + */ + String getRealmName(); + + /** + * Open the session + * @throws org.jboss.identity.exception.IdentityException + */ + void open() throws IdentityException; + + /** + * Close this session + * @throws org.jboss.identity.exception.IdentityException + */ + void close() throws IdentityException; + + /** + * Save all pending changes + * @throws org.jboss.identity.exception.IdentityException + */ + void save() throws IdentityException; + + /** + * Clear this session + * @throws org.jboss.identity.exception.IdentityException + */ + void clear() throws IdentityException; + + /** + * Check if this session is open + * @return + */ + boolean isOpen(); + + /** + * @return + */ + Transaction beginTransaction(); + + /** + * Transaction instance assosiated with this session + * @return + */ + Transaction getTransaction(); + + /** + * @return + */ + PersistenceManager getPersistenceManager(); + + /** + * @return + */ + RelationshipManager getRelationshipManager(); + + /** + * @return + */ + ProfileManager getProfileManager(); + +} \ No newline at end of file Added: trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentitySes= sionFactory.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/api2/IdentitySessio= nFactory.java (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentitySessio= nFactory.java 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,54 @@ +/* +* 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.api2; + +/** + * @author Boleslaw D= awidowicz + * @version : 0.1 $ + */ +public interface IdentitySessionFactory +{ + /** + * + */ + void close(); + + /** + * @return + */ + boolean isClosed(); + + /** + * Create a Session + * @return + */ + IdentitySession createIdentitySession(String realmName); + + + /** + * Get current open session associated with a realm + * @return + */ + IdentitySession getCurrentIdentitySession(String realmName); + +} Copied: trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentityTy= pe.java (from rev 93, trunk/identity-api/src/main/java/org/jboss/identity/a= pi/IdentityType.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/api2/IdentityType.j= ava (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentityType.j= ava 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,54 @@ +/* +* 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.api2; + +import org.jboss.identity.exception.PolicyValidationException; + + +/** + * Marker Interface representing + * an object of the Identity Model + * @author Anil.Saldhana(a)redhat.com + * @author Boleslaw D= awidowicz + * @since Jul 10, 2008 + */ +public interface IdentityType +{ + + /** + * @return id of this identity object + */ + Object getId(); + + /** + *

Return the name of the identity

+ * @return + */ + String getName(); + + /** + * Validate configured Policies + * @throws org.jboss.identity.exception.PolicyValidationException + */ + void validatePolicy() throws PolicyValidationException; +} \ No newline at end of file Added: trunk/identity-api/src/main/java/org/jboss/identity/api2/Persistence= Manager.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/api2/PersistenceMan= ager.java (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/PersistenceMan= ager.java 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,304 @@ +/* +* 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.api2; + +import org.jboss.identity.exception.IdentityException; + +import java.util.Collection; +import java.util.Map; + +/** + * @author Boleslaw D= awidowicz + * @version : 0.1 $ + */ +public interface PersistenceManager +{ + + /** + * @return Session associated with this object instance + */ + IdentitySession getIdentitySession(); + + // Create + + /** + *

Create an identity in the realm

+ * @param identityName + * @return + */ + Identity createIdentity(String identityName) throws IdentityException; + + /** + * Create a group of a particular type + * @param groupName + * @param groupType + * @return + */ + Group createGroup(String groupName, GroupType groupType) + throws IdentityException; + + /** + *

Create a role in the realm

+ * @param roleName name of role + * @param roleType Type of Role + * @return + */ + Role createRole(String roleName, RoleType roleType) + throws IdentityException; + + // Remove + + /** + * Remove given identity + * + * @param identity + * @throws org.jboss.identity.exception.IdentityException + */ + void removeIdentity(IdentityType identity) throws IdentityException; + + = + // Search + + /** + * @return a number of stored identities with a given type + * @throws org.jboss.identity.exception.IdentityException + */ + int getIdentityTypeCount() + throws IdentityException; + + /** + * @param groupType + * @return a number of stored groups with a given type + * @throws org.jboss.identity.exception.IdentityException + */ + int getGroupTypeCount(GroupType groupType) + throws IdentityException; + + /** + * @param roleType + * @return a number of stored roles with a given type + * @throws org.jboss.identity.exception.IdentityException + */ + int getRoleTypeCount(RoleType roleType) + throws IdentityException; + + = + /** + * Find identity with a given name + * + * @param name + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Identity findIdentity(String name) throws IdentityException; + + /** + * Find identity with a given id + * + * @param id + * @return + * @throws org.jboss.identity.exception.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 offset + * @param limit 0 means unlimited page size + * @param orderedByAttributeName can be null + * @param ascending default true + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Collection findIdentity(int offset, int limit, + String orderedByAttributeName, + boolean ascending) throws IdentityExc= eption; + + /** + * 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 attributes + * @param offset + * @param limit 0 means unlimited page size + * @param orderedByAttributeName can be null + * @param ascending default true + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Collection findIdentity(Map attributes, + int offset, int limit, + String orderedByAttributeName, boolea= n ascending) throws IdentityException; + // Search Roles + + /** + * Find role with a given name + * + * @param name + * @param roleType + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Role findRole(String name, RoleType roleType) throws IdentityException; + + /** + * Find role with a given id + * + * @param id + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Role findRole(Object id) throws IdentityException; + + /** + * Find role 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 roleType + * @param offset + * @param limit 0 means unlimited page size + * @param orderedByAttributeName can be null + * @param ascending default true + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Collection findRole(RoleType roleType, + int offset, int limit, + String orderedByAttributeName, + boolean ascending) throws IdentityException; + + /** + * 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 roleType + * @param attributes + * @param offset + * @param limit 0 means unlimited page size + * @param orderedByAttributeName can be null + * @param ascending default true + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Collection findRole(RoleType roleType, + Map attributes, + int offset, int limit, + String orderedByAttributeName, boolean as= cending) throws IdentityException; + + // Search Groups + + /** + * Find group with a given name + * + * @param name + * @param groupType + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Group findGroup(String name, GroupType groupType) throws IdentityExcept= ion; + + /** + * Find group with a given id + * + * @param id + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Group findGroup(Object id) throws IdentityException; + + /** + * Find group 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 groupType + * @param offset + * @param limit 0 means unlimited page size + * @param orderedByAttributeName can be null + * @param ascending default true + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Collection findRole(GroupType groupType, + int offset, int limit, + String orderedByAttributeName, + boolean ascending) throws IdentityException; + + /** + * Find group 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 groupType + * @param attributes + * @param offset + * @param limit 0 means unlimited page size + * @param orderedByAttributeName can be null + * @param ascending default true + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Collection findGroup(GroupType groupType, + Map attributes, + int offset, int limit, + String orderedByAttributeName, boolean asce= nding) throws IdentityException; + + + + + // Search with relationship types + + /** + * 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 org.jboss.identity.exception.IdentityException + */ + Collection findRelatedIdentityTypes(IdentityType identity, + RelationshipType rela= tionshipType, + boolean parent, + int offset, int limit, + String orderedByAttri= buteName, + boolean ascending) th= rows IdentityException; + +} Added: trunk/identity-api/src/main/java/org/jboss/identity/api2/ProfileMana= ger.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/api2/ProfileManager= .java (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/ProfileManager= .java 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,87 @@ +/* +* 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.api2; + +import org.jboss.identity.exception.IdentityException; + +import java.util.Set; +import java.util.Map; + +/** + * @author Boleslaw D= awidowicz + * @version : 0.1 $ + */ +public interface ProfileManager +{ + + /** + * @return Session associated with this object instance + */ + IdentitySession getIdentitySession(); + + /** + * @param identityType + * @return names of supported attributes + * @throws org.jboss.identity.exception.IdentityException + */ + Set getSupportedAttributeNames(IdentityType identityType) + throws IdentityException; + + /** + * Get attributes for the given identity + * + * @param identity + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Map getAttributes(IdentityType identity) throws Ident= ityException; + + /** + * Update attributes with new values - previous values will be overwrit= ten + * @param identity + * @param attributes + * @throws org.jboss.identity.exception.IdentityException + */ + void updateAttributes(IdentityType identity, Map attr= ibutes) + throws IdentityException; + + /** + * Add new attributes - if attribute with given name already exists the= values + * will be appended + * + * @param identity + * @param attributes + * @throws org.jboss.identity.exception.IdentityException + */ + void addAttributes(IdentityType identity, Map attribu= tes) + throws IdentityException; + + /** + * Remove attributes + * + * @param identity + * @param attributes + */ + void removeAttributes(IdentityType identity, Set attributes) + throws IdentityException; +} Copied: trunk/identity-api/src/main/java/org/jboss/identity/api2/Realm.java= (from rev 84, trunk/identity-api/src/main/java/org/jboss/identity/api/doma= in/Realm.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/api2/Realm.java = (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/Realm.java 200= 8-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,37 @@ +/* + * 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.api2; + +/** + *

The realm under which the various models and policies + * are applicable.

+ * @author Anil.Saldhana(a)redhat.com + * @since Jul 9, 2008 + */ +public interface Realm +{ + + /** + * @return name + */ + String getName(); +} \ No newline at end of file Added: trunk/identity-api/src/main/java/org/jboss/identity/api2/RealmManage= r.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/api2/RealmManager.j= ava (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/RealmManager.j= ava 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,95 @@ +/* +* 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.api2; + +import org.jboss.identity.exception.IdentityException; +import org.jboss.identity.api.exception.PersistenceManagerNotFoundExceptio= n; +import org.jboss.identity.api.exception.SessionNotOpenException; + +import java.io.InputStream; + +/** + * All operations connected with realms. Because operations on realms are = not often there is no transaction support. + * + * @author Boleslaw D= awidowicz + * @version : 0.1 $ + */ +public interface RealmManager +{ + + + /** + *

Create a Realm or return an already + * created realm. Bootstrapping includes generating + * the models in the realm

+ * @param realmName + * @return + */ + Realm bootstrap(String realmName); + + /** + *

Bootstrap a realm given a configuration

+ * @param realmName + * @param config + * @return + */ + Realm bootstrap(String realmName, InputStream config); + + /** + *

Associate a relationship between two realms

+ * @param realmA + * @param realmB + * @param relationshipType + * @throws org.jboss.identity.api.exception.PersistenceManagerNotFoundE= xception PM not set + * @throws org.jboss.identity.api.exception.SessionNotOpenException ses= sion is not open + */ + void associate(Realm realmA, Realm realmB, RelationshipType relationshi= pType) + 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 PersistenceManagerNotFoundException,SessionNotOpenException; + + /** + * @param fromRealm + * @param toRealm + * @return returns a relationship type between this and given Realm. + */ + RelationshipType getRelationship(Realm fromRealm, Realm toRealm); + + /** + *

Return a realm

+ * @param realmName + * @param shouldBootstrap Should we bootstrap if a realm does not exist? + * @return + */ + Realm getRealm(String realmName, boolean shouldBootstrap); + +} Added: trunk/identity-api/src/main/java/org/jboss/identity/api2/Relationshi= pManager.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/api2/RelationshipMa= nager.java (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/RelationshipMa= nager.java 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,227 @@ +/* +* 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.api2; + +import org.jboss.identity.exception.IdentityException; + +import java.util.List; +import java.util.Set; + +/** + * @author Boleslaw D= awidowicz + * @version : 0.1 $ + */ +public interface RelationshipManager +{ + + /** + * @return Session associated with this object instance + */ + IdentitySession getIdentitySession(); + + = + = + + /** + *

Associate a relationship between two groups

+ * @param groupA + * @param groupB + * @param relationshipType + * @throws org.jboss.identity.exception.IdentityException + */ + void associate(Group groupA, Group groupB, RelationshipType relationshi= pType) + throws IdentityException; + + /** + * Associate a relationship between one group and a list of other groups + * @param groupA + * @param groupB a list of groups which are related to groupA + * @param relationshipType + * @throws org.jboss.identity.exception.IdentityException + */ + void associate(Group groupA, List groupB, RelationshipType relat= ionshipType) + throws IdentityException; + + + + /** + *

Associate a role with an Identity

+ * @param identity + * @param aRole + * @throws org.jboss.identity.exception.IdentityException + */ + void associate(Identity identity, Role aRole) + throws IdentityException; + + /** + *

Associate a list of roles with an Identity

+ * @param identity + * @param aRoleList + * @throws org.jboss.identity.exception.IdentityException + */ + void associate(Identity identity, List aRoleList) + throws IdentityException; + + /** + *

Associate a group with an identity

+ * @param identity + * @param aGroup + * @throws org.jboss.identity.exception.IdentityException + */ + void associate(Identity identity, Group aGroup) + throws IdentityException; + + /** + *

Associate a set of groups with an identity

+ * @param identity + * @param aGroupSet + * @throws org.jboss.identity.exception.IdentityException + */ + void associate(Identity identity, Set aGroupSet) + throws IdentityException; + + /** + *

Disassociate a relationship between two groups

+ * @param groupA + * @param groupB + * @param relationshipType + * @throws org.jboss.identity.exception.IdentityException + */ + void disassociate(Group groupA, Group groupB, RelationshipType relation= shipType) + throws IdentityException; + + /** + * Disassociate a relationship between one group and a list of other gr= oups + * @param groupA + * @param groupB + * @param relationshipType + * @throws org.jboss.identity.exception.IdentityException + */ + void disassociate(Group groupA, List groupB, RelationshipType re= lationshipType) + throws IdentityException; + + + + /** + *

Disassociate a role with an Identity

+ * @param identity + * @param aRole + * @throws org.jboss.identity.exception.IdentityException + */ + void disassociate(Identity identity, Role aRole) + throws IdentityException; + + /** + *

Disassociate a list of roles with an Identity

+ * @param identity + * @param aRoleList + * @throws org.jboss.identity.exception.IdentityException + */ + void disassociate(Identity identity, List aRoleList) + throws IdentityException; + + /** + *

Disassociate a group with an identity

+ * @param identity + * @param aGroup + * @throws org.jboss.identity.exception.IdentityException + */ + void disassociate(Identity identity, Group aGroup) + throws IdentityException; + + /** + *

Disassociate a set of groups with an identity

+ * @param identity + * @param aGroupSet + * @throws org.jboss.identity.api.exception.PersistenceManagerNotFoundE= xception PM not set + * @throws org.jboss.identity.api.exception.SessionNotOpenException ses= sion is not open + */ + void disassociate(Identity identity, Set aGroupSet) + throws IdentityException; + + /** + * @param fromGroup + * @param toGroup + * @return returns a relationship type between this and given group. + */ + RelationshipType getRelationship(Group fromGroup, Group toGroup); + + // Relationship - abstract methods + + /** + * Create directional relationship of a given type between identities + * + * @param fromIdentity + * @param toIdentity + * @param relationshipType + * @throws org.jboss.identity.exception.IdentityException + */ + void createRelationship(IdentityType fromI= dentity, + IdentityType toIdentity, + R relationshipType) throws IdentityException; + + /** + * Remove relationship between identities. Relationships can be directi= onal so + * order of parameters matters + * + * @param fromIdentity + * @param toIdentity + * @param relationshipType + * @throws org.jboss.identity.exception.IdentityException + */ + void removeRelationship(IdentityType fromI= dentity, + IdentityType toIdentity, + R 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 org.jboss.identity.exception.IdentityException + */ + void removeRelationships(IdentityType identity1, IdentityType identity2) + throws IdentityException; + + /** + * Resolve relationship types between two identities. Relationships can= be directional + * so order of parameters matters + * + * @param fromIdentity + * @param toIdentity + * @return + * @throws org.jboss.identity.exception.IdentityException + */ + Set resolveRelationships(IdentityType fromIdentity, I= dentityType toIdentity) + throws IdentityException; + + /** + * @param fromRealm + * @param toRealm + * @return returns a relationship type between this and given Realm. + */ + RelationshipType getRelationship(Realm fromRealm, Realm toRealm); +} + Copied: trunk/identity-api/src/main/java/org/jboss/identity/api2/Relationsh= ipType.java (from rev 84, trunk/identity-api/src/main/java/org/jboss/identi= ty/api/RelationshipType.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/api2/RelationshipTy= pe.java (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/RelationshipTy= pe.java 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,34 @@ +/* +* JBoss, a division of Red Hat +* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as = indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ + +package org.jboss.identity.api2; + +/** + * Defines a relationship between groups, domains etc + * @author Anil.Saldhana(a)redhat.com + * @author Boleslaw D= awidowicz + * @since Jul 9, 2008 + */ +public interface RelationshipType +{ + String getName(); +} \ No newline at end of file Copied: trunk/identity-api/src/main/java/org/jboss/identity/api2/Role.java = (from rev 84, trunk/identity-api/src/main/java/org/jboss/identity/api/Role.= 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/api2/Role.java = (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/Role.java 2008= -09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,44 @@ +/* + * 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.api2; + + +/** + * Marker Interface represents a role + * @author Anil.Saldhana(a)redhat.com + * @author Boleslaw D= awidowicz + * @since Jun 30, 2008 + */ +public interface Role extends IdentityType +{ + + /** + * @return description + */ + String getDescription(); + + /** + * @return group type + */ + RoleType getRoleType(); + +} \ No newline at end of file Copied: trunk/identity-api/src/main/java/org/jboss/identity/api2/RoleType.j= ava (from rev 84, trunk/identity-api/src/main/java/org/jboss/identity/api/R= oleType.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/api2/RoleType.java = (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/RoleType.java = 2008-09-20 19:34:02 UTC (rev 98) @@ -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.api2; + + +/** + * Type of Role + * @author Anil.Saldhana(a)redhat.com + * @author Boleslaw D= awidowicz + * @since Jun 30, 2008 + */ +public interface RoleType +{ + + /** + * @return role type name + */ + String getName(); + +} \ No newline at end of file Copied: trunk/identity-api/src/main/java/org/jboss/identity/api2/SessionSta= te.java (from rev 84, trunk/identity-api/src/main/java/org/jboss/identity/a= pi/session/SessionState.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/api2/SessionState.j= ava (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/SessionState.j= ava 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,32 @@ +/* + * 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.api2; + +/** + * Current State of the Session + * @author Anil.Saldhana(a)redhat.com + * @since Jul 22, 2008 + */ +public enum SessionState = +{ + OPEN, CLOSED, ACTIVE; +} \ No newline at end of file Copied: trunk/identity-api/src/main/java/org/jboss/identity/api2/Transactio= n.java (from rev 84, trunk/identity-api/src/main/java/org/jboss/identity/ap= i/Transaction.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/api2/Transaction.ja= va (rev 0) +++ trunk/identity-api/src/main/java/org/jboss/identity/api2/Transaction.ja= va 2008-09-20 19:34:02 UTC (rev 98) @@ -0,0 +1,53 @@ +/* +* JBoss, a division of Red Hat +* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as = indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ + +package org.jboss.identity.api2; + +/** + * @author Boleslaw D= awidowicz + * @version : 0.1 $ + */ +public interface Transaction +{ + + /** + * Begin new transaction + */ + void start(); + + /** + * Commit transaction - flush associated session + */ + void commit(); + + /** + * Rollback transaction + */ + void rollback(); + + /** + * + * @return + */ + boolean isActive(); + +} \ No newline at end of file --===============7437725456364075836==--