Class CredentialsProviderManager
- java.lang.Object
-
- hudson.model.DescriptorVisibilityFilter
-
- com.cloudbees.plugins.credentials.CredentialsProviderManager
-
- All Implemented Interfaces:
ExtensionPoint
,Saveable
,Serializable
@Extension public class CredentialsProviderManager extends DescriptorVisibilityFilter implements Serializable, Saveable
Manages the variousCredentialsProvider
implementations in aJenkins
- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CredentialsProviderManager.Configuration
Our global configuration.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description CredentialsProviderManager()
Our constructor.
-
Method Summary
-
Methods inherited from class hudson.model.DescriptorVisibilityFilter
all, apply, applyType, filterType
-
-
-
-
Method Detail
-
isEnabled
public static boolean isEnabled(CredentialsProvider provider)
Returnstrue
if and only if the specifiedCredentialsProvider
is enabled.- Parameters:
provider
- the specifiedCredentialsProvider
to check.- Returns:
true
if and only if the specifiedCredentialsProvider
is enabled.
-
getInstance
@Nullable public static CredentialsProviderManager getInstance()
Returns ourCredentialsProviderManager
singleton.- Returns:
CredentialsProviderManager
singleton ornull
-
getInstanceOrDie
@NonNull public static CredentialsProviderManager getInstanceOrDie()
Returns ourCredentialsProviderManager
singleton.- Returns:
CredentialsProviderManager
singleton
-
filter
public boolean filter(Object context, @NonNull Descriptor descriptor)
- Specified by:
filter
in classDescriptorVisibilityFilter
-
getConfigFile
public static XmlFile getConfigFile()
Gets the configuration file thatCredentialsProviderManager
uses to store its credentials.- Returns:
- the configuration file that
CredentialsProviderManager
uses to store its credentials.
-
save
public void save() throws IOException
- Specified by:
save
in interfaceSaveable
- Throws:
IOException
-
getProviderFilter
@NonNull public CredentialsProviderFilter getProviderFilter()
Gets the currentCredentialsProviderFilter
.- Returns:
- the current
CredentialsProviderFilter
.
-
setProviderFilter
public void setProviderFilter(@CheckForNull CredentialsProviderFilter providerFilter)
Sets theCredentialsProviderFilter
.- Parameters:
providerFilter
- the newCredentialsProviderFilter
.
-
getTypeFilter
@NonNull public CredentialsTypeFilter getTypeFilter()
Gets the currentCredentialsTypeFilter
.- Returns:
- the current
CredentialsTypeFilter
.
-
setTypeFilter
public void setTypeFilter(@CheckForNull CredentialsTypeFilter typeFilter)
Sets theCredentialsTypeFilter
.- Parameters:
typeFilter
- the newCredentialsTypeFilter
.
-
getRestrictions
@NonNull public List<CredentialsProviderTypeRestriction> getRestrictions()
Gets the current list ofCredentialsProviderTypeRestriction
instances.- Returns:
- the current list of
CredentialsProviderTypeRestriction
instances.
-
setRestrictions
public void setRestrictions(List<CredentialsProviderTypeRestriction> restrictions)
Sets the list ofCredentialsProviderTypeRestriction
instances.- Parameters:
restrictions
- the new list ofCredentialsProviderTypeRestriction
instances.
-
-