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 exposeDomain
instances into the web UI.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CredentialsStoreAction.DomainWrapper.DescriptorImpl
Our Descriptor.-
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
-
Constructor Summary
Constructors Constructor Description DomainWrapper(CredentialsStoreAction parent, Domain domain)
Our constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkPermission(Permission permission)
ModelObjectWithContextMenu.ContextMenu
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.ModelObjectWithContextMenu.ContextMenu
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.ACL
getACL()
Api
getApi()
Expose a JenkinsApi
.ModelObjectWithContextMenu.ContextMenu
getChildrenContextMenu(String prefix)
Creates the children context menu with the supplied prefix to all URLs.ModelObjectWithContextMenu.ContextMenu
getContextMenu(String prefix)
Creates the context menu with the supplied prefix to all URLs.CredentialsStoreAction.CredentialsWrapper
getCredential(String id)
Get a credential by id.CredentialsStoreAction.CredentialsWrapper.DescriptorImpl
getCredentialDescriptor()
ExposeCredentialsStoreAction.CredentialsWrapper.DescriptorImpl
to Jelly.Map<String,CredentialsStoreAction.CredentialsWrapper>
getCredentials()
Exposes a map of the wrapped credentials.List<CredentialsStoreAction.CredentialsWrapper>
getCredentialsList()
Exposes the wrapped credentials for the XML API.String
getDescription()
Expose theDomain.getDescription()
.String
getDisplayName()
Return the display name.Domain
getDomain()
Expose the backingDomain
.String
getFullDisplayName()
Return the full display name.String
getFullName()
Return the full name.CredentialsStoreAction
getParent()
Expose the parentCredentialsStoreAction
.CredentialsStore
getStore()
Expose the backingCredentialsStore
.String
getUrlName()
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 Detail
-
DomainWrapper
public DomainWrapper(CredentialsStoreAction parent, Domain domain)
Our constructor.- Parameters:
parent
- our parent action.domain
- the domain we are wrapping.
-
-
Method Detail
-
getStore
public CredentialsStore getStore()
Expose the backingCredentialsStore
.- Returns:
- the backing
CredentialsStore
.
-
getParent
public CredentialsStoreAction getParent()
Expose the parentCredentialsStoreAction
.- 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 interfaceModelObject
- Returns:
- the display name.
-
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()
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
public CredentialsStoreAction.CredentialsWrapper.DescriptorImpl getCredentialDescriptor()
ExposeCredentialsStoreAction.CredentialsWrapper.DescriptorImpl
to Jelly.- 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.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
@CheckForNull 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
-
getChildrenContextMenu
@CheckForNull public ModelObjectWithContextMenu.ContextMenu getChildrenContextMenu(String prefix)
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
@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
-
-