Class ProfileManagementServiceImpl

    • 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

      • ProfileManagementServiceImpl

        public ProfileManagementServiceImpl()
    • 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: ProfileManagementService
        This method does calculation for a pages based on the request.
        Specified by:
        getPaginationFilter in interface ProfileManagementService
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        map-representation of data
      • searchProfiles

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

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

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

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

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

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

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

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getGenders()
        Description copied from interface: ProfileManagementService
        This method retrieves a map, which can be processed in a templates.
        Specified by:
        getGenders in interface ProfileManagementService
        Returns:
        map-representation of data
      • deactivateProfile

        public void deactivateProfile​(java.lang.String profileId)
        Description copied from interface: ProfileManagementService
        This method updates database entity.
        Specified by:
        deactivateProfile in interface ProfileManagementService
        Parameters:
        profileId - identification for database entity which will be find and deactivate their profiles
      • isProfileBelongsToLoggedUser

        public boolean isProfileBelongsToLoggedUser​(java.lang.String profileId)
        Description copied from interface: ProfileManagementService
        Checks if the provided profile ID belongs to the logged-in user.
        Specified by:
        isProfileBelongsToLoggedUser in interface ProfileManagementService
        Parameters:
        profileId - The ID of the profile to be checked.
        Returns:
        true if the profile ID belongs to the logged-in user, false otherwise.