Class UserManagementServiceImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void changePassword​(User user, java.lang.String password)
      This method update and save password from database entity (user).
      java.util.Optional<User> createUser​(User user)
      This method creates a database entity.
      java.util.Optional<User> createUser​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> userAsMap)
      This method creates a database entity.
      User getLoggedUser()
      This method does returns database entity which logged in system.
      UserPrincipal getPrincipal()
      This method returns user principal object from context.
      UserRepository getRepository()  
      boolean isLogged()
      This method does check is database entity logged in system.
      boolean isNotLogged()
      This method does check is not database entity logged in system.
      boolean isSuperUser()
      This method does check is database entity had super status.
      boolean isUserPermissionAll()
      This method does check is database entity had all permissions.
      boolean isUserPermissionApplication()
      This method does check is database entity had application permission.
      void removeUserAndClean​(java.lang.String userId)
      This method removes a database entity and clean all relationships from another entities.
      void removeUsersByIds​(java.util.ArrayList<java.lang.String> userIds)
      This method removes a list of database entities.
      java.util.Optional<User> revertPasswordToSaved​(java.lang.String userId)
      This method does revert and save database entity field value
      void saveSavedPassword​(java.lang.String userId)
      This method update and save password from database entity (user).
      java.util.Optional<User> saveUser​(User user)
      This method saves a database entity.
      java.util.Optional<User> saveUser​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> userAsMap)
      This method saves database entity.
      java.util.List<User> searchUsers​(java.lang.String query, int from, int to)
      This method does search requests and returns data as list.
      • Methods inherited from class java.lang.Object

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

      • UserManagementServiceImpl

        public UserManagementServiceImpl()
    • Method Detail

      • searchUsers

        public java.util.List<User> searchUsers​(java.lang.String query,
                                                int from,
                                                int to)
        Description copied from interface: UserManagementService
        This method does search requests and returns data as list.
        Specified by:
        searchUsers in interface UserManagementService
        Parameters:
        query - search query
        from - field which filter and returned items
        to - field which filter and returned items
        Returns:
        database entities as list
      • createUser

        @Transactional
        public java.util.Optional<User> createUser​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> userAsMap)
        Description copied from interface: UserManagementService
        This method creates a database entity.
        Specified by:
        createUser in interface UserManagementService
        Parameters:
        userAsMap - map-representation of database entity
        Returns:
        optional value to externally interaction
      • createUser

        public java.util.Optional<User> createUser​(User user)
        Description copied from interface: UserManagementService
        This method creates a database entity.
        Specified by:
        createUser in interface UserManagementService
        Parameters:
        user - database entity
        Returns:
        optional value to externally interaction
      • saveUser

        @Transactional
        public java.util.Optional<User> saveUser​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> userAsMap)
        Description copied from interface: UserManagementService
        This method saves database entity.
        Specified by:
        saveUser in interface UserManagementService
        Parameters:
        userAsMap - map-representation of database entity
        Returns:
        saved instance of database entity
      • saveUser

        @Transactional
        public java.util.Optional<User> saveUser​(User user)
        Description copied from interface: UserManagementService
        This method saves a database entity.
        Specified by:
        saveUser in interface UserManagementService
        Parameters:
        user - database entity
        Returns:
        saved instance of database entity
      • removeUserAndClean

        @Transactional
        public void removeUserAndClean​(java.lang.String userId)
        Description copied from interface: UserManagementService
        This method removes a database entity and clean all relationships from another entities.
        Specified by:
        removeUserAndClean in interface UserManagementService
        Parameters:
        userId - identification for database entity which will be removed
      • removeUsersByIds

        @Transactional
        public void removeUsersByIds​(java.util.ArrayList<java.lang.String> userIds)
        Description copied from interface: UserManagementService
        This method removes a list of database entities.
        Specified by:
        removeUsersByIds in interface UserManagementService
        Parameters:
        userIds - the list of database entities which will be removed
      • changePassword

        @Transactional
        public void changePassword​(User user,
                                   java.lang.String password)
        Description copied from interface: UserManagementService
        This method update and save password from database entity (user).
        Specified by:
        changePassword in interface UserManagementService
        Parameters:
        user - the database entity which will be updated
        password - the database entity field which will be saved
      • revertPasswordToSaved

        public java.util.Optional<User> revertPasswordToSaved​(java.lang.String userId)
        Description copied from interface: UserManagementService
        This method does revert and save database entity field value
        Specified by:
        revertPasswordToSaved in interface UserManagementService
        Parameters:
        userId - identification for database entity which will be updated
        Returns:
        saved instance of database entity
      • saveSavedPassword

        public void saveSavedPassword​(java.lang.String userId)
        Description copied from interface: UserManagementService
        This method update and save password from database entity (user).
        Specified by:
        saveSavedPassword in interface UserManagementService
        Parameters:
        userId - identification for database entity which will be updated