org.jbpm.pvm.internal.identity.impl
Class IdentitySessionImpl

java.lang.Object
  extended by org.jbpm.pvm.internal.identity.impl.IdentitySessionImpl
All Implemented Interfaces:
IdentitySession

public class IdentitySessionImpl
extends java.lang.Object
implements IdentitySession

Author:
Tom Baeyens, Huisheng Xu

Field Summary
protected  org.hibernate.Session session
           
 
Constructor Summary
IdentitySessionImpl()
           
 
Method Summary
 java.lang.String createGroup(java.lang.String groupName, java.lang.String groupType, java.lang.String parentGroupId)
          create a group new group
 void createMembership(java.lang.String userId, java.lang.String groupId, java.lang.String role)
          makes the given user a member of the given group with the given role.
 java.lang.String createUser(java.lang.String userName, java.lang.String givenName, java.lang.String familyName, java.lang.String businessEmail)
          create a new user
 void deleteGroup(java.lang.String groupId)
          deletes the given group.
 void deleteMembership(java.lang.String userId, java.lang.String groupId, java.lang.String role)
          makes the given user a member of the given group with the given role.
 void deleteUser(java.lang.String userId)
          delete the given user.
 GroupImpl findGroupById(java.lang.String groupId)
          lookup a group.
 java.util.List<Group> findGroups()
           
 java.util.List<Group> findGroupsByUser(java.lang.String userId)
          all groups for which this user is a member.
 java.util.List<Group> findGroupsByUserAndGroupType(java.lang.String userId, java.lang.String groupType)
          groups of the given groupType for which the given user is a member.
 User findUserById(java.lang.String userId)
          lookup a user.
 java.util.List<User> findUsers()
          get all the users in the system.
 java.util.List<User> findUsersByGroup(java.lang.String groupId)
          lookup users with membership in group.
 java.util.List<User> findUsersById(java.lang.String... userIds)
          lookup users with the given identifiers.
 void setSession(org.hibernate.Session session)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

protected org.hibernate.Session session
Constructor Detail

IdentitySessionImpl

public IdentitySessionImpl()
Method Detail

createUser

public java.lang.String createUser(java.lang.String userName,
                                   java.lang.String givenName,
                                   java.lang.String familyName,
                                   java.lang.String businessEmail)
Description copied from interface: IdentitySession
create a new user

Specified by:
createUser in interface IdentitySession

findUserById

public User findUserById(java.lang.String userId)
Description copied from interface: IdentitySession
lookup a user.

Specified by:
findUserById in interface IdentitySession
Returns:
the user or null if no such user exists

findUsersById

public java.util.List<User> findUsersById(java.lang.String... userIds)
Description copied from interface: IdentitySession
lookup users with the given identifiers.

Specified by:
findUsersById in interface IdentitySession
Returns:
an empty list if no such users exist

findUsers

public java.util.List<User> findUsers()
Description copied from interface: IdentitySession
get all the users in the system.

Specified by:
findUsers in interface IdentitySession
Returns:
an empty list if no users exist.

deleteUser

public void deleteUser(java.lang.String userId)
Description copied from interface: IdentitySession
delete the given user. No effect (no exception) if the user does not exist.

Specified by:
deleteUser in interface IdentitySession

createGroup

public java.lang.String createGroup(java.lang.String groupName,
                                    java.lang.String groupType,
                                    java.lang.String parentGroupId)
Description copied from interface: IdentitySession
create a group new group

Specified by:
createGroup in interface IdentitySession
Returns:
the generated id for this group.

findUsersByGroup

public java.util.List<User> findUsersByGroup(java.lang.String groupId)
Description copied from interface: IdentitySession
lookup users with membership in group.

Specified by:
findUsersByGroup in interface IdentitySession
Returns:
the users or an empty list if no users exist

findGroupById

public GroupImpl findGroupById(java.lang.String groupId)
Description copied from interface: IdentitySession
lookup a group.

Specified by:
findGroupById in interface IdentitySession
Returns:
the user or null if no such user exists

findGroupsByUserAndGroupType

public java.util.List<Group> findGroupsByUserAndGroupType(java.lang.String userId,
                                                          java.lang.String groupType)
Description copied from interface: IdentitySession
groups of the given groupType for which the given user is a member.

Specified by:
findGroupsByUserAndGroupType in interface IdentitySession
Returns:
an empty list if no such groups exist.

findGroupsByUser

public java.util.List<Group> findGroupsByUser(java.lang.String userId)
Description copied from interface: IdentitySession
all groups for which this user is a member.

Specified by:
findGroupsByUser in interface IdentitySession
Returns:
an empty list if no such groups exist.

findGroups

public java.util.List<Group> findGroups()

deleteGroup

public void deleteGroup(java.lang.String groupId)
Description copied from interface: IdentitySession
deletes the given group. No effect (no exception) if the group does not exist.

Specified by:
deleteGroup in interface IdentitySession

createMembership

public void createMembership(java.lang.String userId,
                             java.lang.String groupId,
                             java.lang.String role)
Description copied from interface: IdentitySession
makes the given user a member of the given group with the given role. Role can be null.

Specified by:
createMembership in interface IdentitySession

deleteMembership

public void deleteMembership(java.lang.String userId,
                             java.lang.String groupId,
                             java.lang.String role)
Description copied from interface: IdentitySession
makes the given user a member of the given group with the given role. Role can be null. If no such membership exists, this method will not throw an exception and have no effect.

Specified by:
deleteMembership in interface IdentitySession

setSession

public void setSession(org.hibernate.Session session)


Copyright © 2010 JBoss Community. All Rights Reserved.