Class DeclarativeAgentDescriptor<A extends DeclarativeAgent<A>>
java.lang.Object
hudson.model.Descriptor<T>
org.jenkinsci.plugins.pipeline.modeldefinition.withscript.WithScriptDescriptor<A>
org.jenkinsci.plugins.pipeline.modeldefinition.agent.DeclarativeAgentDescriptor<A>
public abstract class DeclarativeAgentDescriptor<A extends DeclarativeAgent<A>>
extends WithScriptDescriptor<A>
Descriptor for
DeclarativeAgent
.- Author:
- Andrew Bayer
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jenkinsci.plugins.pipeline.modeldefinition.withscript.WithScriptDescriptor
WithScriptDescriptor.WithScriptAllowlist
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionall()
Get allDeclarativeAgentDescriptor
s.static List<DeclarativeAgentDescriptor>
Get allDeclarativeAgentDescriptor
s, sorted by name.static DeclarativeAgentDescriptor
Get the descriptor for a given name or null if not found.Get a map of name-to-DescribableModel
of all known/registered descriptors.static DeclarativeAgent<?>
instanceForDescriptor
(DeclarativeAgentDescriptor<?> descriptor, Map<String, Object> arguments) For a given descriptor and map of arguments, return an instance using those arguments.static DeclarativeAgent<?>
instanceForName
(String name, Map<String, Object> arguments) For a given name and map of arguments, find the corresponding descriptor and return an instance using those arguments.Get the map of the subset of descriptors with no required arguments.Get the map of the subset of descriptors with no additional arguments - i.e., "none" and "any".Methods inherited from class org.jenkinsci.plugins.pipeline.modeldefinition.withscript.WithScriptDescriptor
getName, getScriptClass, newInstance, newInstance
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
DeclarativeAgentDescriptor
public DeclarativeAgentDescriptor()
-
-
Method Details
-
all
Get allDeclarativeAgentDescriptor
s.- Returns:
- a list of all
DeclarativeAgentDescriptor
s registered.
-
allSorted
Get allDeclarativeAgentDescriptor
s, sorted by name.- Returns:
- a list of all
DeclarativeAgentDescriptor
s registered, sorted by name.
-
getDescribableModels
public static Map<String,org.jenkinsci.plugins.structs.describable.DescribableModel> getDescribableModels()Get a map of name-to-DescribableModel
of all known/registered descriptors.- Returns:
- A map of name-to-
DescribableModel
s
-
zeroArgModels
public static Map<String,org.jenkinsci.plugins.structs.describable.DescribableModel> zeroArgModels()Get the map of the subset of descriptors with no additional arguments - i.e., "none" and "any".- Returns:
- A map of descriptors with no arguments.
-
noRequiredArgsModels
public static Map<String,org.jenkinsci.plugins.structs.describable.DescribableModel> noRequiredArgsModels()Get the map of the subset of descriptors with no required arguments.- Returns:
- A map of descriptors with no required arguments.
-
byName
Get the descriptor for a given name or null if not found.- Parameters:
name
- The name for the descriptor to look up- Returns:
- The corresponding descriptor or null if not found.
-
instanceForName
@Nullable public static DeclarativeAgent<?> instanceForName(@NonNull String name, Map<String, Object> arguments) throws ExceptionFor a given name and map of arguments, find the corresponding descriptor and return an instance using those arguments.- Parameters:
name
- The name of the descriptorarguments
- A map of arguments- Returns:
- The instantiated
DeclarativeAgent
instance, or null if the name isn't found. - Throws:
Exception
- if there are issues instantiating from the descriptor
-
instanceForDescriptor
@NonNull public static DeclarativeAgent<?> instanceForDescriptor(@NonNull DeclarativeAgentDescriptor<?> descriptor, Map<String, Object> arguments) throws ExceptionFor a given descriptor and map of arguments, return an instance using those arguments.- Parameters:
descriptor
- The descriptor instancearguments
- A map of arguments- Returns:
- The instantiated
DeclarativeAgent
instance. - Throws:
Exception
- if there are issues instantiating from the descriptor
-