Interface RemoteSpaceService

All Known Implementing Classes:
RemoteSpaceServiceImpl

@ExperimentalApi public interface RemoteSpaceService
SpaceService implementation that communicates with Confluence remotely using the Confluence REST api.

Provides future returning equivalents for the methods in SpaceService.

  • Method Details

    • createCompletionStage

      CompletionStage<Space> createCompletionStage(Space newSpace, boolean isPrivate) throws ServiceException
      Create a new space.

      Minimum properties to be valid is a key and name.

      Parameters:
      newSpace - the space to create
      isPrivate - true if the space should only be visible to its creator
      Returns:
      the space created
      Throws:
      ServiceException - if the space cannot be created
      Since:
      9.0
    • createPersonalSpaceForSelf

      CompletionStage<Space> createPersonalSpaceForSelf(PersonalSpaceDetailsForCreation spaceDetails) throws ServiceException
      Create a personal space for self.

      If the "isPrivate" flag is set to true the personal space will only be visible to the owner.

      Parameters:
      spaceDetails - Details of a Personal Space to be created
      Returns:
      the space created
      Throws:
      ServiceException - if the space cannot be created
      Since:
      9.3.0
    • createPersonalSpaceForUser

      CompletionStage<Space> createPersonalSpaceForUser(PersonalSpaceDetailsForCreation spaceDetails, String username) throws ServiceException
      Create a personal space for a user by username.

      If the "isPrivate" flag is set to true the personal space will only be visible to the owner.

      Parameters:
      spaceDetails - Details of a Personal Space to be created
      username - Username of the user to create personal space for
      Returns:
      the space created
      Throws:
      ServiceException - if the space cannot be created
      Since:
      9.3.0
    • updateCompletionStage

      CompletionStage<Space> updateCompletionStage(Space space) throws ServiceException
      Updates a space.

      Currently limited to changing the space name, description and homepage.

      Parameters:
      space - the updated Space
      Returns:
      the updated space after being persisted
      Throws:
      ServiceException
      Since:
      9.0
    • find

    • findAllContentLabelsPaginated

      CompletionStage<PageResponse<Label>> findAllContentLabelsPaginated(String spaceKey, PageRequest pageRequest)
      Returns a paginated list of all Labels used by Content within the given Space.
      Parameters:
      spaceKey - the key of the Space the User is attempting to search.
      pageRequest - the pagination parameters.
      Returns:
      Paginated list of labels.
      Since:
      9.0
    • findPopularContentLabelsPaginated

      CompletionStage<PageResponse<Label>> findPopularContentLabelsPaginated(String spaceKey, PageRequest pageRequest)
      Returns a paginated list of the popular Labels used by Content within the given Space.
      Parameters:
      spaceKey - the key of the Space the User is attempting to search.
      pageRequest - the pagination parameters.
      Returns:
      Paginated list of labels.
      Since:
      9.0
    • findRecentContentLabelsPaginated

      CompletionStage<PageResponse<Label>> findRecentContentLabelsPaginated(String spaceKey, PageRequest pageRequest)
      Returns a paginated list of the recent Labels used by Content within the given Space.
      Parameters:
      spaceKey - the key of the Space the User is attempting to search.
      pageRequest - the pagination parameters.
      Returns:
      Paginated list of labels.
      Since:
      9.0
    • findRelatedContentLabelsPaginated

      CompletionStage<PageResponse<Label>> findRelatedContentLabelsPaginated(String spaceKey, String labelName, PageRequest pageRequest)
      Returns a paginated list of related Labels used by Content within the given Space. A Label is defined as being related to another when it is found attached to the same Content as the Label specified in the request.
      Parameters:
      spaceKey - the key of the Space the User is attempting to search.
      labelName - the Label to match on.
      pageRequest - the pagination parameters.
      Returns:
      Paginated list of labels.
      Since:
      9.0
    • archive

      CompletionStage<Void> archive(String spaceKey)
      Archives a space. If the space is already archived, this method does nothing.
      Parameters:
      spaceKey -
      Since:
      9.0 .0
    • restore

      CompletionStage<Void> restore(String spaceKey)
      Un-archives a space. If the space is already unarchived, this method does nothing.
      Parameters:
      spaceKey -
      Since:
      9.0 .0
    • emptyTrash

      CompletionStage<Void> emptyTrash(String spaceKey) throws ServiceException
      Purge all the trash in a given space.
      Parameters:
      spaceKey - the key of the space to empty trash
      Throws:
      ServiceException
      Since:
      9.2.5
    • validator

      Get the validator view of the Space Service.
    • findContent

      RemoteSpaceService.RemoteSpaceContentFinder findContent(Space space, Expansion... expansion)
      Create a finder to find content in the given space. Content will be returned upon calling one of the fetch methods on the returned finder
      Parameters:
      space - - the space to fetch content for
      expansion - - the expansions to apply to the content in this space
      Returns:
      a new space content finder with the space and expansions set
    • deleteCompletionStage

      CompletionStage<LongTaskSubmission> deleteCompletionStage(Space spaceToDelete)
      Delete the given space.

      The deletion happens asynchronously so a LongTaskSubmission is returned, that can be used to request status.

      Parameters:
      spaceToDelete - the space to delete
      Returns:
      a LongTaskStatus describing the space-removal operation
      Throws:
      NotFoundException - if the space does not exist or you do not have permission to view it
      PermissionException - if you do not have permission to delete the space
    • deleteCompletionStage

      CompletionStage<Void> deleteCompletionStage(long spaceId)
      Deletes space. It removes space permissions and rename the space key, so the space key can be re-used immediately. Alter that, all remaining space content will be removed in background. Neither instance restart nor problems with the database will not prevent data deletion. It will not leave partial data in the database.
      Parameters:
      spaceId - space id
      Throws:
      NotFoundException - if the space does not exist or you do not have permission to view it
      PermissionException - if you do not have permission to delete the space
      Since:
      9.1.0
    • deleteSynchronouslyCompletionStage

      CompletionStage<Void> deleteSynchronouslyCompletionStage(long spaceId)
      Deletes space synchronously. It is NOT RECOMMENDED to use in production code, this method should be used in tests to remove space data quickly. Using regular space deletion is not recommended in tests because while one test is being running, data from the previous test could be still being deleted. It could be a source of flakiness. Instance restart will interrupt the process, so some space content can remain in the database.
      Parameters:
      spaceId - space id
      Throws:
      NotFoundException - if the space does not exist or you do not have permission to view it
      PermissionException - if you do not have permission to delete the space
      Since:
      9.1.0