Class CredentialsSelectHelper

java.lang.Object
hudson.model.Descriptor<CredentialsSelectHelper>
com.cloudbees.plugins.credentials.CredentialsSelectHelper
All Implemented Interfaces:
Describable<CredentialsSelectHelper>, Saveable, OnMaster

@Extension public class CredentialsSelectHelper extends Descriptor<CredentialsSelectHelper> implements Describable<CredentialsSelectHelper>
A descriptor used to assist the c:select tag with allowing in-place addition of credentials.
Author:
Stephen Connolly
  • Field Details

  • Constructor Details

    • CredentialsSelectHelper

      public CredentialsSelectHelper()
  • Method Details

    • getDescriptor

      public CredentialsSelectHelper getDescriptor()
      Specified by:
      getDescriptor in interface Describable<CredentialsSelectHelper>
    • getDisplayName

      @NonNull public String getDisplayName()
      Overrides:
      getDisplayName in class Descriptor<CredentialsSelectHelper>
    • resolveContext

      @CheckForNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public ModelObject resolveContext(Object context)
      Fixes up the context in case we are called from a page where the context is not a ModelObject.
      Parameters:
      context - the initial guess of the context.
      Returns:
      the resolved context.
      Since:
      2.0.7
    • getStoreItems

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public List<CredentialsSelectHelper.StoreItem> getStoreItems(ModelObject context, boolean includeUser)
      Returns the CredentialsSelectHelper.StoreItem instances for the current Stapler request.
      Parameters:
      context - the context in which to retrieve the store items.
      includeUser - true to also include any User scoped stores.
      Returns:
      the CredentialsSelectHelper.StoreItem instances for the current Stapler request.
      Since:
      2.0.5
    • hasCreatePermission

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean hasCreatePermission(ModelObject context, boolean includeUser)
      Checks if the current user has permission to create a credential.
      Parameters:
      context - the context.
      includeUser - whether they can use their own credentials store.
      Returns:
      true if they can create a permission.
      Since:
      FIXME
    • getResolver

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public CredentialsSelectHelper.WrappedContextResolver getResolver(String className)
      Stapler binding for the resolver URL segment.
      Parameters:
      className - the class name of the resolver.
      Returns:
      the wrapped resolver.
      Since:
      2.0
    • resolveForCLI

      @CLIResolver public static CredentialsStore resolveForCLI(String storeId) throws org.kohsuke.args4j.CmdLineException
      Resolves a CredentialsStore instance for CLI commands.
      Parameters:
      storeId - the store identifier.
      Returns:
      the CredentialsStore instance.
      Throws:
      org.kohsuke.args4j.CmdLineException - if the store cannot be resolved.
      Since:
      2.1.1
    • getResolversByName

      public static Map<String,CredentialsSelectHelper.ContextResolver> getResolversByName()
      Returns a map of the CredentialsSelectHelper.ContextResolver instances keyed by their name. A resolver may have more than one entry if there are inferred unique short nicknames.
      Returns:
      a map of the CredentialsSelectHelper.ContextResolver instances keyed by their name
      Since:
      2.1.1
    • getProvidersByName

      public static Map<String,CredentialsProvider> getProvidersByName()
      Returns a map of the CredentialsProvider instances keyed by their name. A provider may have more than one entry if there are inferred unique short nicknames.
      Returns:
      a map of the CredentialsProvider instances keyed by their name
      Since:
      2.1.1