Class MultiBinding<C extends com.cloudbees.plugins.credentials.common.StandardCredentials>
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<MultiBinding<C>>
-
- org.jenkinsci.plugins.credentialsbinding.MultiBinding<C>
-
- Type Parameters:
C
- a kind of credentials
- All Implemented Interfaces:
ExtensionPoint
,Describable<MultiBinding<C>>
- Direct Known Subclasses:
Binding
,CertificateMultiBinding
,SSHUserPrivateKeyBinding
,UsernamePasswordMultiBinding
public abstract class MultiBinding<C extends com.cloudbees.plugins.credentials.common.StandardCredentials> extends AbstractDescribableImpl<MultiBinding<C>> implements ExtensionPoint
A way of binding a kind of credentials to an environment variable during a build.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MultiBinding.MultiEnvironment
protected static class
MultiBinding.NullUnbinder
No-op callback.static interface
MultiBinding.Unbinder
Callback run at the end of a build.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MultiBinding(String credentialsId)
For use withDataBoundConstructor
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract MultiBinding.MultiEnvironment
bind(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener)
Sets up bindings for a build.protected C
getCredentials(Run<?,?> build)
Looks up the actual credentials.String
getCredentialsId()
Identifier of the credentials to be bound.BindingDescriptor<C>
getDescriptor()
protected abstract Class<C>
type()
Type token.Set<String>
variables()
Deprecated.overridevariables(Run)
Set<String>
variables(Run<?,?> build)
Defines keys expected to be set inMultiBinding.MultiEnvironment.getSecretValues()
, particularly any that might be sensitive.
-
-
-
Constructor Detail
-
MultiBinding
protected MultiBinding(String credentialsId)
For use withDataBoundConstructor
.
-
-
Method Detail
-
getCredentialsId
public final String getCredentialsId()
Identifier of the credentials to be bound.
-
bind
public abstract MultiBinding.MultiEnvironment bind(@NonNull Run<?,?> build, @Nullable FilePath workspace, @Nullable Launcher launcher, @NonNull TaskListener listener) throws IOException, InterruptedException
Sets up bindings for a build.- Parameters:
build
- The build. Cannot be nullworkspace
- The workspace - can be null ifBindingDescriptor.requiresWorkspace()
is false.launcher
- The launcher - can be null ifBindingDescriptor.requiresWorkspace()
is false.listener
- The task listener. Cannot be null.- Returns:
- The configured
MultiBinding.MultiEnvironment
- Throws:
IOException
InterruptedException
-
variables
public Set<String> variables()
Deprecated.overridevariables(Run)
-
variables
public Set<String> variables(@NonNull Run<?,?> build) throws CredentialNotFoundException
Defines keys expected to be set inMultiBinding.MultiEnvironment.getSecretValues()
, particularly any that might be sensitive.- Throws:
CredentialNotFoundException
-
getCredentials
@NonNull protected final C getCredentials(@NonNull Run<?,?> build) throws CredentialNotFoundException
Looks up the actual credentials.- Parameters:
build
- the build.- Returns:
- the credentials
- Throws:
CredentialNotFoundException
- if the credentials could not be found (for convenience, rather than returning null)
-
getDescriptor
public BindingDescriptor<C> getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<C extends com.cloudbees.plugins.credentials.common.StandardCredentials>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<MultiBinding<C extends com.cloudbees.plugins.credentials.common.StandardCredentials>>
-
-