org.jbpm.task.identity
Class DBUserGroupCallbackImpl

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

public class DBUserGroupCallbackImpl
extends Object
implements UserGroupCallback

Data base server user group callback implementation that utilizes SQL queries to get information about user, groups and relationship of these two.
There are four configuration parameters required by this callback:


Field Summary
protected static String DEFAULT_PROPERTIES_NAME
           
static String DS_JNDI_NAME
           
static String PRINCIPAL_QUERY
           
static String ROLES_QUERY
           
static String USER_ROLES_QUERY
           
 
Constructor Summary
DBUserGroupCallbackImpl()
           
DBUserGroupCallbackImpl(Properties config)
           
 
Method Summary
protected  boolean checkExistence(String querySql, String parameter)
           
 boolean existsGroup(String groupId)
          Resolves existence of group id.
 boolean existsUser(String userId)
          Resolves existence of user id.
protected  Connection getConnection()
           
 List<String> getGroupsForUser(String userId, List<String> groupIds, List<String> allExistingGroupIds)
          Returns list of group ids for specified user id.
 
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

DS_JNDI_NAME

public static final String DS_JNDI_NAME
See Also:
Constant Field Values

PRINCIPAL_QUERY

public static final String PRINCIPAL_QUERY
See Also:
Constant Field Values

USER_ROLES_QUERY

public static final String USER_ROLES_QUERY
See Also:
Constant Field Values

ROLES_QUERY

public static final String ROLES_QUERY
See Also:
Constant Field Values
Constructor Detail

DBUserGroupCallbackImpl

public DBUserGroupCallbackImpl()

DBUserGroupCallbackImpl

public DBUserGroupCallbackImpl(Properties config)
Method Detail

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.

getConnection

protected Connection getConnection()
                            throws SQLException
Throws:
SQLException

checkExistence

protected boolean checkExistence(String querySql,
                                 String parameter)


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