Class SpaceServiceImpl

java.lang.Object
com.atlassian.confluence.api.impl.service.content.SpaceServiceImpl
All Implemented Interfaces:
SpaceService

public class SpaceServiceImpl extends Object implements SpaceService
  • Constructor Details

  • Method Details

    • create

      public Space create(Space space, boolean isPrivate) throws ServiceException
      Description copied from interface: SpaceService
      Create a new space.

      If the "isPrivate" flag is set to true the new space will only be visible to the creator.

      Minimum properties to be valid is a key and name.

      Specified by:
      create in interface SpaceService
      Parameters:
      space - the space to create
      isPrivate - whether the space is private (true) or has default permissions (false)
      Returns:
      the space created
      Throws:
      ServiceException - if the space cannot be created
    • delete

      public LongTaskSubmission delete(Space spaceToDelete) throws ServiceException
      Description copied from interface: SpaceService
      Delete the given space.

      The deletion happens asynchronously so a LongTaskStatus is returned, that can be used to track progress.

      Specified by:
      delete in interface SpaceService
      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
      ServiceException
    • find

      public SpaceService.SpaceFinder find(Expansion... expansions)
      Description copied from interface: SpaceService
      Create a space finder to locate spaces, the expansions will be applied to each Space matching the restrictions on the finder. Restrictions can be applied to the finder using the appropriate withFoo() method

      For example:

       spaceService.find()
            .withKeys("DEV","PROD")
            .fetchMany(new SimplePageRequest(0, 10);
       
       
      Specified by:
      find in interface SpaceService
      Parameters:
      expansions - - the expansion to apply to each fetched space
      Returns:
      a new SpaceFinder
    • archive

      public void archive(String spaceKey)
      Description copied from interface: SpaceService
      Archives a space. If the space is already archived, this method does nothing.
      Specified by:
      archive in interface SpaceService
      Parameters:
      spaceKey - the key of the space to archive
    • restore

      public void restore(String spaceKey)
      Description copied from interface: SpaceService
      Un-archives a space. If the space is already unarchived, this method does nothing.
      Specified by:
      restore in interface SpaceService
      Parameters:
      spaceKey - the key of the space to restore
    • update

      public Space update(Space space) throws ServiceException
      Description copied from interface: SpaceService
      Updates a space.

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

      Specified by:
      update in interface SpaceService
      Parameters:
      space - the updated Space
      Returns:
      the updated space after being persisted
      Throws:
      ServiceException
    • findAllContentLabelsPaginated

      public PageResponse<Label> findAllContentLabelsPaginated(String spaceKey, PageRequest pageRequest)
      Description copied from interface: SpaceService
      Returns a paginated list of all Labels used by Content within the given Space.
      Specified by:
      findAllContentLabelsPaginated in interface SpaceService
      Parameters:
      spaceKey - the key of the Space the User is attempting to search.
      pageRequest - the pagination parameters.
      Returns:
      Paginated list of labels.
    • findPopularContentLabelsPaginated

      public PageResponse<Label> findPopularContentLabelsPaginated(String spaceKey, PageRequest pageRequest)
      Description copied from interface: SpaceService
      Returns a paginated list of the most popular Labels used by Content within the given Space.
      Specified by:
      findPopularContentLabelsPaginated in interface SpaceService
      Parameters:
      spaceKey - the key of the Space the User is attempting to search.
      pageRequest - the pagination parameters.
      Returns:
      Paginated list of labels.
    • findContent

      public SpaceService.SpaceContentFinder findContent(Space space, Expansion... expansions) throws NotFoundException
      Description copied from interface: SpaceService
      A finder to locate content in the space
      Specified by:
      findContent in interface SpaceService
      Returns:
      a finder
      Throws:
      NotFoundException - if the space does not exist or you do not have permission to view it
    • findRecentContentLabelsPaginated

      public PageResponse<Label> findRecentContentLabelsPaginated(String spaceKey, PageRequest pageRequest)
      Description copied from interface: SpaceService
      Returns a paginated list of the most recent Labels used by Content within the given Space.
      Specified by:
      findRecentContentLabelsPaginated in interface SpaceService
      Parameters:
      spaceKey - the key of the Space the User is attempting to search.
      pageRequest - the pagination parameters.
      Returns:
      Paginated list of labels.
    • findRelatedContentLabelsPaginated

      public PageResponse<Label> findRelatedContentLabelsPaginated(String spaceKey, String labelName, PageRequest pageRequest)
      Description copied from interface: SpaceService
      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.
      Specified by:
      findRelatedContentLabelsPaginated in interface SpaceService
      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.
    • validator

      public SpaceServiceImpl.ValidatorImpl validator()
      Description copied from interface: SpaceService
      Get the validator view of the Space Service.
      Specified by:
      validator in interface SpaceService