org.jenkinsci.lib.configprovider
Class ConfigProvider

java.lang.Object
  extended by org.jenkinsci.lib.configprovider.ConfigProvider
All Implemented Interfaces:
hudson.ExtensionPoint
Direct Known Subclasses:
AbstractConfigProvider

public abstract class ConfigProvider
extends Object
implements hudson.ExtensionPoint

A ConfigProvider is able to manage different configuration files (see: Config)

Author:
domi

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
ConfigProvider()
           
 
Method Summary
static hudson.ExtensionList<ConfigProvider> all()
          All registered ConfigProviders.
abstract  Collection<Config> getAllConfigs()
          returns all the configs of this provider
abstract  Config getConfigById(String configId)
          Returns the config item identified by this id.
abstract  ConfigDescription getConfigDescription()
          The description of the config this provider is able to provide instances of
abstract  ContentType getContentType()
          The content type of the configs this provider manages. e.g. can be used to display the content in the UI (editor).
abstract  String getProviderId()
          An ID uniquely identifying this provider, the id of each Config must start with this ID separated by a '.'!
abstract  boolean isResponsibleFor(String configId)
          Whether this provider is responsible for a Config with the given Id.
abstract  Config newConfig()
          Returns a new Config object with a unique id, starting with the id of this provider - separated by '.'. e.g.
abstract  void remove(String configId)
          Removes/deletes the config with the given Id
abstract  void save(Config config)
          save the content of the given config.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigProvider

public ConfigProvider()
Method Detail

all

public static hudson.ExtensionList<ConfigProvider> all()
All registered ConfigProviders.


getAllConfigs

public abstract Collection<Config> getAllConfigs()
returns all the configs of this provider

Returns:
collection of Configs

getConfigDescription

public abstract ConfigDescription getConfigDescription()
The description of the config this provider is able to provide instances of

Returns:
the description

getContentType

public abstract ContentType getContentType()
The content type of the configs this provider manages. e.g. can be used to display the content in the UI (editor).

Returns:
the type. null if no specific formating should be supported.

getConfigById

public abstract Config getConfigById(String configId)
Returns the config item identified by this id.

Parameters:
configId - the id
Returns:
the config with the given id

isResponsibleFor

public abstract boolean isResponsibleFor(String configId)
Whether this provider is responsible for a Config with the given Id.

Parameters:
configId - the id to check
Returns:
true if the provider takes responsibility

save

public abstract void save(Config config)
save the content of the given config.

Parameters:
config - the config to be saved

remove

public abstract void remove(String configId)
Removes/deletes the config with the given Id

Parameters:
configId - the id

getProviderId

public abstract String getProviderId()
An ID uniquely identifying this provider, the id of each Config must start with this ID separated by a '.'!

Returns:
the unique id for this provider.

newConfig

public abstract Config newConfig()
Returns a new Config object with a unique id, starting with the id of this provider - separated by '.'. e.g. "MyCustomProvider.123456". This object is also used initialize the user interface.

Returns:
the new config object, ready for editing.


Copyright © 2004-2011. All Rights Reserved.