com.cloudbees.plugins.credentials
Class CredentialsProvider

java.lang.Object
  extended by com.cloudbees.plugins.credentials.CredentialsProvider
All Implemented Interfaces:
hudson.ExtensionPoint
Direct Known Subclasses:
SystemCredentialsProvider.ProviderImpl, UserCredentialsProvider

public abstract class CredentialsProvider
extends java.lang.Object
implements hudson.ExtensionPoint

An extension point for providing Credentials.


Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
CredentialsProvider()
           
 
Method Summary
static hudson.DescriptorExtensionList<Credentials,hudson.model.Descriptor<Credentials>> allCredentialsDescriptors()
          Returns all the registered Credentials descriptors.
<C extends Credentials>
java.util.List<C>
getCredentials(java.lang.Class<C> type, hudson.model.Item item, org.acegisecurity.Authentication authentication)
          Returns the credentials provided by this provider which are available to the specified Authentication for the specified Item
abstract
<C extends Credentials>
java.util.List<C>
getCredentials(java.lang.Class<C> type, hudson.model.ItemGroup itemGroup, org.acegisecurity.Authentication authentication)
          Returns the credentials provided by this provider which are available to the specified Authentication for items in the specified ItemGroup
 java.util.Set<CredentialsScope> getScopes(hudson.model.ModelObject object)
          Returns the scopes allowed for credentials stored within the specified object or null if the object is not relevant for scopes and the object's container should be considered instead.
static
<C extends Credentials>
java.util.List<C>
lookupCredentials(java.lang.Class<C> type)
          Returns all credentials which are available to the ACL.SYSTEM Authentication within the Hudson.getInstance().
static
<C extends Credentials>
java.util.List<C>
lookupCredentials(java.lang.Class<C> type, org.acegisecurity.Authentication authentication)
          Returns all credentials which are available to the specified Authentication within the Hudson.getInstance().
static
<C extends Credentials>
java.util.List<C>
lookupCredentials(java.lang.Class<C> type, hudson.model.Item item)
          Returns all credentials which are available to the ACL.SYSTEM Authentication for use by the specified Item.
static
<C extends Credentials>
java.util.List<C>
lookupCredentials(java.lang.Class<C> type, hudson.model.Item item, org.acegisecurity.Authentication authentication)
          Returns all credentials which are available to the specified Authentication for use by the specified Item.
static
<C extends Credentials>
java.util.List<C>
lookupCredentials(java.lang.Class<C> type, hudson.model.ItemGroup itemGroup)
          Returns all credentials which are available to the ACL.SYSTEM Authentication for use by the Items in the specified ItemGroup.
static
<C extends Credentials>
java.util.List<C>
lookupCredentials(java.lang.Class<C> type, hudson.model.ItemGroup itemGroup, org.acegisecurity.Authentication authentication)
          Returns all credentials which are available to the specified Authentication for use by the Items in the specified ItemGroup.
static java.util.Set<CredentialsScope> lookupScopes(hudson.model.ModelObject object)
          Returns the scopes allowed for credentials stored within the specified object or null if the object is not relevant for scopes and the object's container should be considered instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CredentialsProvider

public CredentialsProvider()
Method Detail

allCredentialsDescriptors

public static hudson.DescriptorExtensionList<Credentials,hudson.model.Descriptor<Credentials>> allCredentialsDescriptors()
Returns all the registered Credentials descriptors.

Returns:
all the registered Credentials descriptors.

getScopes

public java.util.Set<CredentialsScope> getScopes(hudson.model.ModelObject object)
Returns the scopes allowed for credentials stored within the specified object or null if the object is not relevant for scopes and the object's container should be considered instead.

Parameters:
object - the object.
Returns:
the set of scopes that are relevant for the object or null if the object is not a credentials container.

getCredentials

@NonNull
public abstract <C extends Credentials> java.util.List<C> getCredentials(@NonNull
                                                                                 java.lang.Class<C> type,
                                                                                 @Nullable
                                                                                 hudson.model.ItemGroup itemGroup,
                                                                                 @Nullable
                                                                                 org.acegisecurity.Authentication authentication)
Returns the credentials provided by this provider which are available to the specified Authentication for items in the specified ItemGroup

