org.jbpm.task.identity
Class JAASUserGroupCallbackImpl

java.lang.Object
  extended by org.jbpm.task.identity.JAASUserGroupCallbackImpl
All Implemented Interfaces:
UserGroupCallback

public class JAASUserGroupCallbackImpl
extends Object
implements UserGroupCallback

JAAS based implementation of user group callback dedicated when using LocalTaskService in container such as JBoss AS. It relies on JACC api to collect information on currently logged on user when querying for tasks.
JACC exposes following named context in PolicyContext:
javax.security.auth.Subject.container
This returns Subject instance for currently authenticated user and next principals will be examined to find instances of Group and with given rolePrincipleName (by default Roles).
By default it works with JBoss Application Servers as it uses specific principal name to find the groups.


Field Summary
protected static String DEFAULT_PROPERTIES_NAME
           
 
Constructor Summary
JAASUserGroupCallbackImpl()
           
JAASUserGroupCallbackImpl(String rolesPrincipleName)
           
 
Method Summary
 boolean existsGroup(String groupId)
          Resolves existence of group id.
 boolean existsUser(String userId)
          Resolves existence of user id.
 List<String> getGroupsForUser(String userId, List<String> groupIds, List<String> allExistingGroupIds)
          Returns list of group ids for specified user id.
 String getRolePrincipleName()
           
 void setRolePrincipleName(String rolePrincipleName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PROPERTIES_NAME

protected static final String DEFAULT_PROPERTIES_NAME
See Also:
Constant Field Values
Constructor Detail

JAASUserGroupCallbackImpl

public JAASUserGroupCallbackImpl()

JAASUserGroupCallbackImpl

public JAASUserGroupCallbackImpl(String rolesPrincipleName)
Method Detail

getRolePrincipleName

public String getRolePrincipleName()

setRolePrincipleName

public void setRolePrincipleName(String rolePrincipleName)

existsUser

public boolean existsUser(String userId)
Description copied from interface: UserGroupCallback
Resolves existence of user id.

Specified by:
existsUser in interface UserGroupCallback
Parameters:
userId - the user id assigned to the task
Returns:
true if userId exists, false otherwise.

existsGroup

public boolean existsGroup(String groupId)
Description copied from interface: UserGroupCallback
Resolves existence of group id.

Specified by:
existsGroup in interface UserGroupCallback
Parameters:
groupId - the group id assigned to the task
Returns:
true if groupId exists, false otherwise.

getGroupsForUser

public List<String> getGroupsForUser(String userId,
                                     List<String> groupIds,
                                     List<String> allExistingGroupIds)
Description copied from interface: UserGroupCallback
Returns list of group ids for specified user id.

Specified by:
getGroupsForUser in interface UserGroupCallback
Parameters:
userId - the user id assigned to the task
groupIds - list of group ids assigned to the task
allExistingGroupIds - list of all currently known group ids
Returns:
List of group ids.


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.