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:
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
-
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 NodesCNode
to be exported as yaml.static Constructor
getDataBoundConstructor
(Class type) getName()
Get a configurator name.getNames()
Get all possible configurator namesTarget type this configurator can handle.protected T
instance
(Mapping config, ConfigurationContext context) Build a fresh new component based on provided configuration andDataBoundConstructor
Methods inherited from class io.jenkins.plugins.casc.BaseConfigurator
compare, configure, createAttribute, equals, exclusions, handleUnknown, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jenkins.plugins.casc.Configurator
canConfigure, describeStructure, getAttributes, getConfigurators
-
Constructor Details
-
DataBoundConfigurator
-
-
Method Details
-
getDataBoundConstructor
-
getTarget
Description copied from interface:Configurator
Target type this configurator can handle. -
instance
Build a fresh new component based on provided configuration andDataBoundConstructor
- Specified by:
instance
in 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:Configurator
Configures/creates a Jenkins object based on a tree.- Specified by:
configure
in interfaceConfigurator<T>
- Overrides:
configure
in 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:Configurator
Run 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:
check
in interfaceConfigurator<T>
- Overrides:
check
in 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:Configurator
Get 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:Configurator
Get 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
ExtensionPoint
for components to implement some jenkins APIs, or raw type for others.
-
describe
Description copied from interface:Configurator
Determine the list of Attribute available for configuration of the managed component.- Specified by:
describe
in interfaceConfigurator<T>
- Overrides:
describe
in classBaseConfigurator<T>
- Returns:
- A set of
Attribute
s that describes this object
-
describe
Description copied from interface:Configurator
Describe a component as a Configuration NodesCNode
to 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.
-