Class DataBoundConfigurator<T>
java.lang.Object
io.jenkins.plugins.casc.BaseConfigurator<T>
io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator<T>
- All Implemented Interfaces:
Configurator<T>
- Direct Known Subclasses:
GlobalNodePropertiesConfigurator,HudsonPrivateSecurityRealmConfigurator,JNLPLauncherConfigurator
A generic
Configurator to configure components with a DataBoundConstructor.
Intended to replicate Stapler's request-to-instance lifecycle, including PostConstruct init methods.
Will rely on JEP-205 once implemented- Author:
- Nicolas De Loof
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jenkins.plugins.casc.BaseConfigurator
BaseConfigurator.TypePair -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheck(CNode config, ConfigurationContext context) Run the same logic asConfigurator.configure(CNode, ConfigurationContext)in dry-run mode.configure(CNode c, ConfigurationContext context) Configures/creates a Jenkins object based on a tree.describe()Determine the list of Attribute available for configuration of the managed component.describe(T instance, ConfigurationContext context) Describe a component as a Configuration NodesCNodeto be exported as yaml.static ConstructorgetDataBoundConstructor(Class type) getName()Get a configurator name.getNames()Get all possible configurator namesTarget type this configurator can handle.protected Tinstance(Mapping config, ConfigurationContext context) Build a fresh new component based on provided configuration andDataBoundConstructorMethods inherited from class io.jenkins.plugins.casc.BaseConfigurator
compare, configure, createAttribute, equals, exclusions, handleUnknown, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jenkins.plugins.casc.Configurator
canConfigure, describeStructure, getAttributes, getConfigurators
-
Constructor Details
-
DataBoundConfigurator
-
-
Method Details
-
getDataBoundConstructor
-
getTarget
Description copied from interface:ConfiguratorTarget type this configurator can handle. -
instance
Build a fresh new component based on provided configuration andDataBoundConstructor- Specified by:
instancein classBaseConfigurator<T>- Parameters:
config- configuration for target component. Implementation may consume some entries to create a fresh new instance.context- Fully configured Jenkins object used as the starting point for this configuration.- Returns:
- instance to be configured, but not yet fully configured, see
BaseConfigurator.configure(Mapping, Object, boolean, ConfigurationContext) - Throws:
ConfiguratorException- something went wrong...
-
configure
Description copied from interface:ConfiguratorConfigures/creates a Jenkins object based on a tree.- Specified by:
configurein interfaceConfigurator<T>- Overrides:
configurein classBaseConfigurator<T>- Parameters:
c- Map/List/primitive objects (think YAML) that represents the configuration from which a Jenkins object is configured.context- Fully configured Jenkins object used as the starting point for this configuration.- Returns:
- Fully configured Jenkins object that results from this configuration. if no new objects got created, but some existing objects may have been modified, return updated target object.
- Throws:
ConfiguratorException- if something went wrong, depends on the concrete implementation
-
check
Description copied from interface:ConfiguratorRun the same logic asConfigurator.configure(CNode, ConfigurationContext)in dry-run mode. Used to verify configuration is fine before being actually applied to a live jenkins controller.- Specified by:
checkin interfaceConfigurator<T>- Overrides:
checkin classBaseConfigurator<T>- Parameters:
config- Map/List/primitive objects (think YAML) that represents the configuration from which a Jenkins object is configured.context- Fully configured Jenkins object used as the starting point for this configuration.- Throws:
ConfiguratorException- on configuration error
-
getName
Description copied from interface:ConfiguratorGet a configurator name. This should return the default name for the configurator, used for exporting yaml seeConfigurator.getNames()for all possible names which will be considered when configuring.- Returns:
- short name for this component when used in a configuration.yaml file
-
getNames
Description copied from interface:ConfiguratorGet all possible configurator names- Returns:
- a list of all possible short names for this component when used in a configuration.yaml file
-
getImplementedAPI
- Returns:
- The API implemented by target type, i.e. implemented
ExtensionPointfor components to implement some jenkins APIs, or raw type for others.
-
describe
Description copied from interface:ConfiguratorDetermine the list of Attribute available for configuration of the managed component.- Specified by:
describein interfaceConfigurator<T>- Overrides:
describein classBaseConfigurator<T>- Returns:
- A set of
Attributes that describes this object
-
describe
Description copied from interface:ConfiguratorDescribe a component as a Configuration NodesCNodeto be exported as yaml. Only export attributes which are not set to default value.- Throws:
Exception
-
getDisplayName
- Returns:
- Human friendly display name for this component, used in generated documentation.
-