Package org.jenkinsci.plugins.database
Class PerItemDatabase
java.lang.Object
hudson.model.AbstractDescribableImpl<PerItemDatabase>
org.jenkinsci.plugins.database.PerItemDatabase
- All Implemented Interfaces:
ExtensionPoint
,Describable<PerItemDatabase>
public abstract class PerItemDatabase
extends AbstractDescribableImpl<PerItemDatabase>
implements ExtensionPoint
Similar to
Database
but assumes that there is a separate database per item.
Typically would be implemented by an embeddable database capable of loading from the root directory.
It is recommended, but not required, that implementations have a no-argument DataBoundConstructor
,
which permits them to be configured by default merely by installing a plugin.-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract DataSource
getDataSource
(TopLevelItem item) Loads the database for an item.
-
Constructor Details
-
PerItemDatabase
public PerItemDatabase()
-
-
Method Details
-
getDataSource
Loads the database for an item. Should be created if not already present. Since multiple plugins may be sharing this database, prefix any table names with the plugin name.- Parameters:
item
- a job, folder, etc.- Returns:
- a database connection specific to that item
- Throws:
SQLException
- in case it is impossible to connect to the database
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<PerItemDatabase>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<PerItemDatabase>
-