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/IdentitySessionFactory.java
trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentityType.java
trunk/identity-api/src/main/java/org/jboss/identity/api2/PersistenceManager.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.java
trunk/identity-api/src/main/java/org/jboss/identity/api2/RelationshipManager.java
trunk/identity-api/src/main/java/org/jboss/identity/api2/RelationshipType.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.java
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/Group.java)
===================================================================
--- 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 2008-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 <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @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)
===================================================================
--- 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 <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @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.java (from rev
84, trunk/identity-api/src/main/java/org/jboss/identity/api/Identity.java)
===================================================================
--- 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 <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @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/IdentitySession.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentitySession.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentitySession.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
+ *
+ * <p>An Identity Session</p>
+ * @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/IdentitySessionFactory.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentitySessionFactory.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentitySessionFactory.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 <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @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/IdentityType.java (from
rev 93, trunk/identity-api/src/main/java/org/jboss/identity/api/IdentityType.java)
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentityType.java
(rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api2/IdentityType.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;
+
+import org.jboss.identity.exception.PolicyValidationException;
+
+
+/**
+ * Marker Interface representing
+ * an object of the Identity Model
+ * @author Anil.Saldhana(a)redhat.com
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @since Jul 10, 2008
+ */
+public interface IdentityType
+{
+
+ /**
+ * @return id of this identity object
+ */
+ Object getId();
+
+ /**
+ * <p>Return the name of the identity</p>
+ * @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/PersistenceManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api2/PersistenceManager.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api2/PersistenceManager.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 <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface PersistenceManager
+{
+
+ /**
+ * @return Session associated with this object instance
+ */
+ IdentitySession getIdentitySession();
+
+ // Create
+
+ /**
+ * <p>Create an identity in the realm</p>
+ * @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;
+
+ /**
+ * <p>Create a role in the realm</p>
+ * @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<Identity> findIdentity(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 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<Identity> findIdentity(Map<String, String[]> attributes,
+ int offset, int limit,
+ String orderedByAttributeName, boolean 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<Role> findRole(RoleType roleType,
+ 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 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<Identity> findRole(RoleType roleType,
+ Map<String, String[]> attributes,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending) 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 IdentityException;
+
+ /**
+ * 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<Group> 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<Group> findGroup(GroupType groupType,
+ Map<String, String[]> attributes,
+ int offset, int limit,
+ String orderedByAttributeName, boolean ascending) throws
IdentityException;
+
+
+
+
+ // Search with relationship types
+
+ /**
+ * 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 org.jboss.identity.exception.IdentityException
+ */
+ Collection<IdentityType> findRelatedIdentityTypes(IdentityType identity,
+ RelationshipType relationshipType,
+ boolean parent,
+ int offset, int limit,
+ String orderedByAttributeName,
+ boolean ascending) throws
IdentityException;
+
+}
Added: trunk/identity-api/src/main/java/org/jboss/identity/api2/ProfileManager.java
===================================================================
--- 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 <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @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<String> getSupportedAttributeNames(IdentityType identityType)
+ throws IdentityException;
+
+ /**
+ * Get attributes for the given identity
+ *
+ * @param identity
+ * @return
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ Map<String, String[]> getAttributes(IdentityType identity) throws
IdentityException;
+
+ /**
+ * Update attributes with new values - previous values will be overwritten
+ * @param identity
+ * @param attributes
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void updateAttributes(IdentityType 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.identity.exception.IdentityException
+ */
+ void addAttributes(IdentityType identity, Map<String, String[]> attributes)
+ throws IdentityException;
+
+ /**
+ * Remove attributes
+ *
+ * @param identity
+ * @param attributes
+ */
+ void removeAttributes(IdentityType identity, Set<String> 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/domain/Realm.java)
===================================================================
--- 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 2008-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;
+
+/**
+ * <p>The <b>realm</b> under which the various models and policies
+ * are applicable.</p>
+ * @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/RealmManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api2/RealmManager.java
(rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api2/RealmManager.java 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.PersistenceManagerNotFoundException;
+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 <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface RealmManager
+{
+
+
+ /**
+ * <p>Create a Realm or return an already
+ * created realm. Bootstrapping includes generating
+ * the models in the realm</p>
+ * @param realmName
+ * @return
+ */
+ Realm bootstrap(String realmName);
+
+ /**
+ * <p>Bootstrap a realm given a configuration</p>
+ * @param realmName
+ * @param config
+ * @return
+ */
+ Realm bootstrap(String realmName, InputStream config);
+
+ /**
+ * <p>Associate a relationship between two realms</p>
+ * @param realmA
+ * @param realmB
+ * @param relationshipType
+ * @throws org.jboss.identity.api.exception.PersistenceManagerNotFoundException PM not
set
+ * @throws org.jboss.identity.api.exception.SessionNotOpenException session is not
open
+ */
+ void associate(Realm realmA, Realm realmB, RelationshipType relationshipType)
+ 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 PersistenceManagerNotFoundException,SessionNotOpenException;
+
+ /**
+ * @param fromRealm
+ * @param toRealm
+ * @return returns a relationship type between this and given Realm.
+ */
+ RelationshipType getRelationship(Realm fromRealm, Realm toRealm);
+
+ /**
+ * <p>Return a realm</p>
+ * @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/RelationshipManager.java
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api2/RelationshipManager.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api2/RelationshipManager.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 <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @version : 0.1 $
+ */
+public interface RelationshipManager
+{
+
+ /**
+ * @return Session associated with this object instance
+ */
+ IdentitySession getIdentitySession();
+
+
+
+
+ /**
+ * <p>Associate a relationship between two groups</p>
+ * @param groupA
+ * @param groupB
+ * @param relationshipType
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void associate(Group groupA, Group groupB, RelationshipType relationshipType)
+ 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<Group> groupB, RelationshipType
relationshipType)
+ throws IdentityException;
+
+
+
+ /**
+ * <p>Associate a role with an Identity</p>
+ * @param identity
+ * @param aRole
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void associate(Identity identity, Role aRole)
+ throws IdentityException;
+
+ /**
+ * <p>Associate a list of roles with an Identity</p>
+ * @param identity
+ * @param aRoleList
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void associate(Identity identity, List<Role> aRoleList)
+ throws IdentityException;
+
+ /**
+ * <p>Associate a group with an identity</p>
+ * @param identity
+ * @param aGroup
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void associate(Identity identity, Group aGroup)
+ throws IdentityException;
+
+ /**
+ * <p>Associate a set of groups with an identity</p>
+ * @param identity
+ * @param aGroupSet
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void associate(Identity identity, Set<Group> aGroupSet)
+ throws IdentityException;
+
+ /**
+ * <p>Disassociate a relationship between two groups</p>
+ * @param groupA
+ * @param groupB
+ * @param relationshipType
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void disassociate(Group groupA, Group groupB, RelationshipType relationshipType)
+ throws IdentityException;
+
+ /**
+ * Disassociate a relationship between one group and a list of other groups
+ * @param groupA
+ * @param groupB
+ * @param relationshipType
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void disassociate(Group groupA, List<Group> groupB, RelationshipType
relationshipType)
+ throws IdentityException;
+
+
+
+ /**
+ * <p>Disassociate a role with an Identity</p>
+ * @param identity
+ * @param aRole
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void disassociate(Identity identity, Role aRole)
+ throws IdentityException;
+
+ /**
+ * <p>Disassociate a list of roles with an Identity</p>
+ * @param identity
+ * @param aRoleList
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void disassociate(Identity identity, List<Role> aRoleList)
+ throws IdentityException;
+
+ /**
+ * <p>Disassociate a group with an identity</p>
+ * @param identity
+ * @param aGroup
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ void disassociate(Identity identity, Group aGroup)
+ throws IdentityException;
+
+ /**
+ * <p>Disassociate a set of groups with an identity</p>
+ * @param identity
+ * @param aGroupSet
+ * @throws org.jboss.identity.api.exception.PersistenceManagerNotFoundException PM not
set
+ * @throws org.jboss.identity.api.exception.SessionNotOpenException session is not
open
+ */
+ void disassociate(Identity identity, Set<Group> 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
+ */
+ <R extends RelationshipType> void createRelationship(IdentityType fromIdentity,
+ IdentityType toIdentity,
+ R relationshipType) throws IdentityException;
+
+ /**
+ * Remove relationship between identities. Relationships can be directional so
+ * order of parameters matters
+ *
+ * @param fromIdentity
+ * @param toIdentity
+ * @param relationshipType
+ * @throws org.jboss.identity.exception.IdentityException
+ */
+ <R extends RelationshipType> void removeRelationship(IdentityType fromIdentity,
+ IdentityType toIdentity,
+ R 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 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<RelationshipType> resolveRelationships(IdentityType fromIdentity,
IdentityType 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/RelationshipType.java
(from rev 84,
trunk/identity-api/src/main/java/org/jboss/identity/api/RelationshipType.java)
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api2/RelationshipType.java
(rev 0)
+++
trunk/identity-api/src/main/java/org/jboss/identity/api2/RelationshipType.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 <b>relationship</b> between groups, domains etc
+ * @author Anil.Saldhana(a)redhat.com
+ * @author <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @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)
===================================================================
--- 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 <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @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.java (from rev
84, trunk/identity-api/src/main/java/org/jboss/identity/api/RoleType.java)
===================================================================
--- 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 <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @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/SessionState.java (from
rev 84,
trunk/identity-api/src/main/java/org/jboss/identity/api/session/SessionState.java)
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api2/SessionState.java
(rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api2/SessionState.java 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/Transaction.java (from
rev 84, trunk/identity-api/src/main/java/org/jboss/identity/api/Transaction.java)
===================================================================
--- trunk/identity-api/src/main/java/org/jboss/identity/api2/Transaction.java
(rev 0)
+++ trunk/identity-api/src/main/java/org/jboss/identity/api2/Transaction.java 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 <a href="mailto:boleslaw.dawidowicz at redhat.com">Boleslaw
Dawidowicz</a>
+ * @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