Class UserManagementServiceImpl

    • Constructor Detail

      • UserManagementServiceImpl

        public UserManagementServiceImpl()
    • Method Detail

      • getUserNames

        @Transactional(readOnly=true)
        public List<String> getUserNames​(String searchString)
        Description copied from interface: UserManagementService
        Returns a list of user names that contain the given search string
        Specified by:
        getUserNames in interface UserManagementService
        Returns:
        list of matching user names that contains the given search string
      • getUserDetailsCount

        @Transactional(readOnly=true)
        public Integer getUserDetailsCount()
        Description copied from interface: UserManagementService
        Returns the number of user details (name, role) for every user in the database
        Specified by:
        getUserDetailsCount in interface UserManagementService
        Returns:
        long number (count) of user details
      • getUserDetails

        @Transactional(readOnly=true)
        public List<UserDetail> getUserDetails​(int start,
                                               int maxResults)
        Description copied from interface: UserManagementService
        Returns a list of user details (name, role) for maxResults of users staring with 'start'
        Specified by:
        getUserDetails in interface UserManagementService
        Returns:
        list of userDetails
      • getActiveUsersDetails

        @Transactional(readOnly=true)
        public List<UserDetail> getActiveUsersDetails()
        Description copied from interface: UserManagementService
        Returns a list of user details (name, role) for every enabled user in the database An enabled user is a user where the property isDisabled=false
        Specified by:
        getActiveUsersDetails in interface UserManagementService
        Returns:
        list of userDetails
      • getInactiveUsersDetails

        @Transactional(readOnly=true)
        public List<UserDetail> getInactiveUsersDetails()
        Description copied from interface: UserManagementService
        Returns a list of user details (name, role) for every disabled user in the database An disabled user is a user where the property isDisabled=true
        Specified by:
        getInactiveUsersDetails in interface UserManagementService
        Returns:
        list of userDetails
      • getUserDetail

        @Transactional(readOnly=true)
        public UserDetail getUserDetail​(String userName)
        Description copied from interface: UserManagementService
        Fetches the user details such as user name, user role of the given user
        Specified by:
        getUserDetail in interface UserManagementService
        Parameters:
        userName - user whose details are desired
        Returns:
        user details of the desired user
      • disableOperatorRole

        @Transactional
        public void disableOperatorRole​(User user)
        Description copied from interface: UserManagementService
        Disables operator role for the given user. A user can either be an admin or operator but not both.
        Specified by:
        disableOperatorRole in interface UserManagementService
        Parameters:
        user - system user
      • createUser

        @Transactional
        public boolean createUser​(String userName,
                                  String password,
                                  boolean admin)
        Description copied from interface: UserManagementService
        Creates a user in the system with given user name and password. Assigns admin role to the created user if admin flag is set
        Specified by:
        createUser in interface UserManagementService
        Parameters:
        userName - user name of the new user
        password - password of the new user
        admin - true if user beign created is admin
        Returns:
        true if user creation is successful, false otherwise
      • createUser

        public boolean createUser​(String userName,
                                  String password,
                                  String role)
        Description copied from interface: UserManagementService
        Creates a user in the system with given user name and password. Assigns admin role to the created user if admin flag is set
        Specified by:
        createUser in interface UserManagementService
        Parameters:
        userName - user name of the new user
        password - password of the new user
        role - role of the new user
        Returns:
        true if user creation is successful, false otherwise
      • updateUser

        @Transactional
        public boolean updateUser​(UserDetail userDetail)
        Description copied from interface: UserManagementService
        Updates user in the system with new password and role. Only updates the user record if it is found in the system.
        Specified by:
        updateUser in interface UserManagementService
        Parameters:
        userDetail - userDetails such as username, password etc
        Returns:
        true if update operation succeeds, false otherwise
      • inactivateUser

        @Transactional
        public boolean inactivateUser​(UserDetail userDetail)
        Description copied from interface: UserManagementService
        Inactivates a given user. User can be activated again.
        Specified by:
        inactivateUser in interface UserManagementService
        Parameters:
        userDetail - userDetails such as id, username etc
        Returns:
        true if setting isDisabled property succeeds, false otherwise
      • activateUser

        @Transactional
        public boolean activateUser​(UserDetail userDetail)
        Description copied from interface: UserManagementService
        Activates a given user that has been deactivated
        Specified by:
        activateUser in interface UserManagementService
        Parameters:
        userDetail - userDetails such as id, username etc
        Returns:
        true if setting isDisabled property succeeds, false otherwise
      • deactivateUser

        @Transactional
        public boolean deactivateUser​(UserDetail userDetail)
        Description copied from interface: UserManagementService
        Deactivates/soft deletes a given user. This action is un-reversible. Called "delete" in the UI
        Specified by:
        deactivateUser in interface UserManagementService
        Parameters:
        userDetail - userDetails such as id, username etc
        Returns:
        true if soft delete operation succeeds, false otherwise
      • setSesssionFactory

        @Autowired
        public void setSesssionFactory​(org.hibernate.SessionFactory sessionFactory)
      • setAuthoritiesService

        @Autowired
        public void setAuthoritiesService​(StandardAuthoritiesService authoritiesService)
        Parameters:
        authoritiesService - the authoritiesService to set
      • setUserDao

        @Autowired
        public void setUserDao​(UserDao userDao)
        Parameters:
        userDao - the userDao to set
      • setUserService

        @Autowired
        public void setUserService​(UserService userService)
        Injects UserService
        Parameters:
        userService - the userService to set
      • setPasswordEncoder

        @Autowired
        public void setPasswordEncoder​(VersionedPasswordEncoder passwordEncoder)
        Parameters:
        passwordEncoder - the passwordEncoder to set
      • setUserPropertiesService

        @Autowired
        public void setUserPropertiesService​(UserPropertiesService userPropertiesService)
        Parameters:
        userPropertiesService - the userPropertiesService to set