Package com.atlassian.jira.versioning
Class EntityVersioningManagerImpl
java.lang.Object
com.atlassian.jira.versioning.EntityVersioningManagerImpl
- All Implemented Interfaces:
EntityVersioningManager
@Deprecated(forRemoval=true)
public class EntityVersioningManagerImpl
extends Object
implements EntityVersioningManager
Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Summary
Fields inherited from interface com.atlassian.jira.versioning.EntityVersioningManager
NO_OP_ENTITY_VERSION -
Constructor Summary
ConstructorsConstructorDescriptionEntityVersioningManagerImpl(VersioningDaoFactory factory, TransactionSupport transactionSupport, com.atlassian.event.api.EventPublisher eventPublisher) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionlongDeprecated, for removal: This API element is subject to removal in a future version.Removes all entity version records (issues, comments, & worklogs) for entites marked as deleted and older thanduration.voidcleanDeletedIssueVersion(long issueId) Deprecated, for removal: This API element is subject to removal in a future version.findEntityVersionsUpdatedInTheLast(IndexDirectoryFactory.Name indexName, Duration duration) Deprecated, for removal: This API element is subject to removal in a future version.Looks up all the entities whose version changed during the lastdurationamount of time.getCommentEntityVersion(long commentId) Deprecated, for removal: This API element is subject to removal in a future version.Return the comment version for the comment identified byissueId,Optional.empty()if there is no version orEntityVersioningManager.NO_OP_ENTITY_VERSIONan implementation not using a real data source is used.getCommentVersion(long commentId) Deprecated, for removal: This API element is subject to removal in a future version.Return the comment version for the comment identified bycommentIdorOptional.empty()if there is no version.getIssueEntityVersion(long issueId) Deprecated, for removal: This API element is subject to removal in a future version.Return the issue version for the issue identified byissueId,Optional.empty()if there is no version orEntityVersioningManager.NO_OP_ENTITY_VERSIONan implementation not using a real data source is used.getIssueVersion(long issueId) Deprecated, for removal: This API element is subject to removal in a future version.Return the issue version for the issue identified byissueIdorOptional.empty()if there is no version.getLatestEntityUpdate(IndexDirectoryFactory.Name indexName) Deprecated, for removal: This API element is subject to removal in a future version.Looks up the Version & related info for the most recently modified entity version.getLocalVersions(Set<Long> entityIds, IndexDirectoryFactory.Name indexName) Deprecated, for removal: This API element is subject to removal in a future version.Returns the corresponding entity version from the specified local lucene index for each of the ids passed in withentityIdsin the form of a map of ids to versions.getRelatedCommentVersions(long parentIssueId) Deprecated, for removal: This API element is subject to removal in a future version.Return the comment versions for for all comments associated with the specifiedparentIssueId.getRelatedWorklogVersions(long parentIssueId) Deprecated, for removal: This API element is subject to removal in a future version.Return the worklog versions for for all worklogs associated with the specifiedparentIssueId.getWorklogEntityVersion(long worklogId) Deprecated, for removal: This API element is subject to removal in a future version.Return the worklog version for the worklog identified byissueId,Optional.empty()if there is no version orEntityVersioningManager.NO_OP_ENTITY_VERSIONan implementation not using a real data source is used.getWorklogVersion(long worklogId) Deprecated, for removal: This API element is subject to removal in a future version.Return the worklog version for the worklog identified byworklogIdorOptional.empty()if there is no version.voidincrementCommentVersion(long commentId, long parentIssueId) Deprecated, for removal: This API element is subject to removal in a future version.Increments the version number for the specified comment.voidincrementIssueVersion(long issueId) Deprecated, for removal: This API element is subject to removal in a future version.Increments the version number for the specified issue.voidincrementRelatedCommentVersions(long parentIssueId) Deprecated, for removal: This API element is subject to removal in a future version.Bumps the versions for all comments associated with the specifiedparentIssueId.voidincrementRelatedWorklogVersions(long parentIssueId) Deprecated, for removal: This API element is subject to removal in a future version.Bumps the versions for all worklogs associated with the specifiedparentIssueId.voidincrementWorklogVersion(long worklogId, long parentIssueId) Deprecated, for removal: This API element is subject to removal in a future version.Increments the version number for the specified worklog.voidmarkCommentDeletedAndIncrementVersion(long commentId) Deprecated, for removal: This API element is subject to removal in a future version.Marks the specified comment as deleted and bumps its version by 1.voidmarkIssueDeletedAndIncrementVersion(long issueId) Deprecated, for removal: This API element is subject to removal in a future version.Marks the specified issue and all its related comments and worklogs as deleted bumps their versions by 1.voidmarkWorklogDeletedAndIncrementVersion(long worklogId) Deprecated, for removal: This API element is subject to removal in a future version.Marks the specified worklog as deleted and bumps its version by 1.voidonPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
EntityVersioningManagerImpl
public EntityVersioningManagerImpl(VersioningDaoFactory factory, TransactionSupport transactionSupport, com.atlassian.event.api.EventPublisher eventPublisher) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
onPluginFrameworkShutdownEvent
@EventListener public void onPluginFrameworkShutdownEvent(com.atlassian.plugin.event.events.PluginFrameworkShutdownEvent event) Deprecated, for removal: This API element is subject to removal in a future version. -
incrementIssueVersion
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerIncrements the version number for the specified issue. If a version number doesn't exist, one is created.- Specified by:
incrementIssueVersionin interfaceEntityVersioningManager- Parameters:
issueId- identifier for the issue whose version should be bumped- Throws:
IncrementDeletedEntityVersionException- ifissueIdis related to an issue version which is marked as deleted
-
incrementCommentVersion
public void incrementCommentVersion(long commentId, long parentIssueId) throws IncrementDeletedEntityVersionException Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerIncrements the version number for the specified comment. If a version number doesn't exist, one is created.- Specified by:
incrementCommentVersionin interfaceEntityVersioningManager- Parameters:
commentId- identifier for the comment whose version should be bumpedparentIssueId- identifier for theIssuethat the comment belongs to- Throws:
IncrementDeletedEntityVersionException- ifcommentIdis related to a deleted comment version which is marked as deleted
-
incrementWorklogVersion
public void incrementWorklogVersion(long worklogId, long parentIssueId) throws IncrementDeletedEntityVersionException Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerIncrements the version number for the specified worklog. If a version number doesn't exist, one is created.- Specified by:
incrementWorklogVersionin interfaceEntityVersioningManager- Parameters:
worklogId- identifier for the worklog whose version should be bumpedparentIssueId- identifier for theIssuethat the worklog belongs to- Throws:
IncrementDeletedEntityVersionException- ifworklogIdis related to a deleted worklog version which is marked as deleted
-
incrementRelatedCommentVersions
public void incrementRelatedCommentVersions(long parentIssueId) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerBumps the versions for all comments associated with the specifiedparentIssueId. If there isn't a version record associated with a given comment, it will be added.- Specified by:
incrementRelatedCommentVersionsin interfaceEntityVersioningManager- Parameters:
parentIssueId- identifier for the Issue whose comments will be bumped.
-
incrementRelatedWorklogVersions
public void incrementRelatedWorklogVersions(long parentIssueId) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerBumps the versions for all worklogs associated with the specifiedparentIssueId. If there isn't a version record associated with a given worklog, it will be added.- Specified by:
incrementRelatedWorklogVersionsin interfaceEntityVersioningManager- Parameters:
parentIssueId- identifier for the Issue whose worklogs will be bumped.
-
markIssueDeletedAndIncrementVersion
public void markIssueDeletedAndIncrementVersion(long issueId) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerMarks the specified issue and all its related comments and worklogs as deleted bumps their versions by 1.- Specified by:
markIssueDeletedAndIncrementVersionin interfaceEntityVersioningManager- Parameters:
issueId- identifier for issue and all its related comments and worklogs to mark as deleted & whose version number to bump
-
markCommentDeletedAndIncrementVersion
public void markCommentDeletedAndIncrementVersion(long commentId) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerMarks the specified comment as deleted and bumps its version by 1.- Specified by:
markCommentDeletedAndIncrementVersionin interfaceEntityVersioningManager- Parameters:
commentId- identifier for comment to mark as deleted & whose version number to bump
-
markWorklogDeletedAndIncrementVersion
public void markWorklogDeletedAndIncrementVersion(long worklogId) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerMarks the specified worklog as deleted and bumps its version by 1.- Specified by:
markWorklogDeletedAndIncrementVersionin interfaceEntityVersioningManager- Parameters:
worklogId- identifier for worklog to mark as deleted & whose version number to bump
-
getIssueVersion
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerReturn the issue version for the issue identified byissueIdorOptional.empty()if there is no version.- Specified by:
getIssueVersionin interfaceEntityVersioningManager- Parameters:
issueId- identifies the issue whose current version will be retrieved- Returns:
- An optional containing the current version for the specified issue; an empty optional if no version is found.
-
getIssueEntityVersion
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerReturn the issue version for the issue identified byissueId,Optional.empty()if there is no version orEntityVersioningManager.NO_OP_ENTITY_VERSIONan implementation not using a real data source is used.- Specified by:
getIssueEntityVersionin interfaceEntityVersioningManager- Parameters:
issueId- identifies the issue whose current version will be retrieved- Returns:
- An optional containing the current version for the specified issue; an empty optional if no version is found;
EntityVersioningManager.NO_OP_ENTITY_VERSIONif an implementation not using a real data source is used.
-
getCommentVersion
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerReturn the comment version for the comment identified bycommentIdorOptional.empty()if there is no version.- Specified by:
getCommentVersionin interfaceEntityVersioningManager- Parameters:
commentId- identifies the comment whose current version will be retrieved- Returns:
- An optional containing the current version for the specified comment; an empty optional if no version is found.
-
getCommentEntityVersion
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerReturn the comment version for the comment identified byissueId,Optional.empty()if there is no version orEntityVersioningManager.NO_OP_ENTITY_VERSIONan implementation not using a real data source is used.- Specified by:
getCommentEntityVersionin interfaceEntityVersioningManager- Parameters:
commentId- identifies the comment whose current version will be retrieved- Returns:
- An optional containing the current version for the specified comment; an empty optional if no version is found;
EntityVersioningManager.NO_OP_ENTITY_VERSIONif an implementation not using a real data source is used.
-
getWorklogVersion
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerReturn the worklog version for the worklog identified byworklogIdorOptional.empty()if there is no version.- Specified by:
getWorklogVersionin interfaceEntityVersioningManager- Parameters:
worklogId- identifies the worklog whose current version will be retrieved- Returns:
- An optional containing the current version for the specified worklog; an empty optional if no version is found.
-
getWorklogEntityVersion
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerReturn the worklog version for the worklog identified byissueId,Optional.empty()if there is no version orEntityVersioningManager.NO_OP_ENTITY_VERSIONan implementation not using a real data source is used.- Specified by:
getWorklogEntityVersionin interfaceEntityVersioningManager- Parameters:
worklogId- identifies the worklog whose current version will be retrieved- Returns:
- An optional containing the current version for the specified worklog; an empty optional if no version is found;
EntityVersioningManager.NO_OP_ENTITY_VERSIONif an implementation not using a real data source is used.
-
getRelatedCommentVersions
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerReturn the comment versions for for all comments associated with the specifiedparentIssueId.- Specified by:
getRelatedCommentVersionsin interfaceEntityVersioningManager- Parameters:
parentIssueId- identifier for the Issue whose comments will be retrieved- Returns:
- A map from commentId to comment version; an empty map if no version is found (because no version exists/no comment exists/issue doesn't exist).
-
getRelatedWorklogVersions
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerReturn the worklog versions for for all worklogs associated with the specifiedparentIssueId.- Specified by:
getRelatedWorklogVersionsin interfaceEntityVersioningManager- Parameters:
parentIssueId- identifier for the Issue whose worklogs will be retrieved- Returns:
- A map from worklogId to worklog version; an empty map if no version is found (because no version exists/no worklog exists/issue doesn't exist).
-
getLocalVersions
public Map<Long,Optional<Long>> getLocalVersions(Set<Long> entityIds, IndexDirectoryFactory.Name indexName) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerReturns the corresponding entity version from the specified local lucene index for each of the ids passed in withentityIdsin the form of a map of ids to versions. Which local index to retrieve the versions from is determined byindexName.- Specified by:
getLocalVersionsin interfaceEntityVersioningManager- Parameters:
entityIds- Set of entity ids whose versions we want to look up in the local index referred to byindexNameindexName- Specifies which local Lucene index the versions should be retrieved from- Returns:
- A mapping of entity ids to their corresponding versions. The version-values are wrapped in
Optionals, with empty values for versions that were not found. - Throws:
IOException- if an I/O problem arises when searching the target lucene index
-
cleanDeletedIssueVersion
public void cleanDeletedIssueVersion(long issueId) Deprecated, for removal: This API element is subject to removal in a future version. -
cleanAllDeletedEntityVersionsOlderThan
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerRemoves all entity version records (issues, comments, & worklogs) for entites marked as deleted and older thanduration.- Specified by:
cleanAllDeletedEntityVersionsOlderThanin interfaceEntityVersioningManager- Parameters:
duration- threshold for deletion; entries marked as deleted and older than this will be removed.- Returns:
- the number of entity version entries that were removed
-
findEntityVersionsUpdatedInTheLast
public List<EntityVersion> findEntityVersionsUpdatedInTheLast(IndexDirectoryFactory.Name indexName, Duration duration) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerLooks up all the entities whose version changed during the lastdurationamount 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.- Specified by:
findEntityVersionsUpdatedInTheLastin interfaceEntityVersioningManager- Parameters:
indexName- which type of entity to get the updated versions forduration- how far back in time to look for entity versions that have been updated- Returns:
- data objects that bundle id, version, delete status, etc.
-
getLatestEntityUpdate
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:EntityVersioningManagerLooks up the Version & related info for the most recently modified entity version. Deleted entity versions are also considered as part of this calculation.- Specified by:
getLatestEntityUpdatein interfaceEntityVersioningManager- Parameters:
indexName- which type of entity to get the latest update for- Returns:
- An Optional wrapping the most recent update for any entity version or an empty Optional if no versions are present.
-