Class CredentialsStoreAction.DomainWrapper

java.lang.Object
hudson.model.AbstractDescribableImpl<CredentialsStoreAction.DomainWrapper>
com.cloudbees.plugins.credentials.CredentialsStoreAction.DomainWrapper
All Implemented Interfaces:
Describable<CredentialsStoreAction.DomainWrapper>, ModelObject, AccessControlled, IconSpec
Enclosing class:
CredentialsStoreAction

@ExportedBean public static class CredentialsStoreAction.DomainWrapper extends AbstractDescribableImpl<CredentialsStoreAction.DomainWrapper> implements ModelObject, AccessControlled, IconSpec
A wrapper object to bind and expose Domain instances into the web UI.
  • Constructor Details

    • DomainWrapper

      public DomainWrapper(CredentialsStoreAction parent, Domain domain)
      Our constructor.
      Parameters:
      parent - our parent action.
      domain - the domain we are wrapping.
  • Method Details

    • getApi

      public Api getApi()
      Expose a Jenkins Api.
      Returns:
      the Api.
    • getStore

      public CredentialsStore getStore()
      Expose the backing CredentialsStore.
      Returns:
      the backing CredentialsStore.
    • getDomain

      public Domain getDomain()
      Expose the backing Domain.
      Returns:
      the backing Domain.
    • getRelativePath

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public String getRelativePath()
      Used to get the path for the action for new credentials. Stapler can't figure out the right URL from the dialog, so it needs injecting to it.
      Returns:
    • getParent

      public CredentialsStoreAction getParent()
      Expose the parent CredentialsStoreAction.
      Returns:
      the parent CredentialsStoreAction.
    • getUrlName

      @Exported public String getUrlName()
      Return the URL name.
      Returns:
      the URL name.
    • getDisplayName

      @Exported public String getDisplayName()
      Return the display name.
      Specified by:
      getDisplayName in interface ModelObject
      Returns:
      the display name.
    • getIconClassName

      public String getIconClassName()
      Specified by:
      getIconClassName in interface IconSpec
    • getFullName

      @Exported public final String getFullName()
      Return the full name.
      Returns:
      the full name.
    • getFullDisplayName

      @Exported public final String getFullDisplayName()
      Return the full display name.
      Returns:
      the full display name.
    • getDescription

      @Exported public String getDescription()
      Returns:
      the Domain.getDescription().
    • isGlobal

      @Exported public boolean isGlobal()
      Expose a flag to indicate that the wrapped domain is the global domain.
      Returns:
      true if and only if the wrapped domain is the global domain.
    • getCredentialDescriptor

      Returns:
      the CredentialsStoreAction.CredentialsWrapper.DescriptorImpl singleton.
    • getCredentials

      @NonNull public Map<String,CredentialsStoreAction.CredentialsWrapper> getCredentials()
      Exposes a map of the wrapped credentials.
      Returns:
      a map of the wrapped credentials.
    • getCredentialsList

      @NonNull @Exported(name="credentials", visibility=1) public List<CredentialsStoreAction.CredentialsWrapper> getCredentialsList()
      Exposes the wrapped credentials for the XML API.
      Returns:
      the wrapped credentials for the XML API.
      Since:
      2.1.0
    • getCredential

      @CheckForNull public CredentialsStoreAction.CredentialsWrapper getCredential(String id)
      Get a credential by id.
      Parameters:
      id - the id.
      Returns:
      the CredentialsStoreAction.CredentialsWrapper.
    • doCreateCredentials

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public org.kohsuke.stapler.HttpResponse doCreateCredentials(org.kohsuke.stapler.StaplerRequest2 req) throws jakarta.servlet.ServletException, IOException
      Creates a credential.
      Parameters:
      req - the request.
      Returns:
      the response.
      Throws:
      jakarta.servlet.ServletException - if something goes wrong.
      IOException - if something goes wrong.
    • doConfigSubmit

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public org.kohsuke.stapler.HttpResponse doConfigSubmit(org.kohsuke.stapler.StaplerRequest2 req) throws jakarta.servlet.ServletException, IOException
      Updates the domain configuration.
      Parameters:
      req - the request.
      Returns:
      the response.
      Throws:
      jakarta.servlet.ServletException - if something goes wrong.
      IOException - if something goes wrong.
    • doDoDelete

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public org.kohsuke.stapler.HttpResponse doDoDelete(org.kohsuke.stapler.StaplerRequest2 req) throws IOException
      Deletes a domain.
      Parameters:
      req - the request.
      Returns:
      the response.
      Throws:
      IOException - if something goes wrong.
    • doConfigDotXml

      @WebMethod(name="config.xml") @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doConfigDotXml(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException
      Accepts config.xml submission, as well as serve it.
      Parameters:
      req - the request
      rsp - the response
      Throws:
      IOException - if things go wrong
      Since:
      2.1.1
    • updateByXml

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void updateByXml(Source source) throws IOException
      Updates a Credentials by its XML definition.
      Parameters:
      source - source of the Item's new definition. The source should be either a StreamSource or a SAXSource, other sources may not be handled.
      Throws:
      IOException - if things go wrong.
      Since:
      2.1.1
    • getACL

      @NonNull public ACL getACL()
      Specified by:
      getACL in interface AccessControlled
    • checkPermission

      public void checkPermission(@NonNull Permission permission) throws org.springframework.security.access.AccessDeniedException
      Specified by:
      checkPermission in interface AccessControlled
      Throws:
      org.springframework.security.access.AccessDeniedException
    • hasPermission

      public boolean hasPermission(@NonNull Permission permission)
      Specified by:
      hasPermission in interface AccessControlled