public class EntityVersioningManagerImpl extends Object implements EntityVersioningManager
NO_OP_ENTITY_VERSION| Constructor and Description |
|---|
EntityVersioningManagerImpl(VersioningDaoFactory factory,
TransactionSupport transactionSupport,
com.atlassian.event.api.EventPublisher eventPublisher) |
| 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. |
void |
cleanDeletedIssueVersion(long issueId) |
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<EntityVersion> |
getCommentEntityVersion(long commentId)
Return the comment version for the comment identified by
issueId, Optional.empty() if there is no version or
EntityVersioningManager.NO_OP_ENTITY_VERSION an implementation not using a real data source is used. |
Optional<Long> |
getCommentVersion(long commentId)
Return the comment version for the comment identified by
commentId or Optional.empty() if there is no version. |
Optional<EntityVersion> |
getIssueEntityVersion(long issueId)
Return the issue version for the issue identified by
issueId, Optional.empty() if there is no version or EntityVersioningManager.NO_OP_ENTITY_VERSION
an implementation not using a real data source is used. |
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<EntityVersion> |
getWorklogEntityVersion(long worklogId)
Return the worklog version for the worklog identified by
issueId, Optional.empty() if there is no version or
EntityVersioningManager.NO_OP_ENTITY_VERSION an implementation not using a real data source is used. |
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 |
onPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) |
public EntityVersioningManagerImpl(VersioningDaoFactory factory, TransactionSupport transactionSupport, com.atlassian.event.api.EventPublisher eventPublisher)
@EventListener public void onPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event)
public void incrementIssueVersion(long issueId)
throws IncrementDeletedEntityVersionException
EntityVersioningManagerincrementIssueVersion in interface EntityVersioningManagerissueId - identifier for the issue whose version should be bumpedIncrementDeletedEntityVersionException - if issueId is related to an issue version which is marked as deletedpublic void incrementCommentVersion(long commentId,
long parentIssueId)
throws IncrementDeletedEntityVersionException
EntityVersioningManagerincrementCommentVersion in interface EntityVersioningManagercommentId - 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 deletedpublic void incrementWorklogVersion(long worklogId,
long parentIssueId)
throws IncrementDeletedEntityVersionException
EntityVersioningManagerincrementWorklogVersion in interface EntityVersioningManagerworklogId - 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 deletedpublic void incrementRelatedCommentVersions(long parentIssueId)
EntityVersioningManagerparentIssueId. If there isn't a
version record associated with a given comment, it will be added.incrementRelatedCommentVersions in interface EntityVersioningManagerparentIssueId - identifier for the Issue whose comments will be bumped.public void incrementRelatedWorklogVersions(long parentIssueId)
EntityVersioningManagerparentIssueId. If there isn't a
version record associated with a given worklog, it will be added.incrementRelatedWorklogVersions in interface EntityVersioningManagerparentIssueId - identifier for the Issue whose worklogs will be bumped.public void markIssueDeletedAndIncrementVersion(long issueId)
EntityVersioningManagermarkIssueDeletedAndIncrementVersion in interface EntityVersioningManagerissueId - identifier for issue and all its related comments and worklogs to mark as deleted & whose version number to bumppublic void markCommentDeletedAndIncrementVersion(long commentId)
EntityVersioningManagermarkCommentDeletedAndIncrementVersion in interface EntityVersioningManagercommentId - identifier for comment to mark as deleted & whose version number to bumppublic void markWorklogDeletedAndIncrementVersion(long worklogId)
EntityVersioningManagermarkWorklogDeletedAndIncrementVersion in interface EntityVersioningManagerworklogId - identifier for worklog to mark as deleted & whose version number to bumppublic Optional<Long> getIssueVersion(long issueId)
EntityVersioningManagerissueId or Optional.empty() if there is no version.getIssueVersion in interface EntityVersioningManagerissueId - identifies the issue whose current version will be retrievedpublic Optional<EntityVersion> getIssueEntityVersion(long issueId)
EntityVersioningManagerissueId, Optional.empty() if there is no version or EntityVersioningManager.NO_OP_ENTITY_VERSION
an implementation not using a real data source is used.getIssueEntityVersion in interface EntityVersioningManagerissueId - identifies the issue whose current version will be retrievedEntityVersioningManager.NO_OP_ENTITY_VERSION if
an implementation not using a real data source is used.public Optional<Long> getCommentVersion(long commentId)
EntityVersioningManagercommentId or Optional.empty() if there is no version.getCommentVersion in interface EntityVersioningManagercommentId - identifies the comment whose current version will be retrievedpublic Optional<EntityVersion> getCommentEntityVersion(long commentId)
EntityVersioningManagerissueId, Optional.empty() if there is no version or
EntityVersioningManager.NO_OP_ENTITY_VERSION an implementation not using a real data source is used.getCommentEntityVersion in interface EntityVersioningManagercommentId - identifies the comment whose current version will be retrievedEntityVersioningManager.NO_OP_ENTITY_VERSION
if an implementation not using a real data source is used.public Optional<Long> getWorklogVersion(long worklogId)
EntityVersioningManagerworklogId or Optional.empty() if there is no version.getWorklogVersion in interface EntityVersioningManagerworklogId - identifies the worklog whose current version will be retrievedpublic Optional<EntityVersion> getWorklogEntityVersion(long worklogId)
EntityVersioningManagerissueId, Optional.empty() if there is no version or
EntityVersioningManager.NO_OP_ENTITY_VERSION an implementation not using a real data source is used.getWorklogEntityVersion in interface EntityVersioningManagerworklogId - identifies the worklog whose current version will be retrievedEntityVersioningManager.NO_OP_ENTITY_VERSION
if an implementation not using a real data source is used.public Map<Long,Long> getRelatedCommentVersions(long parentIssueId)
EntityVersioningManagerparentIssueId.getRelatedCommentVersions in interface EntityVersioningManagerparentIssueId - identifier for the Issue whose comments will be retrievedpublic Map<Long,Long> getRelatedWorklogVersions(long parentIssueId)
EntityVersioningManagerparentIssueId.getRelatedWorklogVersions in interface EntityVersioningManagerparentIssueId - identifier for the Issue whose worklogs will be retrievedpublic Map<Long,Optional<Long>> getLocalVersions(Set<Long> entityIds, IndexDirectoryFactory.Name indexName) throws IOException
EntityVersioningManagerentityIds in
the form of a map of ids to versions. Which local index to retrieve the versions from is determined by indexName.getLocalVersions in interface EntityVersioningManagerentityIds - 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 indexpublic void cleanDeletedIssueVersion(long issueId)
public long cleanAllDeletedEntityVersionsOlderThan(java.time.Duration duration)
EntityVersioningManagerduration.cleanAllDeletedEntityVersionsOlderThan in interface EntityVersioningManagerduration - threshold for deletion; entries marked as deleted and older than this will be removed.public List<EntityVersion> findEntityVersionsUpdatedInTheLast(IndexDirectoryFactory.Name indexName, java.time.Duration duration)
EntityVersioningManagerduration 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.findEntityVersionsUpdatedInTheLast in interface EntityVersioningManagerindexName - which type of entity to get the updated versions forduration - how far back in time to look for entity versions that have been updatedpublic Optional<EntityVersion> getLatestEntityUpdate(IndexDirectoryFactory.Name indexName)
EntityVersioningManagergetLatestEntityUpdate in interface EntityVersioningManagerindexName - which type of entity to get the latest update forCopyright © 2002-2024 Atlassian. All Rights Reserved.