public class CachingVersionStore extends Object implements VersionStore
Constructor and Description |
---|
CachingVersionStore(VersionStore delegate,
com.atlassian.cache.CacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
Version |
createVersion(Version version) |
void |
deleteAllVersions(Long projectId)
Deletes all versions in a given project by removing them from database.
|
void |
deleteVersion(Version version)
Deletes given Version object by removing it from database.
|
Iterable<Version> |
getAllVersions()
Returns a list of GenericValues representing all Versions in JIRA, ordered by sequence.
|
Version |
getVersion(Long id) |
Iterable<Version> |
getVersionsByName(String name)
Returns a list of GenericValues representing all Versions in JIRA with a given name, case insensitively.
|
Iterable<Version> |
getVersionsByProject(Long projectId)
Returns a list of GenericValues representing all Versions in a project.
|
void |
onClearCache(ClearCacheEvent event) |
void |
storeVersion(Version version)
Stores an individual Version in the DB.
|
void |
storeVersions(Collection<Version> versions)
Stores a collection of Version objects.
|
public CachingVersionStore(VersionStore delegate, com.atlassian.cache.CacheManager cacheManager)
@EventListener public void onClearCache(ClearCacheEvent event)
@Nonnull public Iterable<Version> getAllVersions()
VersionStore
getAllVersions
in interface VersionStore
public Version getVersion(Long id)
getVersion
in interface VersionStore
@Nonnull public Version createVersion(@Nonnull Version version)
createVersion
in interface VersionStore
public void storeVersion(@Nonnull Version version)
VersionStore
VersionStore.storeVersions(java.util.Collection<com.atlassian.jira.project.version.Version>)
, it can be more efficient.storeVersion
in interface VersionStore
version
- The Version to store.VersionStore.storeVersions(java.util.Collection<com.atlassian.jira.project.version.Version>)
public void storeVersions(@Nonnull Collection<Version> versions)
VersionStore
storeVersion() multiple times.
eg the CachingVersionStore
will reload the cache from DB with every call to storeVersion().
storeVersions
in interface VersionStore
versions
- Collection of Version objects.VersionStore.storeVersion(Version)
public void deleteVersion(@Nonnull Version version)
VersionStore
deleteVersion
in interface VersionStore
version
- to be deletedpublic void deleteAllVersions(@Nonnull Long projectId)
VersionStore
deleteAllVersions
in interface VersionStore
projectId
- of the project in which the versions will be deleted.@Nonnull public Iterable<Version> getVersionsByName(String name)
VersionStore
getVersionsByName
in interface VersionStore
name
- Version name@Nonnull public Iterable<Version> getVersionsByProject(Long projectId)
VersionStore
getVersionsByProject
in interface VersionStore
projectId
- Project IdCopyright © 2002-2019 Atlassian. All Rights Reserved.