public class

CachingVersionStore

extends Object
implements VersionStore
java.lang.Object
   ↳ com.atlassian.jira.project.version.CachingVersionStore

Class Overview

A caching implementation of the VersionStore that relies on a delegate to do the DB operations.

Summary

Public Constructors
CachingVersionStore(VersionStore delegate, CacheManager cacheManager)
Public Methods
@Nonnull 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.
@Nonnull Iterable<Version> getAllVersions()
Returns a list of GenericValues representing all Versions in JIRA, ordered by sequence.
Version getVersion(Long id)
@Nonnull Iterable<Version> getVersionsByName(String name)
Returns a list of GenericValues representing all Versions in JIRA with a given name, case insensitively.
@Nonnull Iterable<Version> getVersionsByProject(Long projectId)
Returns a list of GenericValues representing all Versions in a project.
@EventListener 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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.project.version.VersionStore

Public Constructors

public CachingVersionStore (VersionStore delegate, CacheManager cacheManager)

Public Methods

@Nonnull public Version createVersion (Version version)

public void deleteAllVersions (Long projectId)

Deletes all versions in a given project by removing them from database.

Parameters
projectId of the project in which the versions will be deleted.

public void deleteVersion (Version version)

Deletes given Version object by removing it from database.

Parameters
version to be deleted

@Nonnull public Iterable<Version> getAllVersions ()

Returns a list of GenericValues representing all Versions in JIRA, ordered by sequence.

Returns
  • a list of GenericValues representing all Versions in JIRA, ordered by sequence.

public Version getVersion (Long id)

@Nonnull public Iterable<Version> getVersionsByName (String name)

Returns a list of GenericValues representing all Versions in JIRA with a given name, case insensitively.

Parameters
name Version name
Returns
  • a list of GenericValues representing all Versions in JIRA with a given name, case insensitively.

@Nonnull public Iterable<Version> getVersionsByProject (Long projectId)

Returns a list of GenericValues representing all Versions in a project.

Parameters
projectId Project Id
Returns
  • a list of GenericValues representing all Versions in a project

@EventListener public void onClearCache (ClearCacheEvent event)

public void storeVersion (Version version)

Stores an individual Version in the DB. If you want to store a collection of Versions, consider using storeVersions(Collection), it can be more efficient.

Parameters
version The Version to store.

public void storeVersions (Collection<Version> versions)

Stores a collection of Version objects. This method can have performance benefits over calling storeVersion() multiple times. eg the CachingVersionStore will reload the cache from DB with every call to storeVersion().

Parameters
versions Collection of Version objects.