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
Modifier and TypeClassDescriptionstatic final class
protected static final class
No-op callback.static interface
Callback run at the end of a build.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
ModifierConstructorDescriptionprotected
MultiBinding
(String credentialsId) For use withDataBoundConstructor
. -
Method Summary
Modifier and TypeMethodDescriptionabstract MultiBinding.MultiEnvironment
bind
(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) Sets up bindings for a build.protected final C
getCredentials
(Run<?, ?> build) Looks up the actual credentials.final String
Identifier of the credentials to be bound.type()
Type token.Deprecated.Defines keys expected to be set inMultiBinding.MultiEnvironment.getSecretValues()
, particularly any that might be sensitive.
-
Constructor Details
-
MultiBinding
For use withDataBoundConstructor
.
-
-
Method Details
-
type
Type token. -
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, InterruptedExceptionSets 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
Deprecated.overridevariables(Run)
-
variables
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 CredentialNotFoundExceptionLooks 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
- 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>>
-
variables(Run)