Parameters:
type - the type of credentials to return.
itemGroup - the item group (if null assume Hudson.getInstance().
authentication - the authentication (if null assume ACL.SYSTEM.
Returns:
the list of credentials.

getCredentials

@NonNull
public <C extends Credentials> java.util.List<C> getCredentials(@NonNull
                                                                        java.lang.Class<C> type,
                                                                        @NonNull
                                                                        hudson.model.Item item,
                                                                        @Nullable
                                                                        org.acegisecurity.Authentication authentication)
Returns the credentials provided by this provider which are available to the specified Authentication for the specified Item

Parameters:
type - the type of credentials to return.
item - the item.
authentication - the authentication (if null assume ACL.SYSTEM.
Returns:
the list of credentials.

lookupCredentials

@NonNull
public static <C extends Credentials> java.util.List<C> lookupCredentials(@NonNull
                                                                                  java.lang.Class<C> type)
Returns all credentials which are available to the ACL.SYSTEM Authentication within the Hudson.getInstance().

Type Parameters:
C - the credentials type.
Parameters:
type - the type of credentials to get.
Returns:
the list of credentials.

lookupCredentials

@NonNull
public static <C extends Credentials> java.util.List<C> lookupCredentials(@NonNull
                                                                                  java.lang.Class<C> type,
                                                                                  @Nullable
                                                                                  org.acegisecurity.Authentication authentication)
Returns all credentials which are available to the specified Authentication within the Hudson.getInstance().

Type Parameters:
C - the credentials type.
Parameters:
type - the type of credentials to get.
authentication - the authentication.
Returns:
the list of credentials.

lookupCredentials

@NonNull
public static <C extends Credentials> java.util.List<C> lookupCredentials(@NonNull
                                                                                  java.lang.Class<C> type,
                                                                                  @Nullable
                                                                                  hudson.model.Item item)
Returns all credentials which are available to the ACL.SYSTEM Authentication for use by the specified Item.

Type Parameters:
C - the credentials type.
Parameters:
type - the type of credentials to get.
item - the item.
Returns:
the list of credentials.

lookupCredentials

@NonNull
public static <C extends Credentials> java.util.List<C> lookupCredentials(@NonNull
                                                                                  java.lang.Class<C> type,
                                                                                  @Nullable
                                                                                  hudson.model.ItemGroup itemGroup)
Returns all credentials which are available to the ACL.SYSTEM Authentication for use by the Items in the specified ItemGroup.

Type Parameters:
C - the credentials type.
Parameters:
type - the type of credentials to get.
itemGroup - the item group.
Returns:
the list of credentials.

lookupCredentials

@NonNull
public static <C extends Credentials> java.util.List<C> lookupCredentials(@NonNull
                                                                                  java.lang.Class<C> type,
                                                                                  @Nullable
                                                                                  hudson.model.ItemGroup itemGroup,
                                                                                  @Nullable
                                                                                  org.acegisecurity.Authentication authentication)
Returns all credentials which are available to the specified Authentication for use by the Items in the specified ItemGroup.

Type Parameters:
C - the credentials type.
Parameters:
type - the type of credentials to get.
itemGroup - the item group.
authentication - the authentication.
Returns:
the list of credentials.

lookupCredentials

@NonNull
public static <C extends Credentials> java.util.List<C> lookupCredentials(@NonNull
                                                                                  java.lang.Class<C> type,
                                                                                  @Nullable
                                                                                  hudson.model.Item item,
                                                                                  @Nullable
                                                                                  org.acegisecurity.Authentication authentication)
Returns all credentials which are available to the specified Authentication for use by the specified Item.

Type Parameters:
C - the credentials type.
Parameters:
type - the type of credentials to get.
authentication - the authentication.
item - the item.
Returns:
the list of credentials.

lookupScopes

@CheckForNull
public static java.util.Set<CredentialsScope> lookupScopes(hudson.model.ModelObject object)
Returns the scopes allowed for credentials stored within the specified object or null if the object is not relevant for scopes and the object's container should be considered instead.

Parameters:
object - the object.
Returns:
the set of scopes that are relevant for the object or null if the object is not a credentials container.


Copyright © 2004-2012. All Rights Reserved.