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 toDatabase
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-argumentDataBoundConstructor
, 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 Constructor Description PerItemDatabase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract DataSource
getDataSource(TopLevelItem item)
Loads the database for an item.PerItemDatabaseDescriptor
getDescriptor()
-
-
-
Method Detail
-
getDataSource
public abstract DataSource getDataSource(TopLevelItem item) throws SQLException
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
public PerItemDatabaseDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<PerItemDatabase>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<PerItemDatabase>
-
-