Interface SpaceStorage


  • public interface SpaceStorage
    Version:
    $Revision$
    Author:
    Alain Defrance
    • Method Detail

      • getSpaceByDisplayName

        Space getSpaceByDisplayName​(String spaceDisplayName)
                             throws SpaceStorageException
        Gets a space by its display name.
        Parameters:
        spaceDisplayName -
        Returns:
        the space with spaceDisplayName that matches the spaceDisplayName input.
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • saveSpace

        void saveSpace​(Space space,
                       boolean isNew)
                throws SpaceStorageException
        Saves a space. If isNew is true, creates new space. If not only updates space an saves it.
        Parameters:
        space -
        isNew -
        Throws:
        SpaceStorageException
      • ignoreSpace

        void ignoreSpace​(String spaceId,
                         String userId)
        update the SpaceMembership between space and user
        Parameters:
        spaceId - the space Id
        userId - user Id
      • isSpaceIgnored

        boolean isSpaceIgnored​(String spaceId,
                               String userId)
        Verify if a space is ignored by the user or not.
        Parameters:
        spaceId - the id of the space
        userId - the id of the user
        Returns:
        true if user has ignored the space from suggested list
      • getManagerSpacesCount

        int getManagerSpacesCount​(String userId)
        Gets the count of the spaces that a user has the "manager" role.
        Parameters:
        userId -
        Returns:
        the count of the manager spaces
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getManagerSpacesByFilterCount

        int getManagerSpacesByFilterCount​(String userId,
                                          SpaceFilter spaceFilter)
        Gets the count of the spaces which user has "manager" role by filter.
        Parameters:
        userId -
        spaceFilter -
        Returns:
        Since:
        1.2.0-GA
      • getManagerSpaces

        List<Space> getManagerSpaces​(String userId,
                                     long offset,
                                     long limit)
        Gets the spaces that a user has the "manager" role with offset, limit.
        Parameters:
        userId -
        offset -
        limit -
        Returns:
        a list of the manager spaces with offset, limit
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getManagerSpacesByFilter

        List<Space> getManagerSpacesByFilter​(String userId,
                                             SpaceFilter spaceFilter,
                                             long offset,
                                             long limit)
        Gets the manager spaces of the user id by the filter with offset, limit.
        Parameters:
        userId -
        spaceFilter -
        offset -
        limit -
        Returns:
        Since:
        1.2.0-GA
      • getMemberSpacesCount

        int getMemberSpacesCount​(String userId)
                          throws SpaceStorageException
        Gets the count of the spaces that a user has the "member" role.
        Parameters:
        userId -
        Returns:
        the count of the member spaces
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getMemberSpacesByFilterCount

        int getMemberSpacesByFilterCount​(String userId,
                                         SpaceFilter spaceFilter)
        Gets the count of the spaces which user has "member" role by filter.
        Parameters:
        userId -
        spaceFilter -
        Returns:
        Since:
        1.2.0-GA
      • getMemberSpaces

        List<Space> getMemberSpaces​(String userId,
                                    long offset,
                                    long limit)
                             throws SpaceStorageException
        Gets the spaces that a user has the "member" role with offset, limit.
        Parameters:
        userId -
        offset -
        limit -
        Returns:
        a list of the member spaces with offset, limit
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getMemberSpacesByFilter

        List<Space> getMemberSpacesByFilter​(String userId,
                                            SpaceFilter spaceFilter,
                                            long offset,
                                            long limit)
        Gets the member spaces of the user id by the filter with offset, limit.
        Parameters:
        userId -
        spaceFilter -
        offset -
        limit -
        Returns:
        Since:
        1.2.0-GA
      • getPendingSpacesCount

        int getPendingSpacesCount​(String userId)
                           throws SpaceStorageException
        Gets the count of the pending spaces of the userId.
        Parameters:
        userId -
        Returns:
        the count of the pending spaces
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getPendingSpacesByFilterCount

        int getPendingSpacesByFilterCount​(String userId,
                                          SpaceFilter spaceFilter)
        Gets the count of the pending spaces of the user by space filter.
        Parameters:
        userId -
        spaceFilter -
        Returns:
        Since:
        1.2.0-GA
      • getPendingSpaces

        List<Space> getPendingSpaces​(String userId,
                                     long offset,
                                     long limit)
                              throws SpaceStorageException
        Gets a user's pending spaces and that the user can revoke that request with offset, limit.
        Parameters:
        userId -
        offset -
        limit -
        Returns:
        a list of the pending spaces with offset, limit
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getPendingSpacesByFilter

        List<Space> getPendingSpacesByFilter​(String userId,
                                             SpaceFilter spaceFilter,
                                             long offset,
                                             long limit)
        Gets the pending spaces of the user by space filter with offset, limit.
        Parameters:
        userId -
        spaceFilter -
        offset -
        limit -
        Returns:
        Since:
        1.2.0-GA
      • getInvitedSpacesCount

        int getInvitedSpacesCount​(String userId)
                           throws SpaceStorageException
        Gets the count of the invited spaces of the userId.
        Parameters:
        userId -
        Returns:
        the count of the invited spaces
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getInvitedSpacesByFilterCount

        int getInvitedSpacesByFilterCount​(String userId,
                                          SpaceFilter spaceFilter)
        Gets the count of the invited spaces of the user by filter.
        Parameters:
        userId -
        spaceFilter -
        Returns:
        Since:
        1.2.0-GA
      • getInvitedSpaces

        List<Space> getInvitedSpaces​(String userId,
                                     long offset,
                                     long limit)
                              throws SpaceStorageException
        Gets a user's invited spaces and that user can accept or deny the request with offset, limit.
        Parameters:
        userId -
        offset -
        limit -
        Returns:
        a list of the invited spaces with offset, limit
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getInvitedSpacesByFilter

        List<Space> getInvitedSpacesByFilter​(String userId,
                                             SpaceFilter spaceFilter,
                                             long offset,
                                             long limit)
        Gets the invited spaces of the user by space filter with offset, limit.
        Parameters:
        userId -
        spaceFilter -
        offset -
        limit -
        Returns:
        Since:
        1.2.0-GA
      • getPublicSpacesCount

        int getPublicSpacesCount​(String userId)
                          throws SpaceStorageException
        Gets the count of the public spaces of the userId.
        Parameters:
        userId -
        Returns:
        the count of the spaces in which the user can request to join
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getPublicSpacesByFilterCount

        int getPublicSpacesByFilterCount​(String userId,
                                         SpaceFilter spaceFilter)
        Gets the count of the public spaces of the user by space filter.
        Parameters:
        userId -
        spaceFilter -
        Returns:
        Since:
        1.2.0-GA
      • getPublicSpacesByFilter

        List<Space> getPublicSpacesByFilter​(String userId,
                                            SpaceFilter spaceFilter,
                                            long offset,
                                            long limit)
        Gets the public spaces of the user by filter with offset, limit.
        Parameters:
        userId -
        spaceFilter -
        offset -
        limit -
        Returns:
        Since:
        1.2.0-GA
      • getPublicSpaces

        List<Space> getPublicSpaces​(String userId,
                                    long offset,
                                    long limit)
                             throws SpaceStorageException
        Gets a user's public spaces and that user can request to join with offset, limit.
        Parameters:
        userId -
        offset -
        limit -
        Returns:
        spaces list in which the user can request to join with offset, limit
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getAccessibleSpacesCount

        int getAccessibleSpacesCount​(String userId)
                              throws SpaceStorageException
        Gets the count of the accessible spaces of the userId.
        Parameters:
        userId -
        Returns:
        the count of the accessible spaces
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getUnifiedSearchSpacesCount

        int getUnifiedSearchSpacesCount​(String userId,
                                        SpaceFilter spaceFilter)
                                 throws SpaceStorageException
        Provides Unified Search to get the count of the visible spaces of the userId.
        Parameters:
        userId -
        spaceFilter -
        Returns:
        Throws:
        SpaceStorageException
        Since:
        4.0.0-GA
      • getAccessibleSpacesByFilterCount

        int getAccessibleSpacesByFilterCount​(String userId,
                                             SpaceFilter spaceFilter)
        Gets the count of the accessible spaces of the user by filter.
        Parameters:
        userId -
        spaceFilter -
        Returns:
        Since:
        1.2.0-GA
      • getUnifiedSearchSpaces

        List<Space> getUnifiedSearchSpaces​(String userId,
                                           SpaceFilter spaceFilter,
                                           long offset,
                                           long limit)
                                    throws SpaceStorageException
        Provides Unified Search to get the spaces of a user which that user has the visible spaces.
        Parameters:
        userId - the userId
        Returns:
        a list of the accessible spaces
        Throws:
        SpaceStorageException
        Since:
        4.0.0-GA
      • getAccessibleSpaces

        List<Space> getAccessibleSpaces​(String userId,
                                        long offset,
                                        long limit)
                                 throws SpaceStorageException
        Gets the spaces of a user which that user has "member" role or edit permission with offset, limit.
        Parameters:
        userId - the userId
        offset -
        limit -
        Returns:
        a list of the accessible space with offset, limit
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getAccessibleSpacesByFilter

        List<Space> getAccessibleSpacesByFilter​(String userId,
                                                SpaceFilter spaceFilter,
                                                long offset,
                                                long limit)
        Gets the accessible spaces of the user by filter with offset, limit.
        Parameters:
        userId -
        spaceFilter -
        offset -
        limit -
        Returns:
        Since:
        1.2.0-GA
      • getEditableSpacesCount

        int getEditableSpacesCount​(String userId)
                            throws SpaceStorageException
        Gets the count of the spaces of a user which that user has the edit permission.
        Parameters:
        userId -
        Returns:
        the count of the editable spaces.
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getEditableSpacesByFilterCount

        int getEditableSpacesByFilterCount​(String userId,
                                           SpaceFilter spaceFilter)
        Gets the count of the editable spaces of the user by filter.
        Parameters:
        userId -
        spaceFilter -
        Returns:
        Since:
        1.2.0-GA
      • getEditableSpaces

        List<Space> getEditableSpaces​(String userId,
                                      long offset,
                                      long limit)
                               throws SpaceStorageException
        Gets the spaces of a user which that user has the edit permission with offset, limit.
        Parameters:
        userId -
        offset -
        limit -
        Returns:
        a list of the spaces with offset, limit
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getEditableSpacesByFilter

        List<Space> getEditableSpacesByFilter​(String userId,
                                              SpaceFilter spaceFilter,
                                              long offset,
                                              long limit)
        Gets the editable spaces of the user by filter with offset, limit.
        Parameters:
        userId -
        spaceFilter -
        offset -
        limit -
        Returns:
        Since:
        1.2.0-GA
      • getAllSpacesByFilterCount

        int getAllSpacesByFilterCount​(SpaceFilter spaceFilter)
        Gets the count of the spaces which are searched by space filter.
        Parameters:
        spaceFilter -
        Returns:
        Since:
        1.2.0-GA
      • getSpaces

        List<Space> getSpaces​(long offset,
                              long limit)
                       throws SpaceStorageException
        Gets the spaces with offset, limit.
        Parameters:
        offset -
        limit -
        Returns:
        the list of the spaces with offset, limit
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getSpacesByFilter

        List<Space> getSpacesByFilter​(SpaceFilter spaceFilter,
                                      long offset,
                                      long limit)
        Gets the spaces by space filter with offset, limit.
        Parameters:
        spaceFilter -
        offset -
        limit -
        Returns:
        Throws:
        SpaceStorageException
      • getSpaceSimpleById

        Space getSpaceSimpleById​(String id)
                          throws SpaceStorageException
        Gets a space simple by its space id to aim decrease workload to get full information. It's only to get a little space information such as displayName, groupId, prettyName description, id, avatar ..
        Parameters:
        id -
        Returns:
        space with id specified
        Throws:
        SpaceStorageException
      • getSpaceByPrettyName

        Space getSpaceByPrettyName​(String spacePrettyName)
                            throws SpaceStorageException
        Gets a space by its pretty name.
        Parameters:
        spacePrettyName -
        Returns:
        the space with spacePrettyName that matches spacePrettyName input.
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getSpaceByGroupId

        Space getSpaceByGroupId​(String groupId)
                         throws SpaceStorageException
        Gets a space by its associated group id.
        Parameters:
        groupId -
        Returns:
        the space that has group id matching the groupId string input.
        Throws:
        SpaceStorageException
        Since:
        1.2.0-GA
      • getNumberOfMemberPublicSpaces

        int getNumberOfMemberPublicSpaces​(String userId)
        Gets the count of the public spaces of the userId.
        Parameters:
        userId -
        Returns:
        number of public space of a user where he is member
        Since:
        4.0.0.Beta01
      • getLastSpaces

        List<Space> getLastSpaces​(int limit)
        Gets the last spaces that have been created.
        Parameters:
        limit - the limit of spaces to provide.
        Returns:
        The last spaces.
        Since:
        4.0.x
        eXo level API
        Experimental
      • countPendingSpaceRequestsToManage

        default int countPendingSpaceRequestsToManage​(String username)
        Parameters:
        username - username used to retrieve user spaces
        Returns:
        the count of users requested to join spaces that user manages
      • getPendingSpaceRequestsToManage

        default List<Space> getPendingSpaceRequestsToManage​(String username,
                                                            int offset,
                                                            int limit)
        Parameters:
        username - username used to retrieve user spaces
        offset - offset of the query
        limit - limit of the query
        Returns:
        List of Space with pending users requesting to join spaces that the designated user manages
      • countExternalMembers

        default int countExternalMembers​(Long spaceId)
        Counts the number of external users in a specific space
        Parameters:
        spaceId -
        Returns:
        counts the external members in the space
      • getCommonSpaces

        default List<Space> getCommonSpaces​(String userId,
                                            String otherUserId,
                                            int offset,
                                            int limit)
        Get common spaces between two users
        Parameters:
        userId - connected user id
        otherUserId - visited profile user id
        Returns:
        list of common spaces between two users in param
      • countCommonSpaces

        default int countCommonSpaces​(String userId,
                                      String otherUserId)
        Count common spaces between two users
        Parameters:
        userId - connected user id
        otherUserId - visited profile user id
        Returns:
        list of common spaces between two users in param