Interface UserFavoriteSpaceService

    • Method Detail

      • getListUserFavoriteSpace

        List<UserFavoriteSpaceVO> getListUserFavoriteSpace​(String userId)
        Retrieve the list of user favorite space
        Parameters:
        userId - : the user identifier
        Returns:
        the list of User Favorite Space Value Object
      • addUserFavoriteSpace

        boolean addUserFavoriteSpace​(UserFavoriteSpaceVO ufsVO)
        Add given User Favorite Space Value Object parameter in Database
        Parameters:
        ufsVO - a UserFavoriteSpaceVO
        Returns:
        true if action was successful, false otherwise
      • removeUserFavoriteSpace

        boolean removeUserFavoriteSpace​(UserFavoriteSpaceVO ufsVO)
        Remove given User Favorite Space Value Object from Database
        • remove one record if ufsVO.userId and ufsVO.spaceId is not null
        • remove all ufsVO.spaceId if ufsVO.userId is null
        • remove all ufsVO.userId if ufsVO.spaceId is null
        Parameters:
        ufsVO - a UserFavoriteSpaceVO
        Returns:
        true if action was successful, false otherwise
      • isUserFavoriteSpace

        boolean isUserFavoriteSpace​(List<UserFavoriteSpaceVO> listUFS,
                                    SpaceInstLight space)
        Is the specified space instance is one of the user's favorite spaces?
        Parameters:
        listUFS - : the list of user favorite space
        space - : a space instance
        Returns:
        true if list of user favorites space contains spaceId identifier, false otherwise.
      • containsFavoriteSubSpace

        boolean containsFavoriteSubSpace​(SpaceInstLight space,
                                         List<UserFavoriteSpaceVO> listUFS,
                                         String userId)
        Is the specified space contains the specified user's favorite spaces as subspaces?
        Parameters:
        space - : space instance
        listUFS - : the list of user favorite space
        Returns:
        true if the current space contains user favorites sub space, false otherwise