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 ClassesModifier and TypeClassDescriptionstatic final classprotected static final classNo-op callback.static interfaceCallback run at the end of a build.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMultiBinding(String credentialsId) For use withDataBoundConstructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract MultiBinding.MultiEnvironmentbind(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) Sets up bindings for a build.protected final CgetCredentials(Run<?, ?> build) Looks up the actual credentials.final StringIdentifier 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:
IOExceptionInterruptedException
-
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:
getDescriptorin interfaceDescribable<C extends com.cloudbees.plugins.credentials.common.StandardCredentials>- Overrides:
getDescriptorin classAbstractDescribableImpl<MultiBinding<C extends com.cloudbees.plugins.credentials.common.StandardCredentials>>
-
variables(Run)