Interface PasswordIdentityProvider
- All Known Subinterfaces:
AuthenticationIdentitiesProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PasswordIdentityProviderAn "empty" implementation ofPasswordIdentityProviderthat returns an empty group of passwords -
Method Summary
Modifier and TypeMethodDescriptioniterableOf(SessionContext session, Collection<? extends PasswordIdentityProvider> providers) Wraps a group ofPasswordIdentityProviderinto anIterableof their combined passwordsiteratorOf(SessionContext session, PasswordIdentityProvider provider) Resolves a non-nulliterator of the available passwordsiteratorOf(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords) Creates a "unified"Iteratorof passwords out of 2 possiblePasswordIdentityProviderloadPasswords(SessionContext session) static PasswordIdentityProvidermultiProvider(SessionContext session, Collection<? extends PasswordIdentityProvider> providers) Wraps a group ofPasswordIdentityProviderinto a single onestatic PasswordIdentityProvidermultiProvider(SessionContext session, PasswordIdentityProvider... providers) Wraps a group ofPasswordIdentityProviderinto a single onestatic PasswordIdentityProviderresolvePasswordIdentityProvider(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords) Creates a "unified"PasswordIdentityProviderout of 2 possible ones as follows:static PasswordIdentityProviderwrapPasswords(Iterable<String> passwords) Wraps a group of passwords into aPasswordIdentityProviderstatic PasswordIdentityProviderwrapPasswords(String... passwords) Wraps a group of passwords into aPasswordIdentityProvider
-
Field Details
-
EMPTY_PASSWORDS_PROVIDER
An "empty" implementation ofPasswordIdentityProviderthat returns an empty group of passwords
-
-
Method Details
-
loadPasswords
- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool).- Returns:
- The currently available passwords - ignored if
null - Throws:
IOException- If failed to load the passwordsGeneralSecurityException- If some security issue with the passwords
-
iteratorOf
static Iterator<String> iteratorOf(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords) throws IOException, GeneralSecurityException Creates a "unified"Iteratorof passwords out of 2 possiblePasswordIdentityProvider- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool).identities- The registered passwordspasswords- Extra available passwords- Returns:
- The wrapping iterator
- Throws:
IOException- If failed to load the passwordsGeneralSecurityException- If some security issue with the passwords- See Also:
-
iteratorOf
static Iterator<String> iteratorOf(SessionContext session, PasswordIdentityProvider provider) throws IOException, GeneralSecurityException Resolves a non-nulliterator of the available passwords- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool).provider- ThePasswordIdentityProvider- ignored ifnull(i.e., return an empty iterator)- Returns:
- A non-
nulliterator - which may be empty if no provider or no passwords - Throws:
IOException- If failed to load the passwordsGeneralSecurityException- If some security issue with the passwords
-
resolvePasswordIdentityProvider
static PasswordIdentityProvider resolvePasswordIdentityProvider(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords) Creates a "unified"
PasswordIdentityProviderout of 2 possible ones as follows:- If both are
nullthen returnnull. - If either one is
nullthen use the non-nullone. - If both are the same instance then use it.
- Otherwise, returns a wrapper that groups both providers.
- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool).identities- The registered passwordspasswords- The extra available passwords- Returns:
- The resolved provider
- See Also:
- If both are
-
multiProvider
static PasswordIdentityProvider multiProvider(SessionContext session, PasswordIdentityProvider... providers) Wraps a group ofPasswordIdentityProviderinto a single one- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool).providers- The providers - ignored ifnull/empty (i.e., returnsEMPTY_PASSWORDS_PROVIDER- Returns:
- The wrapping provider
- See Also:
-
multiProvider
static PasswordIdentityProvider multiProvider(SessionContext session, Collection<? extends PasswordIdentityProvider> providers) Wraps a group ofPasswordIdentityProviderinto a single one- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool).providers- The providers - ignored ifnull/empty (i.e., returnsEMPTY_PASSWORDS_PROVIDER- Returns:
- The wrapping provider
-
iterableOf
static Iterable<String> iterableOf(SessionContext session, Collection<? extends PasswordIdentityProvider> providers) Wraps a group ofPasswordIdentityProviderinto anIterableof their combined passwords- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool).providers- The providers - ignored ifnull/empty (i.e., returns an empty iterable instance)- Returns:
- The wrapping iterable
-
wrapPasswords
Wraps a group of passwords into aPasswordIdentityProvider- Parameters:
passwords- The passwords - ignored ifnull/empty (i.e., returnsEMPTY_PASSWORDS_PROVIDER)- Returns:
- The provider wrapper
-
wrapPasswords
Wraps a group of passwords into aPasswordIdentityProvider- Parameters:
passwords- The passwordsIterable- ignored ifnull(i.e., returnsEMPTY_PASSWORDS_PROVIDER)- Returns:
- The provider wrapper
-