public interface

PluginVersionStore

com.atlassian.jira.plugin.PluginVersionStore
Known Indirect Subclasses

Class Overview

Handles PluginVersion's persistence.

Summary

Public Methods
PluginVersion create(PluginVersion pluginVersion)
Creates a PluginVersion in the database.
boolean delete(Long pluginVersionId)
Deletes a plugin version from the datastore.
void deleteByKey(String pluginKey)
Deletes any PluginVersions for the plugin with the given key.
List<PluginVersion> getAll()
Returns a list of all PluginVersion's.
PluginVersion getById(Long pluginVersionId)
Gets the PluginVersion specified by the id.
long save(PluginVersion pluginVersion)
Persists the given PluginVersion, performing an insert or update according to whether a record for this plugin key already exists.
PluginVersion update(PluginVersion pluginVersion)
Updates a plugin version in the datastore.

Public Methods

public PluginVersion create (PluginVersion pluginVersion)

Creates a PluginVersion in the database. The id in the object will be ignored.

Parameters
pluginVersion contains the key, name, and version to be persisted.
Returns
Throws
IllegalArgumentException if pluginVersion is null.

public boolean delete (Long pluginVersionId)

Deletes a plugin version from the datastore. If the provided id does not resolve to an existing record then this method will return false and no records will be deleted.

Parameters
pluginVersionId identifies the plugin version record to delete, not null.
Returns
  • true if the record was deleted, false otherwise.
Throws
IllegalArgumentException if the pluginVersionId is null.

public void deleteByKey (String pluginKey)

Deletes any PluginVersions for the plugin with the given key.

Parameters
pluginKey the key for which to delete the version(s) (required)

public List<PluginVersion> getAll ()

Returns a list of all PluginVersion's.

Returns

public PluginVersion getById (Long pluginVersionId)

Gets the PluginVersion specified by the id.

Parameters
pluginVersionId identifies the plugin version record to retrieve.
Returns
  • the PluginVersion with the corresponding id or null if the record is not found.

public long save (PluginVersion pluginVersion)

Persists the given PluginVersion, performing an insert or update according to whether a record for this plugin key already exists.

Parameters
pluginVersion the plugin version to save (required)
Returns
  • the id of the saved row

public PluginVersion update (PluginVersion pluginVersion)

Updates a plugin version in the datastore.

Parameters
pluginVersion contains the key, name, and version to update. The id will be used to find the record to update.
Returns
Throws
IllegalArgumentException if pluginVersion or pluginVersion.getId is null or we can not find the record with the provided id.