Package com.atlassian.confluence.pages
Class DefaultTrashManager
java.lang.Object
com.atlassian.confluence.pages.DefaultTrashManager
- All Implemented Interfaces:
- TrashManagerInternal,- TrashManager
This class provides utility methods for operating on the Trash
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultTrashManager(ContentEntityObjectDaoInternal contentEntityObjectDao, ContentEntityManager contentEntityManager, CustomContentManager customContentManager, org.springframework.transaction.PlatformTransactionManager transactionManager, PageManager pageManager, com.atlassian.event.api.EventPublisher eventPublisher, AttachmentManager attachmentManager, BandanaManagerInternal bandanaManager, PaginationService paginationService) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidemptyTrash(Space space) Purge all of the trash in a given space.findTrashDate(Content content) Trash date is only available since Confluence 7.14.Trash date is only available since Confluence 7.14.intgetNumberOfItemsInTrash(Space space) Retrieve the total number of items in the trash for a given space.getTrashContents(Space space, int offset, int count) Retrieve a subset of the contents of the trash for a particular space.getTrashContents(String spaceKey, LimitedRequest request) Retrieve a subset of the contents of the trash for a particular space.All items that have been added to the trash before Confluence 7.14 don't have actual trash date.getTrashedEntities(long contentIdOffset, int limit) Fetch a batch of trashed content entitiesvoidmigrateTrashDate(String spaceKey, Instant trashTime) Add trash date to existing items in the trash for a spacevoidmigrateTrashDate(Instant trashTime) Add trash date to all existing items in the trashvoidonSpaceRemoval(SpaceRemoveEvent event) booleanRemove one item from the trash.voidpurge(List<SpaceContentEntityObject> trashEntities) Delete a list of trashed entities
- 
Constructor Details- 
DefaultTrashManagerpublic DefaultTrashManager(ContentEntityObjectDaoInternal contentEntityObjectDao, ContentEntityManager contentEntityManager, CustomContentManager customContentManager, org.springframework.transaction.PlatformTransactionManager transactionManager, PageManager pageManager, com.atlassian.event.api.EventPublisher eventPublisher, AttachmentManager attachmentManager, BandanaManagerInternal bandanaManager, PaginationService paginationService) 
 
- 
- 
Method Details- 
emptyTrashDescription copied from interface:TrashManagerPurge all of the trash in a given space.- Specified by:
- emptyTrashin interface- TrashManager
- Parameters:
- space-
 
- 
getNumberOfItemsInTrashDescription copied from interface:TrashManagerRetrieve the total number of items in the trash for a given space.- Specified by:
- getNumberOfItemsInTrashin interface- TrashManager
- Parameters:
- space- @return the number of items in the trash for that space
 
- 
purgeDescription copied from interface:TrashManagerRemove 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- Specified by:
- purgein interface- TrashManager
- 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
 
- 
getTrashContentsDescription copied from interface:TrashManagerRetrieve a subset of the contents of the trash for a particular space.- Specified by:
- getTrashContentsin interface- TrashManager
- 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
 
- 
getTrashContentsDescription copied from interface:TrashManagerRetrieve a subset of the contents of the trash for a particular space.- Specified by:
- getTrashContentsin interface- TrashManager
- 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
 
- 
migrateTrashDateDescription copied from interface:TrashManagerInternalAdd trash date to all existing items in the trash- Specified by:
- migrateTrashDatein interface- TrashManagerInternal
- Parameters:
- trashTime- timestamp to use as trash date
 
- 
migrateTrashDateDescription copied from interface:TrashManagerInternalAdd trash date to existing items in the trash for a space- Specified by:
- migrateTrashDatein interface- TrashManagerInternal
- Parameters:
- spaceKey- key of the space to apply trash date
- trashTime- timestamp to use as trash date
 
- 
onSpaceRemoval
- 
getTrashDateMigrationTimeDescription copied from interface:TrashManagerAll 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.- Specified by:
- getTrashDateMigrationTimein interface- TrashManager
- 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.
 
- 
findTrashDateDescription copied from interface:TrashManagerInternalTrash date is only available since Confluence 7.14. The rules to determine effective trash date for a content entity in general is: 1. If it is not in trash, trash date will beOptional.empty()2. If it has a contentproperty namedtrash-date, trash date will betrash-date3. If it belongs to a space which has a trash-date set in bandana, trash date will be that value 4. If there is a global trash-date set in bandana, trash date will be that value 5. Otherwise, trash date will beOptional.empty()- Specified by:
- findTrashDatein interface- TrashManagerInternal
- Parameters:
- ceo- a content entity object to determine trash date
- Returns:
- when ceowas added to the trash if that data is available
 
- 
findTrashDateDescription copied from interface:TrashManagerInternalTrash date is only available since Confluence 7.14. The rules to determine effective trash date for a content entity in general is: 1. If it is not in trash, trash date will beOptional.empty()2. If it has a contentproperty namedtrash-date, trash date will betrash-date3. If it belongs to a space which has a trash-date set in bandana, trash date will be that value 4. If there is a global trash-date set in bandana, trash date will be that value 5. Otherwise, trash date will beOptional.empty()- Specified by:
- findTrashDatein interface- TrashManagerInternal
- Parameters:
- content- a com.atlassian.confluence.api.model.content.Content to determine trash date
- Returns:
- when contentwas added to the trash if that data is available
 
- 
getTrashedEntitiesDescription copied from interface:TrashManagerInternalFetch a batch of trashed content entities- Specified by:
- getTrashedEntitiesin interface- TrashManagerInternal
- Parameters:
- contentIdOffset- ids of returned entities must be greater than or equal to this value
- limit- maximum number of entities to return
 
- 
purgeDescription copied from interface:TrashManagerInternalDelete a list of trashed entities- Specified by:
- purgein interface- TrashManagerInternal
- Parameters:
- trashEntities- trashed entities to be deleted from trash
 
 
-