com.cloudbees.plugins.credentials
Enum CredentialsScope

java.lang.Object
  extended by java.lang.Enum<CredentialsScope>
      extended by com.cloudbees.plugins.credentials.CredentialsScope
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<CredentialsScope>

public enum CredentialsScope
extends java.lang.Enum<CredentialsScope>
implements java.io.Serializable

The scope of credentials.


Enum Constant Summary
GLOBAL
          This credential is available to the object on which the credential is associated and all objects that are children of that object.
SYSTEM
          This credential is only available to the object on which the credential is associated.
USER
          This credential is available to the user which which the credential is associated.
 
Method Summary
abstract  java.lang.String getDisplayName()
          Gets the display name for the credentials.
static CredentialsScope valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static CredentialsScope[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SYSTEM

public static final CredentialsScope SYSTEM
This credential is only available to the object on which the credential is associated. Typically you would use SYSTEM scoped credentials for things like email auth, slave connection, etc, i.e. where the Jenkins instance itself is using the credential.


GLOBAL

public static final CredentialsScope GLOBAL
This credential is available to the object on which the credential is associated and all objects that are children of that object. Typically you would use GLOBAL scoped credentials for things that are needed by Jobs.


USER

public static final CredentialsScope USER
This credential is available to the user which which the credential is associated. Typically you would use USER scoped credentials where credentials are required for immediate actions. Some examples could include: The key point is that the user is making a request and instructing Jenkins to use one of their own credentials in the scope of the request. Where the request is something that happens automatically, e.g. a build triggered by SCM polling, then USER scoped credentials are not usually appropriate (unless the action is one that can fail gracefully)

Another way of looking at this is, if the action is one that is configured from the Job's Configure page, then don't use USER scope, as that prevents another user from modifying the job configuration (because they will only be able to see their own credentials)

Method Detail

values

public static CredentialsScope[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (CredentialsScope c : CredentialsScope.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CredentialsScope valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getDisplayName

public abstract java.lang.String getDisplayName()
Gets the display name for the credentials.

Returns:
The display name for the credentials.


Copyright © 2004-2012. All Rights Reserved.