Package com.atlassian.jira.plugin
Interface PluginVersionStore
- All Known Implementing Classes:
BootstrapPluginVersionStore,OfBizPluginVersionStore
public interface PluginVersionStore
Handles
PluginVersion's persistence.- Since:
- v3.13
-
Method Summary
Modifier and TypeMethodDescriptioncreate(PluginVersion pluginVersion) Creates aPluginVersionin the database.booleanDeletes a plugin version from the datastore.voiddeleteByKey(String pluginKey) Deletes anyPluginVersions for the plugin with the given key.getAll()Returns a list of allPluginVersion's.Gets thePluginVersionspecified by the id.longsave(PluginVersion pluginVersion) Persists the givenPluginVersion, performing an insert or update according to whether a record for this plugin key already exists.update(PluginVersion pluginVersion) Updates a plugin version in the datastore.
-
Method Details
-
create
Creates aPluginVersionin the database. The id in the object will be ignored.- Parameters:
pluginVersion- contains the key, name, and version to be persisted.- Returns:
- a
PluginVersionwith the database id populated. - Throws:
IllegalArgumentException- if pluginVersion is null.
-
update
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:
- a
PluginVersionthat represents the updated record. - Throws:
IllegalArgumentException- if pluginVersion or pluginVersion.getId is null or we can not find the record with the provided id.
-
delete
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.
-
getById
Gets thePluginVersionspecified by the id.- Parameters:
pluginVersionId- identifies the plugin version record to retrieve.- Returns:
- the
PluginVersionwith the corresponding id or null if the record is not found.
-
getAll
List<PluginVersion> getAll()Returns a list of allPluginVersion's.- Returns:
- a list of all
PluginVersion's.
-
deleteByKey
Deletes anyPluginVersions for the plugin with the given key.- Parameters:
pluginKey- the key for which to delete the version(s) (required)
-
save
Persists the givenPluginVersion, 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
-