Class DomainCredentials
- java.lang.Object
-
- com.cloudbees.plugins.credentials.domains.DomainCredentials
-
public class DomainCredentials extends Object
Represents aDomain
and an associated set ofCredentials
.- Since:
- 1.5
-
-
Constructor Summary
Constructors Constructor Description DomainCredentials(Domain domain, List<Credentials> credentials)
Stapler's constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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.List<Credentials>
getCredentials()
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.Domain
getDomain()
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 Detail
-
DomainCredentials
@DataBoundConstructor public DomainCredentials(Domain domain, List<Credentials> credentials)
Stapler's constructor.- Parameters:
domain
- the domain.credentials
- the credentials.
-
-
Method Detail
-
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
@NonNull public static List<DomainCredentials> asList(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.
-
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
@NonNull public static List<DomainCredentials> fixList(@CheckForNull List<DomainCredentials> list)
Helper method used by thedomainCredentials.jelly
taglib to ensure the list is valid.- Parameters:
list
- the list.- Returns:
- the list with fixes applied.
-
getDomain
@NonNull public Domain getDomain()
Returns the domain.- Returns:
- the domain.
-
getCredentials
@NonNull public List<Credentials> getCredentials()
Returns the credentials.- Returns:
- the credentials.
-
-