com.cloudbees.plugins.credentials
Class CredentialsDescriptor

java.lang.Object
  extended by hudson.model.Descriptor<Credentials>
      extended by com.cloudbees.plugins.credentials.CredentialsDescriptor
All Implemented Interfaces:
hudson.model.Saveable

public abstract class CredentialsDescriptor
extends hudson.model.Descriptor<Credentials>

Descriptor for credentials.


Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.model.Descriptor
hudson.model.Descriptor.FormException, hudson.model.Descriptor.PropertyType
 
Field Summary
 
Fields inherited from class hudson.model.Descriptor
clazz
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
protected CredentialsDescriptor()
          Infers the type of the corresponding Credentials from the outer class.
protected CredentialsDescriptor(java.lang.Class<? extends Credentials> clazz)
          Constructor.
 
Method Summary
 hudson.util.ListBoxModel doFillScopeItems()
          Fills in the scopes for a scope list-box.
 java.lang.String getCredentialsPage()
          Returns the config page for the credentials.
 boolean isScopeRelevant()
          Checks if asking for a credentials scope is relevant.
 boolean isScopeRelevant(hudson.model.ModelObject object)
          Similar to isScopeRelevant() but operating on a specific ModelObject rather than trying to infer from the stapler request.
 
Methods inherited from class hudson.model.Descriptor
calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, getCheckUrl, getConfigPage, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getPropertyType, getPropertyType, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, toArray, toList, toMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CredentialsDescriptor

protected CredentialsDescriptor(java.lang.Class<? extends Credentials> clazz)
Constructor.

Parameters:
clazz - The concrete credentials class.
Since:
1.2

CredentialsDescriptor

protected CredentialsDescriptor()
Infers the type of the corresponding Credentials from the outer class. This version works when you follow the common convention, where a descriptor is written as the static nested class of the describable class.

Since:
1.3
Method Detail

doFillScopeItems

public hudson.util.ListBoxModel doFillScopeItems()
Fills in the scopes for a scope list-box.

Returns:
the scopes for the nearest request object that acts as a container for credentials.

isScopeRelevant

public boolean isScopeRelevant()
Checks if asking for a credentials scope is relevant. For example, when a scope will be stored in UserCredentialsProvider, there is no need to specify the scope, as it can only be CredentialsScope.USER, but where the credential will be stored in SystemCredentialsProvider, there are multiple scopes relevant for that container, so the scope field is relevant.

Returns:
true if the nearest request object that acts as a container for credentials needs a scope to be specified.

isScopeRelevant

public boolean isScopeRelevant(hudson.model.ModelObject object)
Similar to isScopeRelevant() but operating on a specific ModelObject rather than trying to infer from the stapler request.

Parameters:
object - the object that is going to contain the credential.
Returns:
true if there is more than one CredentialsScope that can be used for the specified object.

getCredentialsPage

public java.lang.String getCredentialsPage()
Returns the config page for the credentials.

Returns:
the config page for the credentials.


Copyright © 2004-2012. All Rights Reserved.