Class DBUserGroupCallbackImpl

  • All Implemented Interfaces:
    org.kie.api.task.UserGroupCallback, org.kie.internal.task.api.UserGroupCallback

    public class DBUserGroupCallbackImpl
    extends AbstractUserGroupInfo
    implements org.kie.internal.task.api.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:
    • db.ds.jndi.name - JNDI name of the data source to be used for connections
    • db.user.query - query used to verify existence of the user (case sensitive, expects a single parameter on position 1)
    • db.roles.query - query user to check group existence (case sensitive, expects single parameter on position 1)
    • db.user.roles.query - query used to collect group for given user (case sensitive, expects single parameter on position 1, retrieves group name from position 1 of returned result set)
    • Constructor Detail

      • DBUserGroupCallbackImpl

        public DBUserGroupCallbackImpl​(boolean activate)
      • DBUserGroupCallbackImpl

        public DBUserGroupCallbackImpl​(Properties config)
    • Method Detail

      • existsUser

        public boolean existsUser​(String userId)
        Specified by:
        existsUser in interface org.kie.api.task.UserGroupCallback
      • existsGroup

        public boolean existsGroup​(String groupId)
        Specified by:
        existsGroup in interface org.kie.api.task.UserGroupCallback
      • getGroupsForUser

        public List<String> getGroupsForUser​(String userId)
        Specified by:
        getGroupsForUser in interface org.kie.api.task.UserGroupCallback
      • checkExistence

        protected boolean checkExistence​(String querySql,
                                         String parameter)