org.jenkinsci.lib.configprovider
Class AbstractConfigProvider

java.lang.Object
  extended by org.jenkinsci.lib.configprovider.ConfigProvider
      extended by org.jenkinsci.lib.configprovider.AbstractConfigProvider
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Saveable

public abstract class AbstractConfigProvider
extends ConfigProvider
implements hudson.model.Saveable


Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
protected  Map<String,Config> configs
           
protected  String ID_PREFIX
           
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
AbstractConfigProvider()
           
 
Method Summary
 Collection<Config> getAllConfigs()
          returns all the configs of this provider
 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
protected  hudson.XmlFile getConfigXml()
           
 String getProviderId()
          An ID uniquely identifying this provider, the id of each Config must start with this ID separated by a '.'!
protected abstract  String getXmlFileName()
           
 boolean isResponsibleFor(String configId)
          Whether this provider is responsible for a Config with the given Id.
protected  void load()
           
 Config newConfig()
          Returns a new Config object with a unique id, starting with the id of this provider - separated by '.'.
 void remove(String configId)
          Removes/deletes the config with the given Id
 void save()
           
 void save(Config config)
          save the content of the given config.
 
Methods inherited from class org.jenkinsci.lib.configprovider.ConfigProvider
all, getContentType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_PREFIX

protected final String ID_PREFIX

configs

protected Map<String,Config> configs
Constructor Detail

AbstractConfigProvider

public AbstractConfigProvider()
Method Detail

getAllConfigs

public Collection<Config> getAllConfigs()
Description copied from class: ConfigProvider
returns all the configs of this provider

Specified by:
getAllConfigs in class ConfigProvider
Returns:
collection of Configs

getConfigById

public Config getConfigById(String configId)
Description copied from class: ConfigProvider
Returns the config item identified by this id.

Specified by:
getConfigById in class ConfigProvider
Parameters:
configId - the id
Returns:
the config with the given id

getConfigDescription

public abstract ConfigDescription getConfigDescription()
Description copied from class: ConfigProvider
The description of the config this provider is able to provide instances of

Specified by:
getConfigDescription in class ConfigProvider
Returns:
the description

getProviderId

public String getProviderId()
Description copied from class: ConfigProvider
An ID uniquely identifying this provider, the id of each Config must start with this ID separated by a '.'!

Specified by:
getProviderId in class ConfigProvider
Returns:
the unique id for this provider.

isResponsibleFor

public boolean isResponsibleFor(String configId)
Description copied from class: ConfigProvider
Whether this provider is responsible for a Config with the given Id.

Specified by:
isResponsibleFor in class ConfigProvider
Parameters:
configId - the id to check
Returns:
true if the provider takes responsibility

newConfig

public Config newConfig()
Description copied from class: ConfigProvider
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.

Specified by:
newConfig in class ConfigProvider
Returns:
the new config object, ready for editing.

remove

public void remove(String configId)
Description copied from class: ConfigProvider
Removes/deletes the config with the given Id

Specified by:
remove in class ConfigProvider
Parameters:
configId - the id

save

public void save(Config config)
Description copied from class: ConfigProvider
save the content of the given config.

Specified by:
save in class ConfigProvider
Parameters:
config - the config to be saved

save

public void save()
Specified by:
save in interface hudson.model.Saveable
See Also:
Saveable.save()

load

protected void load()

getConfigXml

protected hudson.XmlFile getConfigXml()

getXmlFileName

protected abstract String getXmlFileName()


Copyright © 2004-2011. All Rights Reserved.