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
,ModelObjectWithChildren
,ModelObjectWithContextMenu
- Enclosing class:
- CredentialsStoreAction
@ExportedBean
public static class CredentialsStoreAction.DomainWrapper
extends AbstractDescribableImpl<CredentialsStoreAction.DomainWrapper>
implements ModelObjectWithContextMenu, ModelObjectWithChildren, AccessControlled
A wrapper object to bind and expose
Domain
instances into the web UI.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Our Descriptor.Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
Constructor Summary
ConstructorDescriptionDomainWrapper
(CredentialsStoreAction parent, Domain domain) Our constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkPermission
(Permission permission) doChildrenContextMenu
(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) void
doConfigDotXml
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Accepts config.xml submission, as well as serve it.org.kohsuke.stapler.HttpResponse
doConfigSubmit
(org.kohsuke.stapler.StaplerRequest req) Updates the domain configuration.doContextMenu
(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) org.kohsuke.stapler.HttpResponse
doCreateCredentials
(org.kohsuke.stapler.StaplerRequest req) Creates a credential.org.kohsuke.stapler.HttpResponse
doDoDelete
(org.kohsuke.stapler.StaplerRequest req) Deletes a domain.getACL()
getApi()
Expose a JenkinsApi
.getChildrenContextMenu
(String prefix) Creates the children context menu with the supplied prefix to all URLs.getContextMenu
(String prefix) Creates the context menu with the supplied prefix to all URLs.getCredential
(String id) Get a credential by id.ExposeCredentialsStoreAction.CredentialsWrapper.DescriptorImpl
to Jelly.Exposes a map of the wrapped credentials.Exposes the wrapped credentials for the XML API.Expose theDomain.getDescription()
.Return the display name.Expose the backingDomain
.final String
Return the full display name.final String
Return the full name.Expose the parentCredentialsStoreAction
.getStore()
Expose the backingCredentialsStore
.Return the URL name.boolean
hasPermission
(Permission permission) boolean
isGlobal()
Expose a flag to indicate that the wrapped domain is the global domain.void
updateByXml
(Source source) Updates aCredentials
by its XML definition.Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, hasAnyPermission, hasPermission, hasPermission2
-
Constructor Details
-
DomainWrapper
Our constructor.- Parameters:
parent
- our parent action.domain
- the domain we are wrapping.
-
-
Method Details
-
getApi
Expose a JenkinsApi
.- Returns:
- the
Api
.
-
getStore
Expose the backingCredentialsStore
.- Returns:
- the backing
CredentialsStore
.
-
getDomain
Expose the backingDomain
.- Returns:
- the backing
Domain
.
-
getParent
Expose the parentCredentialsStoreAction
.- Returns:
- the parent
CredentialsStoreAction
.
-
getUrlName
Return the URL name.- Returns:
- the URL name.
-
getDisplayName
Return the display name.- Specified by:
getDisplayName
in interfaceModelObject
- Returns:
- the display name.
-
getFullName
Return the full name.- Returns:
- the full name.
-
getFullDisplayName
Return the full display name.- Returns:
- the full display name.
-
getDescription
Expose theDomain.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
ExposeCredentialsStoreAction.CredentialsWrapper.DescriptorImpl
to Jelly.- Returns:
- the
CredentialsStoreAction.CredentialsWrapper.DescriptorImpl
singleton.
-
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
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.StaplerRequest req) throws javax.servlet.ServletException, IOException Creates a credential.- Parameters:
req
- the request.- Returns:
- the response.
- Throws:
javax.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.StaplerRequest req) throws javax.servlet.ServletException, IOException Updates the domain configuration.- Parameters:
req
- the request.- Returns:
- the response.
- Throws:
javax.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.StaplerRequest req) throws IOException Deletes a domain.- Parameters:
req
- the request.- Returns:
- the response.
- Throws:
IOException
- if something goes wrong.
-
getContextMenu
Creates the context menu with the supplied prefix to all URLs.- Parameters:
prefix
- the prefix to prepend to relative urls.- Returns:
- the
ModelObjectWithContextMenu.ContextMenu
ornull
- Since:
- 2.0
-
getChildrenContextMenu
Creates the children context menu with the supplied prefix to all URLs.- Parameters:
prefix
- the prefix to prepend to relative urls.- Returns:
- the
ModelObjectWithContextMenu.ContextMenu
ornull
- Since:
- 2.0
-
doContextMenu
public ModelObjectWithContextMenu.ContextMenu doContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) - Specified by:
doContextMenu
in interfaceModelObjectWithContextMenu
-
doChildrenContextMenu
public ModelObjectWithContextMenu.ContextMenu doChildrenContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) - Specified by:
doChildrenContextMenu
in interfaceModelObjectWithChildren
-
doConfigDotXml
@WebMethod(name="config.xml") @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public void doConfigDotXml(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException Accepts config.xml submission, as well as serve it.- Parameters:
req
- the requestrsp
- 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 aCredentials
by its XML definition.- Parameters:
source
- source of the Item's new definition. The source should be either aStreamSource
or aSAXSource
, other sources may not be handled.- Throws:
IOException
- if things go wrong.- Since:
- 2.1.1
-
getACL
- Specified by:
getACL
in interfaceAccessControlled
-
checkPermission
public void checkPermission(@NonNull Permission permission) throws org.springframework.security.access.AccessDeniedException - Specified by:
checkPermission
in interfaceAccessControlled
- Throws:
org.springframework.security.access.AccessDeniedException
-
hasPermission
- Specified by:
hasPermission
in interfaceAccessControlled
-