Class CachingVersionStore
java.lang.Object
com.atlassian.jira.project.version.CachingVersionStore
- All Implemented Interfaces:
InitializingComponent,VersionStore
A caching implementation of the VersionStore that relies on a delegate to do the DB operations.
-
Constructor Summary
ConstructorsConstructorDescriptionCachingVersionStore(VersionStore delegate, com.atlassian.cache.CacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after all the beans are constructed and the ApplicationContext is fully populated.createVersion(Version version) voiddeleteAllVersions(Long projectId) Deletes all versions in a given project by removing them from database.voiddeleteVersion(Version version) Deletes given Version object by removing it from database.Returns a list of GenericValues representing all Versions in JIRA, ordered by sequence.getVersion(Long id) getVersionsByName(String name) Returns a list of GenericValues representing all Versions in JIRA with a given name, case insensitively.getVersionsByProject(Long projectId) Returns a list of GenericValues representing all Versions in a project.voidonClearCache(ClearCacheEvent event) voidstoreVersion(Version version) Stores an individual Version in the DB.voidstoreVersions(Collection<Version> versions) Stores a collection of Version objects.
-
Constructor Details
-
CachingVersionStore
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponentCalled after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
onClearCache
-
getAllVersions
Description copied from interface:VersionStoreReturns a list of GenericValues representing all Versions in JIRA, ordered by sequence.- Specified by:
getAllVersionsin interfaceVersionStore- Returns:
- a list of GenericValues representing all Versions in JIRA, ordered by sequence.
-
getVersion
- Specified by:
getVersionin interfaceVersionStore
-
createVersion
- Specified by:
createVersionin interfaceVersionStore
-
storeVersion
Description copied from interface:VersionStoreStores an individual Version in the DB. If you want to store a collection of Versions, consider usingVersionStore.storeVersions(java.util.Collection<com.atlassian.jira.project.version.Version>), it can be more efficient.- Specified by:
storeVersionin interfaceVersionStore- Parameters:
version- The Version to store.- See Also:
-
storeVersions
Description copied from interface:VersionStoreStores a collection of Version objects. This method can have performance benefits over callingstoreVersion()multiple times. eg theCachingVersionStorewill reload the cache from DB with every call tostoreVersion().- Specified by:
storeVersionsin interfaceVersionStore- Parameters:
versions- Collection of Version objects.- See Also:
-
deleteVersion
Description copied from interface:VersionStoreDeletes given Version object by removing it from database.- Specified by:
deleteVersionin interfaceVersionStore- Parameters:
version- to be deleted
-
deleteAllVersions
Description copied from interface:VersionStoreDeletes all versions in a given project by removing them from database.- Specified by:
deleteAllVersionsin interfaceVersionStore- Parameters:
projectId- of the project in which the versions will be deleted.
-
getVersionsByName
Description copied from interface:VersionStoreReturns a list of GenericValues representing all Versions in JIRA with a given name, case insensitively.- Specified by:
getVersionsByNamein interfaceVersionStore- Parameters:
name- Version name- Returns:
- a list of GenericValues representing all Versions in JIRA with a given name, case insensitively.
-
getVersionsByProject
Description copied from interface:VersionStoreReturns a list of GenericValues representing all Versions in a project.- Specified by:
getVersionsByProjectin interfaceVersionStore- Parameters:
projectId- Project Id- Returns:
- a list of GenericValues representing all Versions in a project
-