Class IdentityService


  • public class IdentityService
    extends java.lang.Object
    Class for providing identity services.
    • Constructor Summary

      Constructors 
      Constructor Description
      IdentityService()  
    • Method Summary

      Modifier and Type Method Description
      static void addUserToGroup​(java.lang.String userId, java.lang.String groupId)
      Adds a user to a group.
      static org.flowable.idm.api.Token createToken​(java.lang.String userId, java.lang.String remoteAddress, java.lang.String userAgent)
      Creates a token.
      static boolean createUser​(java.lang.String userId, java.lang.String firstName, java.lang.String lastName, java.lang.String displayName, java.lang.String email)
      Creates a new user.
      static boolean deleteUserInfo​(java.lang.String userId, java.lang.String key)
      Deletes the user info for the user and the key.
      static java.util.List<org.flowable.idm.api.Group> findGroups​(java.lang.String userId)
      Finds the groups for a user.
      static org.flowable.idm.api.Token findTokenById​(java.lang.String tokenId)
      Returns the token with the matching token id.
      static org.flowable.idm.api.User findUserByEmail​(java.lang.String email)
      Returns the user with the matching email.
      static org.flowable.idm.api.User findUserById​(java.lang.String userId)
      Returns the user with the matching user id.
      static java.lang.String findUserIdByUserInfo​(java.lang.String key, java.lang.String value)
      Returns the user id for the user info key and value.
      static java.util.List<java.lang.String> findUserInfoKeys​(java.lang.String userId)
      Returns the info keys for the user.
      static java.lang.String getUserInfo​(java.lang.String userId, java.lang.String key)
      Returns the user info value for the user and the key.
      static boolean setUserInfo​(java.lang.String userId, java.lang.String key, java.lang.String value)
      Sets the user info value for the user and the key.
      static boolean updateUser​(java.lang.String userId, java.lang.String firstName, java.lang.String lastName, java.lang.String displayName, java.lang.String email)
      Updates an existing user.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IdentityService

        public IdentityService()
    • Method Detail

      • findUserById

        public static org.flowable.idm.api.User findUserById​(java.lang.String userId)
        Returns the user with the matching user id.
        Parameters:
        userId - the user id
        Returns:
        the user
      • findUserByEmail

        public static org.flowable.idm.api.User findUserByEmail​(java.lang.String email)
        Returns the user with the matching email.
        Parameters:
        email - the email
        Returns:
        the user
      • findGroups

        public static java.util.List<org.flowable.idm.api.Group> findGroups​(java.lang.String userId)
        Finds the groups for a user.
        Parameters:
        userId - the user id
        Returns:
        the groups for the user
      • addUserToGroup

        public static void addUserToGroup​(java.lang.String userId,
                                          java.lang.String groupId)
        Adds a user to a group.
        Parameters:
        userId - the user id
        groupId - the group id
      • findUserInfoKeys

        public static java.util.List<java.lang.String> findUserInfoKeys​(java.lang.String userId)
        Returns the info keys for the user.
        Parameters:
        userId - the user id
        Returns:
        the info keys
      • getUserInfo

        public static java.lang.String getUserInfo​(java.lang.String userId,
                                                   java.lang.String key)
        Returns the user info value for the user and the key.
        Parameters:
        userId - the user id
        key - the key
        Returns:
        the user info value
      • findUserIdByUserInfo

        public static java.lang.String findUserIdByUserInfo​(java.lang.String key,
                                                            java.lang.String value)
        Returns the user id for the user info key and value.
        Parameters:
        key - the info key
        value - the info value
        Returns:
        the user id
      • setUserInfo

        public static boolean setUserInfo​(java.lang.String userId,
                                          java.lang.String key,
                                          java.lang.String value)
        Sets the user info value for the user and the key.
        Parameters:
        userId - the user id
        key - the key
        value - the value
        Returns:
        true if the user info was created successfully; false otherwise
      • deleteUserInfo

        public static boolean deleteUserInfo​(java.lang.String userId,
                                             java.lang.String key)
        Deletes the user info for the user and the key.
        Parameters:
        userId - the user id
        key - the key
        Returns:
        true if the user info was deleted successfully; false otherwise
      • createUser

        public static boolean createUser​(java.lang.String userId,
                                         java.lang.String firstName,
                                         java.lang.String lastName,
                                         java.lang.String displayName,
                                         java.lang.String email)
        Creates a new user.
        Parameters:
        userId - the user id
        firstName - the user's first name
        lastName - the user's last name
        displayName - the user's display name
        email - the user's email
        Returns:
        true if the user was created successfully; false otherwise
      • updateUser

        public static boolean updateUser​(java.lang.String userId,
                                         java.lang.String firstName,
                                         java.lang.String lastName,
                                         java.lang.String displayName,
                                         java.lang.String email)
        Updates an existing user.
        Parameters:
        userId - the user id
        firstName - the user's first name
        lastName - the user's last name
        displayName - the user's display name
        email - the user's email
        Returns:
        true if the user was updated successfully; false otherwise
      • findTokenById

        public static org.flowable.idm.api.Token findTokenById​(java.lang.String tokenId)
        Returns the token with the matching token id.
        Parameters:
        tokenId - the token id
        Returns:
        the token
      • createToken

        public static org.flowable.idm.api.Token createToken​(java.lang.String userId,
                                                             java.lang.String remoteAddress,
                                                             java.lang.String userAgent)
        Creates a token.
        Parameters:
        userId - the user id
        remoteAddress - the remote address
        userAgent - the user agent
        Returns:
        the token