Class ReadOnlySpaceManager

java.lang.Object
com.atlassian.confluence.spaces.ReadOnlySpaceManager
All Implemented Interfaces:
SpaceManager

public class ReadOnlySpaceManager extends Object implements SpaceManager
  • Constructor Details

    • ReadOnlySpaceManager

      public ReadOnlySpaceManager(SpaceManager delegate)
  • Method Details

    • createSpace

      public @NonNull Space createSpace(String key, String name, @Nullable String description, com.atlassian.user.User creator)
      Specified by:
      createSpace in interface SpaceManager
    • createPersonalSpace

      public @NonNull Space createPersonalSpace(String name, @Nullable String description, com.atlassian.user.User owner)
      Description copied from interface: SpaceManager
      Creates a personal space. The difference to a normal space are that this space will have a type "personal" and the user passed to this space should not be the creator, but is the owner of the space.
      Specified by:
      createPersonalSpace in interface SpaceManager
    • createPrivatePersonalSpace

      public @NonNull Space createPrivatePersonalSpace(String name, @Nullable String description, com.atlassian.user.User owner)
      Description copied from interface: SpaceManager
      Create a personal Space for which only the creator has any permissions
      Specified by:
      createPrivatePersonalSpace in interface SpaceManager
    • createSpace

      public @NonNull Space createSpace(Space space)
      Specified by:
      createSpace in interface SpaceManager
    • createPrivateSpace

      public @NonNull Space createPrivateSpace(String key, String name, @Nullable String description, com.atlassian.user.User creator)
      Description copied from interface: SpaceManager
      Creates a Space for which only the creator has any permissions
      Specified by:
      createPrivateSpace in interface SpaceManager
    • saveSpace

      public void saveSpace(Space space)
      Specified by:
      saveSpace in interface SpaceManager
    • saveSpace

      public void saveSpace(Space space, Space originalSpace)
      Specified by:
      saveSpace in interface SpaceManager
    • removeSpace

      public @NonNull Boolean removeSpace(Space space)
      Description copied from interface: SpaceManager
      Removes a space with a given space.

      Delegates to SpaceManager.removeSpace(String, com.atlassian.core.util.ProgressMeter).

      Specified by:
      removeSpace in interface SpaceManager
      Parameters:
      space - the key of the space to remove
      Returns:
      true if the space was successfully removed.
    • removeSpace

      public @NonNull Boolean removeSpace(String spaceKey)
      Description copied from interface: SpaceManager
      Removes a space with a given spaceKey (case sensitive).

      Delegates to SpaceManager.removeSpace(String, com.atlassian.core.util.ProgressMeter).

      Specified by:
      removeSpace in interface SpaceManager
      Parameters:
      spaceKey - the key of the space to remove
      Returns:
      true if the space was successfully removed.
    • removeSpace

      public @NonNull Boolean removeSpace(String spaceKey, com.atlassian.core.util.ProgressMeter progressMeter)
      Description copied from interface: SpaceManager
      Removes a space with a given spaceKey (case sensitive). This must be passed a progress monitor which will be updated with internationalised status while the space is being removed. Ideally this should be done from a long running task, since it can be very slow and it clears the current Hibernate session.
      Specified by:
      removeSpace in interface SpaceManager
      Parameters:
      spaceKey - the key of the space to remove
      progressMeter - will be updated with status messages and percentage completed. Not Null.
      Returns:
      true if the space was successfully removed.
    • removeSpacesInGroup

      public void removeSpacesInGroup(SpaceGroup spaceGroup)
      Specified by:
      removeSpacesInGroup in interface SpaceManager
    • getSpace

      public @Nullable Space getSpace(long id)
      Description copied from interface: SpaceManager
      Retrieve a space by its ID. The space can be of any type.
      Specified by:
      getSpace in interface SpaceManager
      Parameters:
      id - the ID of the space
      Returns:
      the space, or null if no space exists with that id.
    • getSpace

      public @Nullable Space getSpace(@Nullable String spaceKey)
      Description copied from interface: SpaceManager
      Retrieve a space by its key. The space can be of any type.
      Specified by:
      getSpace in interface SpaceManager
      Parameters:
      spaceKey - the space key of the space to retrieve
      Returns:
      the space, or null if no space exists with that key
    • getPersonalSpace

      public @Nullable Space getPersonalSpace(@Nullable ConfluenceUser user)
      Description copied from interface: SpaceManager
      Get the personal space of the given user.
      Specified by:
      getPersonalSpace in interface SpaceManager
      Parameters:
      user - the user to get the space for. If user is null, the method will return null
      Returns:
      the personal space of the user if one exists, otherwise null.
    • getAllSpaces

      public @NonNull List<Space> getAllSpaces()
      Description copied from interface: SpaceManager
      Finds all spaces in Confluence, of any type, sorted alphabetically by space name.
      Specified by:
      getAllSpaces in interface SpaceManager
      Returns:
      List of spaces
    • getSpacesContainingPagesEditedBy

      public @NonNull List getSpacesContainingPagesEditedBy(@Nullable ConfluenceUser user)
      Description copied from interface: SpaceManager
      Returns Pages that are either created or edited by the specified user
      Specified by:
      getSpacesContainingPagesEditedBy in interface SpaceManager
      Returns:
      Pages that are either created or edited by the specified user
    • getSpacesContainingCommentsBy

      public @NonNull List getSpacesContainingCommentsBy(@Nullable ConfluenceUser user)
      Specified by:
      getSpacesContainingCommentsBy in interface SpaceManager
    • getAuthoredSpacesByUser

      public @NonNull List getAuthoredSpacesByUser(@Nullable ConfluenceUser user)
      Specified by:
      getAuthoredSpacesByUser in interface SpaceManager
    • findPageTotal

      public long findPageTotal(Space space)
      Description copied from interface: SpaceManager
      Get the number of pages in a space. This counts all pages, including non-current versions, and including pages that are in the trash. As such, it probably doesn't do what you think it does.
      Specified by:
      findPageTotal in interface SpaceManager
      Parameters:
      space - the space to count pages in
      Returns:
      the number of pages in that space
    • getNumberOfBlogPosts

      public int getNumberOfBlogPosts(Space space)
      Description copied from interface: SpaceManager
      Get the number of blog posts in a space. This counts all news, including non-current versions, and including news that is in the trash. As such, it probably doesn't do what you think it does.
      Specified by:
      getNumberOfBlogPosts in interface SpaceManager
      Parameters:
      space - the space to count pages in
      Returns:
      the number of blog posts (news items) in that space
    • getSpaceFromPageId

      public @Nullable String getSpaceFromPageId(long pageId)
      Description copied from interface: SpaceManager
      Get the key for a space from its pageId in a single db call
      Specified by:
      getSpaceFromPageId in interface SpaceManager
      Parameters:
      pageId - the id of the page to look for
      Returns:
      the key for the space containing the given page
    • getSpacesCreatedAfter

      public @NonNull List<Space> getSpacesCreatedAfter(Date creationDate)
      Specified by:
      getSpacesCreatedAfter in interface SpaceManager
    • ensureSpaceDescriptionExists

      public void ensureSpaceDescriptionExists(Space space)
      Description copied from interface: SpaceManager
      If the given Space does not have a description, creates one for it, and saves it.

      This is required for CONF-4080, because labels on a Space are attached to a Space Description.

      Specified by:
      ensureSpaceDescriptionExists in interface SpaceManager
      Parameters:
      space - an existing space. Not null.
    • getLogoForSpace

      public @NonNull SpaceLogo getLogoForSpace(@Nullable String spaceKey)
      Specified by:
      getLogoForSpace in interface SpaceManager
    • getLogoForGlobalcontext

      public @NonNull SpaceLogo getLogoForGlobalcontext()
      Specified by:
      getLogoForGlobalcontext in interface SpaceManager
    • getSpaces

      public @NonNull ListBuilder<Space> getSpaces(SpacesQuery query)
      Description copied from interface: SpaceManager
      Get a list of spaces specified by the SpacesQuery limited by the offset and maxResults.
      Specified by:
      getSpaces in interface SpaceManager
    • getAllSpaces

      public @NonNull List<Space> getAllSpaces(SpacesQuery query)
      Description copied from interface: SpaceManager
      Get a list of spaces specified by the SpacesQuery. Any code that calls this method is a potential performance problem. The method may be deprecated and removed in a future version of Confluence. Use SpaceManager.getSpaces(SpacesQuery) to retrieve pages of results instead.
      Specified by:
      getAllSpaces in interface SpaceManager
    • getSpaceAdmins

      public @NonNull List<com.atlassian.user.User> getSpaceAdmins(Space spaces)
      Description copied from interface: SpaceManager
      Returns a list of administrators for a given space, sorted by full name
      Specified by:
      getSpaceAdmins in interface SpaceManager
    • getSpaceAdmins

      public @NonNull List<com.atlassian.user.User> getSpaceAdmins(Space spaces, int limit)
      Description copied from interface: SpaceManager
      Returns a list of administrators for a given space, sorted by full name, up to the size limit
      Specified by:
      getSpaceAdmins in interface SpaceManager
    • archiveSpace

      public void archiveSpace(Space space)
      Description copied from interface: SpaceManager
      Archive the space. Archived spaces are removed from various lists and search results to unclutter the user interface. If the space is archived, this method does nothing.
      Specified by:
      archiveSpace in interface SpaceManager
      Parameters:
      space - the space to archive.
    • unarchiveSpace

      public void unarchiveSpace(Space space)
      Description copied from interface: SpaceManager
      Un-archive the space. If the space is already un-archived, this method does nothing.
      Specified by:
      unarchiveSpace in interface SpaceManager
      Parameters:
      space - the space to archive.
    • getAllSpaceKeys

      public @NonNull Collection<String> getAllSpaceKeys(SpaceStatus status)
      Description copied from interface: SpaceManager
      Get the space keys of all spaces with the given status.
      Specified by:
      getAllSpaceKeys in interface SpaceManager
      Parameters:
      status - the status to search for
      Returns:
      the keys of all spaces with that status.