Class DomainCredentials
java.lang.Object
com.cloudbees.plugins.credentials.domains.DomainCredentials
Represents a
Domain
and an associated set of Credentials
.- Since:
- 1.5
-
Constructor Summary
ConstructorDescriptionDomainCredentials
(Domain domain, List<Credentials> credentials) Stapler's constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<DomainCredentials>
asList
(Map<Domain, List<Credentials>> map) Converts aMap
keyed byDomain
withList
ofCredentials
as values into aList
ofDomainCredentials
into astatic Map<Domain,
List<Credentials>> asMap
(Collection<DomainCredentials> collection) Converts aCollection
ofDomainCredentials
into aMap
keyed byDomain
withList
ofCredentials
as values.static List<DomainCredentials>
fixList
(List<DomainCredentials> list) Helper method used by thedomainCredentials.jelly
taglib to ensure the list is valid.Returns the credentials.static <C extends Credentials>
List<C>getCredentials
(Map<Domain, List<Credentials>> domainCredentialsMap, Class<C> type, List<DomainRequirement> domainRequirements, CredentialsMatcher credentialsMatcher) Helper to assist retrieving credentials from the map based store.Returns the domain.static Map<Domain,
List<Credentials>> migrateListToMap
(Map<Domain, List<Credentials>> map, List<Credentials> list) Handle migration of standard storage method for pre-domain data into domain segmented data.static Map<Domain,
List<Credentials>> toCopyOnWriteMap
(Map<Domain, List<Credentials>> map) Converts aMap
keyed byDomain
withList
ofCredentials
as values into aList
ofDomainCredentials
into a
-
Constructor Details
-
DomainCredentials
Stapler's constructor.- Parameters:
domain
- the domain.credentials
- the credentials.
-
-
Method Details
-
asMap
@NonNull public static Map<Domain,List<Credentials>> asMap(@CheckForNull Collection<DomainCredentials> collection) Converts aCollection
ofDomainCredentials
into aMap
keyed byDomain
withList
ofCredentials
as values.- Parameters:
collection
- the collection.- Returns:
- the corresponding map.
-
asList
Converts aMap
keyed byDomain
withList
ofCredentials
as values into aList
ofDomainCredentials
into a- Parameters:
map
- the map.- Returns:
- the corresponding list.
-
toCopyOnWriteMap
@NonNull public static Map<Domain,List<Credentials>> toCopyOnWriteMap(@CheckForNull Map<Domain, List<Credentials>> map) Converts aMap
keyed byDomain
withList
ofCredentials
as values into aList
ofDomainCredentials
into a- Parameters:
map
- the map.- Returns:
- the corresponding list.
-
migrateListToMap
public static Map<Domain,List<Credentials>> migrateListToMap(@CheckForNull Map<Domain, List<Credentials>> map, @CheckForNull List<Credentials> list) Handle migration of standard storage method for pre-domain data into domain segmented data.- Parameters:
map
- the new map based store.list
- the old list based store.- Returns:
- consolidated map based store.
-
getCredentials
@NonNull public static <C extends Credentials> List<C> getCredentials(@NonNull Map<Domain, List<Credentials>> domainCredentialsMap, @NonNull Class<C> type, @NonNull List<DomainRequirement> domainRequirements, @NonNull CredentialsMatcher credentialsMatcher) Helper to assist retrieving credentials from the map based store.- Type Parameters:
C
- the type of credential to retrieve.- Parameters:
domainCredentialsMap
- map of credentials by domain.type
- type of credential to retrieve.domainRequirements
- domain requirements.credentialsMatcher
- what subset of credentials to match.- Returns:
- a
List
of matching credentials.
-
fixList
Helper method used by thedomainCredentials.jelly
taglib to ensure the list is valid.- Parameters:
list
- the list.- Returns:
- the list with fixes applied.
-
getDomain
Returns the domain.- Returns:
- the domain.
-
getCredentials
Returns the credentials.- Returns:
- the credentials.
-