Interface TrashManager

All Known Subinterfaces:
TrashManagerInternal
All Known Implementing Classes:
DefaultTrashManager

@Transactional public interface TrashManager
Operations on the Trash
  • Method Details

    • emptyTrash

      void emptyTrash(Space space)
      Purge all of the trash in a given space.
      Parameters:
      space -
    • getNumberOfItemsInTrash

      @Transactional(readOnly=true) int getNumberOfItemsInTrash(Space spaceKeypace)
      Retrieve the total number of items in the trash for a given space.
      Parameters:
      spaceKeypace -
      Returns:
      the number of items in the trash for that space
    • purge

      boolean purge(String spaceKey, long contentId)
      Remove one item from the trash. If no content exists with the given ID, nothing will be done. If the content exists but is not in the trash, or does not belong to the correct space, an exception will be thrown
      Parameters:
      spaceKey - the space to purge the trash from
      contentId - the id of the item to remove from the trash @return true if content was purged, false if no content was found with that ID
      Returns:
      true if content was purged, false if no matching content was found
      Throws:
      IllegalStateException - if the content is not in the trash, or is in the wrong space
    • getTrashContents

      @Transactional(readOnly=true) List<ContentEntityObject> getTrashContents(Space space, int offset, int count)
      Retrieve a subset of the contents of the trash for a particular space.
      Parameters:
      space -
      offset - the offset of the first item to retrieve (0-based)
      count - the maximum number of items to retrieve
      Returns:
      the contents of the trash, up to the maximum number provided
    • getTrashContents

      @Transactional(readOnly=true) PageResponse<ContentEntityObject> getTrashContents(String spaceKey, LimitedRequest request)
      Retrieve a subset of the contents of the trash for a particular space.
      Parameters:
      spaceKey - the key of the space where the trash contents belong to
      request - the pagination request, with a cursor which is an identifier to skip results from a previous query when paginating and limit for the result
      Returns:
      the contents of the trash, up to the request limit
      Since:
      9.0
    • getTrashDateMigrationTime

      @Transactional(readOnly=true) Optional<Instant> getTrashDateMigrationTime()
      All items that have been added to the trash before Confluence 7.14 don't have actual trash date. For the purpose of retention rules, trash date of these items default to time when the concept of trash date is first introduced to this instance ie. the first time this instance is upgraded to Confluence 7.14 or later.
      Returns:
      default trash date for items added to the trash before Confluence 7.14 or Optional.empty() if this instance is freshly installed with Confluence 7.14 or later.
      Since:
      7.14