java.lang.Object
org.forgerock.secrets.credentials.ValidCredentialPairs<S,E>
- Type Parameters:
S
- the type of secret stored in the credential pairsE
- the type of exception thrown by the secrets reference
A set of credential pairs built from a
ValidSecretsReference
.-
Method Summary
Modifier and TypeMethodDescriptionstatic <S extends Secret,
E extends Exception>
ValidCredentialPairs<S,E> credentialPairs
(ValidSecretsReference<S, E> validSecrets, Function<S, PrincipalAndSecret<S>> mapper) Factory method to create a new instance ofValidCredentialPairs
from a reference to a set of secrets that each contain a credential pair.static <S extends Secret,
E extends Exception>
ValidCredentialPairs<S,E> fixedPrincipalCredentialPairs
(String principal, ValidSecretsReference<S, E> validSecrets) Factory method to create a new instance ofValidCredentialPairs
from a reference to a set of secrets.get()
Get the valid credential pairs.getAsync()
Gets the valid credential pairs asynchronously.
-
Method Details
-
fixedPrincipalCredentialPairs
public static <S extends Secret,E extends Exception> ValidCredentialPairs<S,E> fixedPrincipalCredentialPairs(String principal, ValidSecretsReference<S, E> validSecrets) Factory method to create a new instance ofValidCredentialPairs
from a reference to a set of secrets. Each credential pair will have the same principal value.- Type Parameters:
S
- the type of secret stored in the credential pairsE
- the type of exception thrown by the secrets reference- Parameters:
principal
- the principal valuevalidSecrets
- the reference pointing to a set of secrets- Returns:
- the valid credential pairs reference
-
credentialPairs
public static <S extends Secret,E extends Exception> ValidCredentialPairs<S,E> credentialPairs(ValidSecretsReference<S, E> validSecrets, Function<S, PrincipalAndSecret<S>> mapper) Factory method to create a new instance ofValidCredentialPairs
from a reference to a set of secrets that each contain a credential pair.- Type Parameters:
S
- the type of secret stored in the credential pairsE
- the type of exception thrown by the secrets reference- Parameters:
validSecrets
- the reference pointing to a set of secrets containing the credential pairsmapper
- the mapper used to transform the secret content into a credential pair- Returns:
- the valid credential pairs reference
-
getAsync
Gets the valid credential pairs asynchronously.- Returns:
- a promise of the valid credential pairs or the exception thrown by the secrets reference
-
get
Get the valid credential pairs.- Returns:
- the valid credential pairs
- Throws:
E
- if the secrets reference throws an exception
-