public interface EntityVersioningManager
| Modifier and Type | Method and Description |
|---|---|
long |
cleanAllDeletedEntityVersionsOlderThan(java.time.Duration duration)
Removes all entity version records (issues, comments, & worklogs) for entites marked as deleted and older than
duration. |
List<EntityVersion> |
findEntityVersionsUpdatedInTheLast(IndexDirectoryFactory.Name indexName,
java.time.Duration duration)
Looks up all the entities whose version changed during the last
duration amount of time. |
Optional<Long> |
getCommentVersion(long commentId)
Return the comment version for the comment identified by
commentId or Optional.empty() if there is no version. |
Optional<Long> |
getIssueVersion(long issueId)
Return the issue version for the issue identified by
issueId or Optional.empty() if there is no version. |
Optional<EntityVersion> |
getLatestEntityUpdate(IndexDirectoryFactory.Name indexName)
Looks up the Version & related info for the most recently modified entity version.
|
Map<Long,Optional<Long>> |
getLocalVersions(Set<Long> entityIds,
IndexDirectoryFactory.Name indexName)
Returns the corresponding entity version from the specified local lucene index for each of the ids passed in with
entityIds in
the form of a map of ids to versions. |
Map<Long,Long> |
getRelatedCommentVersions(long parentIssueId)
Return the comment versions for for all comments associated with the specified
parentIssueId. |
Map<Long,Long> |
getRelatedWorklogVersions(long parentIssueId)
Return the worklog versions for for all worklogs associated with the specified
parentIssueId. |
Optional<Long> |
getWorklogVersion(long worklogId)
Return the worklog version for the worklog identified by
worklogId or Optional.empty() if there is no version. |
void |
incrementCommentVersion(long commentId,
long parentIssueId)
Increments the version number for the specified comment.
|
void |
incrementIssueVersion(long issueId)
Increments the version number for the specified issue.
|
void |
incrementRelatedCommentVersions(long parentIssueId)
Bumps the versions for all comments associated with the specified
parentIssueId. |
void |
incrementRelatedWorklogVersions(long parentIssueId)
Bumps the versions for all worklogs associated with the specified
parentIssueId. |
void |
incrementWorklogVersion(long worklogId,
long parentIssueId)
Increments the version number for the specified worklog.
|
void |
markCommentDeletedAndIncrementVersion(long commentId)
Marks the specified comment as deleted and bumps its version by 1.
|
void |
markIssueDeletedAndIncrementVersion(long issueId)
Marks the specified issue and all its related comments and worklogs as deleted bumps their versions by 1.
|
void |
markWorklogDeletedAndIncrementVersion(long worklogId)
Marks the specified worklog as deleted and bumps its version by 1.
|
void incrementIssueVersion(long issueId)
throws IncrementDeletedEntityVersionException
issueId - identifier for the issue whose version should be bumpedIncrementDeletedEntityVersionException - if issueId is related to an issue version which is marked as deletedvoid incrementCommentVersion(long commentId,
long parentIssueId)
throws IncrementDeletedEntityVersionException
commentId - identifier for the comment whose version should be bumpedparentIssueId - identifier for the Issue that the comment belongs toIncrementDeletedEntityVersionException - if commentId is related to a deleted comment version which is marked as deletedvoid incrementWorklogVersion(long worklogId,
long parentIssueId)
throws IncrementDeletedEntityVersionException
worklogId - identifier for the worklog whose version should be bumpedparentIssueId - identifier for the Issue that the worklog belongs toIncrementDeletedEntityVersionException - if worklogId is related to a deleted worklog version which is marked as deletedvoid incrementRelatedCommentVersions(long parentIssueId)
parentIssueId. If there isn't a
version record associated with a given comment, it will be added.parentIssueId - identifier for the Issue whose comments will be bumped.void incrementRelatedWorklogVersions(long parentIssueId)
parentIssueId. If there isn't a
version record associated with a given worklog, it will be added.parentIssueId - identifier for the Issue whose worklogs will be bumped.void markIssueDeletedAndIncrementVersion(long issueId)
issueId - identifier for issue and all its related comments and worklogs to mark as deleted & whose version number to bumpvoid markCommentDeletedAndIncrementVersion(long commentId)
commentId - identifier for comment to mark as deleted & whose version number to bumpvoid markWorklogDeletedAndIncrementVersion(long worklogId)
worklogId - identifier for worklog to mark as deleted & whose version number to bumpOptional<Long> getIssueVersion(long issueId)
issueId or Optional.empty() if there is no version.issueId - identifies the issue whose current version will be retrievedOptional<Long> getCommentVersion(long commentId)
commentId or Optional.empty() if there is no version.commentId - identifies the comment whose current version will be retrievedOptional<Long> getWorklogVersion(long worklogId)
worklogId or Optional.empty() if there is no version.worklogId - identifies the worklog whose current version will be retrievedMap<Long,Long> getRelatedCommentVersions(long parentIssueId)
parentIssueId.parentIssueId - identifier for the Issue whose comments will be retrievedMap<Long,Long> getRelatedWorklogVersions(long parentIssueId)
parentIssueId.parentIssueId - identifier for the Issue whose worklogs will be retrievedMap<Long,Optional<Long>> getLocalVersions(Set<Long> entityIds, IndexDirectoryFactory.Name indexName) throws IOException
entityIds in
the form of a map of ids to versions. Which local index to retrieve the versions from is determined by indexName.entityIds - Set of entity ids whose versions we want to look up in the local index referred to by indexNameindexName - Specifies which local Lucene index the versions should be retrieved fromOptionals, with empty values for versions that were not found.IOException - if an I/O problem arises when searching the target lucene indexlong cleanAllDeletedEntityVersionsOlderThan(java.time.Duration duration)
duration.duration - threshold for deletion; entries marked as deleted and older than this will be removed.List<EntityVersion> findEntityVersionsUpdatedInTheLast(IndexDirectoryFactory.Name indexName, java.time.Duration duration)
duration amount of time. A data object
containing the entity's id, version, whether or not it was deleted, etc. is returned for every entity-version modified
since the duration.indexName - which type of entity to get the updated versions forduration - how far back in time to look for entity versions that have been updatedOptional<EntityVersion> getLatestEntityUpdate(IndexDirectoryFactory.Name indexName)
indexName - which type of entity to get the latest update forCopyright © 2002-2022 Atlassian. All Rights Reserved.