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 exposeCredentials
instances into the web UI.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CredentialsStoreAction.CredentialsWrapper.DescriptorImpl
OurDescriptor
.-
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
-
Constructor Summary
Constructors Constructor Description CredentialsWrapper(CredentialsStoreAction.DomainWrapper domain, Credentials credentials, String id)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkPermission(Permission permission)
void
doConfigDotXml(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Accepts config.xml submission, as well as serve it.ModelObjectWithContextMenu.ContextMenu
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
doDoMove(org.kohsuke.stapler.StaplerRequest req, String destination)
Moves the credential.org.kohsuke.stapler.HttpResponse
doUpdateSubmit(org.kohsuke.stapler.StaplerRequest req)
Updates the credentials.ACL
getACL()
Api
getApi()
Expose a JenkinsApi
.ModelObjectWithContextMenu.ContextMenu
getContextMenu(String prefix)
Creates the context menu with the supplied prefix to all URLs.Credentials
getCredentials()
Exposes the backingCredentials
.String
getDescription()
Gets the description of theCredentials
.String
getDisplayName()
Gets the display name of theCredentials
.CredentialsStoreAction.DomainWrapper
getDomain()
Exposes the backingCredentialsStoreAction.DomainWrapper
.Fingerprint
getFingerprint()
Exposes the fingerprint for Jelly pages.String
getFullDisplayName()
Gets the full display name of theCredentials
.String
getFullName()
Gets the full name of theCredentials
.String
getIconClassName()
String
getId()
Return the id for the XML API.CredentialsStoreAction.DomainWrapper
getParent()
Exposes the backingCredentialsStoreAction.DomainWrapper
.CredentialsStore
getStore()
Exposes the backingCredentialsStore
.String
getTypeName()
Gets the display name of theCredentialsDescriptor
.String
getUrlName()
Return the URL name.boolean
hasPermission(Permission permission)
boolean
isFingerprintEnabled()
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 Detail
-
CredentialsWrapper
public CredentialsWrapper(CredentialsStoreAction.DomainWrapper domain, Credentials credentials, String id)
Constructor.- Parameters:
domain
- the wrapped domain.credentials
- the credentials.id
- the id.
-
-
Method Detail
-
getId
@Exported public String getId()
Return the id for the XML API.- Returns:
- the id.
- Since:
- 2.1.0
-
getUrlName
public String getUrlName()
Return the URL name.- Returns:
- the URL name.
-
getIconClassName
public String getIconClassName()
- Specified by:
getIconClassName
in interfaceIconSpec
-
getDisplayName
@Exported public String getDisplayName()
Gets the display name of theCredentials
.- Specified by:
getDisplayName
in interfaceModelObject
- Returns:
- the display name of the
Credentials
.
-
getTypeName
@Exported public String getTypeName()
Gets the display name of theCredentialsDescriptor
.- Returns:
- the display name of the
CredentialsDescriptor
.
-
getDescription
@Exported public String getDescription()
Gets the description of theCredentials
.- Returns:
- the description of the
Credentials
.
-
getFullName
@Exported public final String getFullName()
Gets the full name of theCredentials
.- Returns:
- the full name of the
Credentials
.
-
getFullDisplayName
public final String getFullDisplayName()
Gets the full display name of theCredentials
.- Returns:
- the full display name of the
Credentials
.
-
getCredentials
public Credentials getCredentials()
Exposes the backingCredentials
.- Returns:
- the backing
Credentials
.
-
getDomain
public CredentialsStoreAction.DomainWrapper getDomain()
Exposes the backingCredentialsStoreAction.DomainWrapper
.- Returns:
- the backing
CredentialsStoreAction.DomainWrapper
.
-
getParent
public CredentialsStoreAction.DomainWrapper getParent()
Exposes the backingCredentialsStoreAction.DomainWrapper
.- Returns:
- the backing
CredentialsStoreAction.DomainWrapper
.
-
getStore
public CredentialsStore getStore()
Exposes the backingCredentialsStore
.- Returns:
- the backing
CredentialsStore
.
-
getFingerprint
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Exported(visibility=1) public Fingerprint getFingerprint() throws IOException
Exposes 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
@NonNull public ACL getACL()
- Specified by:
getACL
in interfaceAccessControlled
-
checkPermission
public void checkPermission(@NonNull Permission permission) throws AccessDeniedException
- Specified by:
checkPermission
in interfaceAccessControlled
- Throws:
AccessDeniedException
-
hasPermission
public boolean hasPermission(@NonNull Permission permission)
- Specified by:
hasPermission
in interfaceAccessControlled
-
-