public class CachingVersionStore extends Object implements VersionStore
Constructor and Description |
---|
CachingVersionStore(VersionStore delegate,
SwitchingCacheFactory cacheFactory) |
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) |
Map<Long,Version> |
getVersions(Collection<Long> ids)
Returns a collection of versions for the names given.
|
Collection<Version> |
getVersionsByName(String name)
Returns a list of GenericValues representing all Versions in JIRA with a given name, case insensitively.
|
Collection<Version> |
getVersionsByProject(Long projectId)
Returns a list of GenericValues representing all Versions in a project.
|
Map<String,Collection<Version>> |
getVersionsForNames(Collection<String> names)
Returns a collection of versions for the names given.
|
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, SwitchingCacheFactory cacheFactory)
@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
public Map<Long,Version> getVersions(Collection<Long> ids)
VersionStore
getVersions
in interface VersionStore
ids
- a collection of Long values representing the id of the versions.@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 Collection<Version> getVersionsByName(String name)
VersionStore
getVersionsByName
in interface VersionStore
name
- Version namepublic Map<String,Collection<Version>> getVersionsForNames(Collection<String> names)
VersionStore
getVersionsForNames
in interface VersionStore
names
- a collection of String values representing the names of the versions.@Nonnull public Collection<Version> getVersionsByProject(Long projectId)
VersionStore
getVersionsByProject
in interface VersionStore
projectId
- Project IdCopyright © 2002-2016 Atlassian. All Rights Reserved.