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.
@FunctionalInterface public interface PasswordIdentityProvider
-
-
Field Summary
Fields Modifier and Type Field Description static PasswordIdentityProviderEMPTY_PASSWORDS_PROVIDERAn "empty" implementation ofPasswordIdentityProviderthat returns an empty group of passwords
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static java.lang.Iterable<java.lang.String>iterableOf(SessionContext session, java.util.Collection<? extends PasswordIdentityProvider> providers)Wraps a group ofPasswordIdentityProviderinto anIterableof their combined passwordsstatic java.util.Iterator<java.lang.String>iteratorOf(SessionContext session, PasswordIdentityProvider provider)Resolves a non-nulliterator of the available passwordsstatic java.util.Iterator<java.lang.String>iteratorOf(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords)Creates a "unified"Iteratorof passwords out of 2 possiblePasswordIdentityProviderjava.lang.Iterable<java.lang.String>loadPasswords(SessionContext session)static PasswordIdentityProvidermultiProvider(SessionContext session, java.util.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(java.lang.Iterable<java.lang.String> passwords)Wraps a group of passwords into aPasswordIdentityProviderstatic PasswordIdentityProviderwrapPasswords(java.lang.String... passwords)Wraps a group of passwords into aPasswordIdentityProvider
-
-
-
Field Detail
-
EMPTY_PASSWORDS_PROVIDER
static final PasswordIdentityProvider EMPTY_PASSWORDS_PROVIDER
An "empty" implementation ofPasswordIdentityProviderthat returns an empty group of passwords
-
-
Method Detail
-
loadPasswords
java.lang.Iterable<java.lang.String> loadPasswords(SessionContext session) throws java.io.IOException, java.security.GeneralSecurityException
- 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:
java.io.IOException- If failed to load the passwordsjava.security.GeneralSecurityException- If some security issue with the passwords
-
iteratorOf
static java.util.Iterator<java.lang.String> iteratorOf(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords) throws java.io.IOException, java.security.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:
java.io.IOException- If failed to load the passwordsjava.security.GeneralSecurityException- If some security issue with the passwords- See Also:
resolvePasswordIdentityProvider(SessionContext, PasswordIdentityProvider, PasswordIdentityProvider)
-
iteratorOf
static java.util.Iterator<java.lang.String> iteratorOf(SessionContext session, PasswordIdentityProvider provider) throws java.io.IOException, java.security.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:
java.io.IOException- If failed to load the passwordsjava.security.GeneralSecurityException- 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:
multiProvider(SessionContext, PasswordIdentityProvider...)
- 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(SessionContext, Collection)
-
multiProvider
static PasswordIdentityProvider multiProvider(SessionContext session, java.util.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 java.lang.Iterable<java.lang.String> iterableOf(SessionContext session, java.util.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
static PasswordIdentityProvider wrapPasswords(java.lang.String... passwords)
Wraps a group of passwords into aPasswordIdentityProvider- Parameters:
passwords- The passwords - ignored ifnull/empty (i.e., returnsEMPTY_PASSWORDS_PROVIDER)- Returns:
- The provider wrapper
-
wrapPasswords
static PasswordIdentityProvider wrapPasswords(java.lang.Iterable<java.lang.String> passwords)
Wraps a group of passwords into aPasswordIdentityProvider- Parameters:
passwords- The passwordsIterable- ignored ifnull(i.e., returnsEMPTY_PASSWORDS_PROVIDER)- Returns:
- The provider wrapper
-
-