Class CredentialsStoreAction.CredentialsWrapper
java.lang.Object
hudson.model.AbstractDescribableImpl<CredentialsStoreAction.CredentialsWrapper>
com.cloudbees.plugins.credentials.CredentialsStoreAction.CredentialsWrapper
- All Implemented Interfaces:
Describable<CredentialsStoreAction.CredentialsWrapper>
,ModelObject
,AccessControlled
,ModelObjectWithContextMenu
,IconSpec
- Enclosing class:
- CredentialsStoreAction
@ExportedBean
public static class CredentialsStoreAction.CredentialsWrapper
extends AbstractDescribableImpl<CredentialsStoreAction.CredentialsWrapper>
implements IconSpec, ModelObjectWithContextMenu, AccessControlled
A wrapper object to bind and expose
Credentials
instances into the web UI.-
Nested Class Summary
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
Constructor Summary
ConstructorDescriptionCredentialsWrapper
(CredentialsStoreAction.DomainWrapper domain, Credentials credentials, String id) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkPermission
(Permission permission) void
doConfigDotXml
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) Accepts config.xml submission, as well as serve it.doContextMenu
(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) org.kohsuke.stapler.HttpResponse
doDoDelete
(org.kohsuke.stapler.StaplerRequest req) Deletes the credentials.org.kohsuke.stapler.HttpResponse
Moves the credential.org.kohsuke.stapler.HttpResponse
doUpdateSubmit
(org.kohsuke.stapler.StaplerRequest req) Updates the credentials.getACL()
getApi()
Expose a JenkinsApi
.getContextMenu
(String prefix) Creates the context menu with the supplied prefix to all URLs.Exposes the backingCredentials
.Gets the description of theCredentials
.Gets the display name of theCredentials
.Exposes the backingCredentialsStoreAction.DomainWrapper
.Exposes the fingerprint for Jelly pages.final String
Gets the full display name of theCredentials
.final String
Gets the full name of theCredentials
.getId()
Return the id for the XML API.Exposes the backingCredentialsStoreAction.DomainWrapper
.getStore()
Exposes the backingCredentialsStore
.Gets the display name of theCredentialsDescriptor
.Return the URL name.boolean
hasPermission
(Permission permission) boolean
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
-
CredentialsWrapper
public CredentialsWrapper(CredentialsStoreAction.DomainWrapper domain, Credentials credentials, String id) Constructor.- Parameters:
domain
- the wrapped domain.credentials
- the credentials.id
- the id.
-
-
Method Details
-
getId
Return the id for the XML API.- Returns:
- the id.
- Since:
- 2.1.0
-
getUrlName
Return the URL name.- Returns:
- the URL name.
-
getIconClassName
- Specified by:
getIconClassName
in interfaceIconSpec
-
getApi
Expose a JenkinsApi
.- Returns:
- the
Api
.
-
getDisplayName
Gets the display name of theCredentials
.- Specified by:
getDisplayName
in interfaceModelObject
- Returns:
- the display name of the
Credentials
.
-
getTypeName
Gets the display name of theCredentialsDescriptor
.- Returns:
- the display name of the
CredentialsDescriptor
.
-
getDescription
Gets the description of theCredentials
.- Returns:
- the description of the
Credentials
.
-
getFullName
Gets the full name of theCredentials
.- Returns:
- the full name of the
Credentials
.
-
getFullDisplayName
Gets the full display name of theCredentials
.- Returns:
- the full display name of the
Credentials
.
-
getCredentials
Exposes the backingCredentials
.- Returns:
- the backing
Credentials
.
-
getDomain
Exposes the backingCredentialsStoreAction.DomainWrapper
.- Returns:
- the backing
CredentialsStoreAction.DomainWrapper
.
-
getParent
Exposes the backingCredentialsStoreAction.DomainWrapper
.- Returns:
- the backing
CredentialsStoreAction.DomainWrapper
.
-
getStore
Exposes the backingCredentialsStore
.- Returns:
- the backing
CredentialsStore
.
-
getFingerprint
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Exported(visibility=1) public Fingerprint getFingerprint() throws IOExceptionExposes the fingerprint for Jelly pages.- Returns:
- the
Fingerprint
. - Throws:
IOException
- if theFingerprint
could not be retrieved.- Since:
- 2.1.1
-
isFingerprintEnabled
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isFingerprintEnabled() -
doDoDelete
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public org.kohsuke.stapler.HttpResponse doDoDelete(org.kohsuke.stapler.StaplerRequest req) throws IOException Deletes the credentials.- Parameters:
req
- the request.- Returns:
- the response.
- Throws:
IOException
- if something goes wrong.
-
doDoMove
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public org.kohsuke.stapler.HttpResponse doDoMove(org.kohsuke.stapler.StaplerRequest req, @QueryParameter String destination) throws IOException Moves the credential.- Parameters:
req
- the request.destination
- the destination- Returns:
- the response.
- Throws:
IOException
- if something goes wrong.
-
doUpdateSubmit
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public org.kohsuke.stapler.HttpResponse doUpdateSubmit(org.kohsuke.stapler.StaplerRequest req) throws javax.servlet.ServletException, IOException Updates the credentials.- Parameters:
req
- the request.- Returns:
- the response.
- Throws:
javax.servlet.ServletException
- if something goes wrong.IOException
- if something goes wrong.
-
getContextMenu
@CheckForNull @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public ModelObjectWithContextMenu.ContextMenu getContextMenu(String prefix) 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
-
doContextMenu
public ModelObjectWithContextMenu.ContextMenu doContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) - Specified by:
doContextMenu
in interfaceModelObjectWithContextMenu
-
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
-