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 return database entity which logged in system.
      java.util.Deque<java.util.Map<java.lang.String,​java.lang.Object>> getPaginationFilter​(java.lang.String requestJson)
      This method does calculation for a pages based on the request.
      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.LinkedHashSet<User> searchUsers​(java.lang.String requestJson)
      This method does search requests and returns data as list.
      java.util.List<User> searchUsers​(java.lang.String query, int from, int to)
      This method does search requests and returns data as list.
      org.springframework.data.domain.Page<User> searchUsersPaged​(java.lang.String requestJson)
      This method does search requests and returns data as pages.
      • Methods inherited from class java.lang.Object

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

      • mongoTemplate

        @Autowired
        private org.springframework.data.mongodb.core.MongoTemplate mongoTemplate
      • appContext

        @Autowired
        private org.springframework.context.ApplicationContext appContext
      • mapper

        private final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • UserManagementServiceImpl

        public UserManagementServiceImpl()
    • Method Detail

      • getPaginationFilter

        public java.util.Deque<java.util.Map<java.lang.String,​java.lang.Object>> getPaginationFilter​(java.lang.String requestJson)
        Description copied from interface: UserManagementService
        This method does calculation for a pages based on the request.
        Specified by:
        getPaginationFilter in interface UserManagementService
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        map-representation of data
      • searchUsers

        public java.util.LinkedHashSet<User> searchUsers​(java.lang.String requestJson)
        Description copied from interface: UserManagementService
        This method does search requests and returns data as list.
        Specified by:
        searchUsers in interface UserManagementService
        Parameters:
        requestJson - search request
        Returns:
        data transport entities as list
      • searchUsersPaged

        public org.springframework.data.domain.Page<User> searchUsersPaged​(java.lang.String requestJson)
        Description copied from interface: UserManagementService
        This method does search requests and returns data as pages.
        Specified by:
        searchUsersPaged in interface UserManagementService
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        database entities separated to pages
      • 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