@FunctionalInterface
public interface PasswordIdentityProvider
Modifier and Type | Field and Description |
---|---|
static PasswordIdentityProvider |
EMPTY_PASSWORDS_PROVIDER
An "empty" implementation of
PasswordIdentityProvider that returns an empty group of passwords |
Modifier and Type | Method and Description |
---|---|
static java.lang.Iterable<java.lang.String> |
iterableOf(SessionContext session,
java.util.Collection<? extends PasswordIdentityProvider> providers)
Wraps a group of
PasswordIdentityProvider into an Iterable of their combined passwords |
static java.util.Iterator<java.lang.String> |
iteratorOf(SessionContext session,
PasswordIdentityProvider provider)
Resolves a non-
null iterator of the available passwords |
static java.util.Iterator<java.lang.String> |
iteratorOf(SessionContext session,
PasswordIdentityProvider identities,
PasswordIdentityProvider passwords)
Creates a "unified"
Iterator of passwords out of 2 possible PasswordIdentityProvider |
java.lang.Iterable<java.lang.String> |
loadPasswords(SessionContext session) |
static PasswordIdentityProvider |
multiProvider(SessionContext session,
java.util.Collection<? extends PasswordIdentityProvider> providers)
Wraps a group of
PasswordIdentityProvider into a single one |
static PasswordIdentityProvider |
multiProvider(SessionContext session,
PasswordIdentityProvider... providers)
Wraps a group of
PasswordIdentityProvider into a single one |
static PasswordIdentityProvider |
resolvePasswordIdentityProvider(SessionContext session,
PasswordIdentityProvider identities,
PasswordIdentityProvider passwords)
Creates a "unified"
PasswordIdentityProvider out of 2 possible ones as follows: |
static PasswordIdentityProvider |
wrapPasswords(java.lang.Iterable<java.lang.String> passwords)
Wraps a group of passwords into a
PasswordIdentityProvider |
static PasswordIdentityProvider |
wrapPasswords(java.lang.String... passwords)
Wraps a group of passwords into a
PasswordIdentityProvider |
static final PasswordIdentityProvider EMPTY_PASSWORDS_PROVIDER
PasswordIdentityProvider
that returns an empty group of passwordsjava.lang.Iterable<java.lang.String> loadPasswords(SessionContext session) throws java.io.IOException, java.security.GeneralSecurityException
session
- The SessionContext
for invoking this load command - may be null
if not invoked within a session context (e.g., offline tool).null
java.io.IOException
- If failed to load the passwordsjava.security.GeneralSecurityException
- If some security issue with the passwordsstatic java.util.Iterator<java.lang.String> iteratorOf(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords) throws java.io.IOException, java.security.GeneralSecurityException
Iterator
of passwords out of 2 possible PasswordIdentityProvider
session
- The SessionContext
for invoking this load command - may be null
if not invoked within a session context (e.g., offline tool).identities
- The registered passwordspasswords
- Extra available passwordsjava.io.IOException
- If failed to load the passwordsjava.security.GeneralSecurityException
- If some security issue with the passwordsresolvePasswordIdentityProvider(SessionContext, PasswordIdentityProvider,
PasswordIdentityProvider)
static java.util.Iterator<java.lang.String> iteratorOf(SessionContext session, PasswordIdentityProvider provider) throws java.io.IOException, java.security.GeneralSecurityException
null
iterator of the available passwordssession
- The SessionContext
for invoking this load command - may be null
if not invoked within a session context (e.g., offline tool).provider
- The PasswordIdentityProvider
- ignored if null
(i.e., return an
empty iterator)null
iterator - which may be empty if no provider or no passwordsjava.io.IOException
- If failed to load the passwordsjava.security.GeneralSecurityException
- If some security issue with the passwordsstatic PasswordIdentityProvider resolvePasswordIdentityProvider(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords)
Creates a "unified" PasswordIdentityProvider
out of 2 possible ones as follows:
null
then return null
.null
then use the non-null
one.session
- The SessionContext
for invoking this load command - may be null
if not invoked
within a session context (e.g., offline tool).identities
- The registered passwordspasswords
- The extra available passwordsmultiProvider(SessionContext, PasswordIdentityProvider...)
static PasswordIdentityProvider multiProvider(SessionContext session, PasswordIdentityProvider... providers)
PasswordIdentityProvider
into a single onesession
- The SessionContext
for invoking this load command - may be null
if not invoked
within a session context (e.g., offline tool).providers
- The providers - ignored if null
/empty (i.e., returns EMPTY_PASSWORDS_PROVIDER
multiProvider(SessionContext, Collection)
static PasswordIdentityProvider multiProvider(SessionContext session, java.util.Collection<? extends PasswordIdentityProvider> providers)
PasswordIdentityProvider
into a single onesession
- The SessionContext
for invoking this load command - may be null
if not invoked
within a session context (e.g., offline tool).providers
- The providers - ignored if null
/empty (i.e., returns EMPTY_PASSWORDS_PROVIDER
static java.lang.Iterable<java.lang.String> iterableOf(SessionContext session, java.util.Collection<? extends PasswordIdentityProvider> providers)
PasswordIdentityProvider
into an Iterable
of their combined passwordssession
- The SessionContext
for invoking this load command - may be null
if not invoked
within a session context (e.g., offline tool).providers
- The providers - ignored if null
/empty (i.e., returns an empty iterable instance)static PasswordIdentityProvider wrapPasswords(java.lang.String... passwords)
PasswordIdentityProvider
passwords
- The passwords - ignored if null
/empty (i.e., returns EMPTY_PASSWORDS_PROVIDER
)static PasswordIdentityProvider wrapPasswords(java.lang.Iterable<java.lang.String> passwords)
PasswordIdentityProvider
passwords
- The passwords Iterable
- ignored if null
(i.e., returns
EMPTY_PASSWORDS_PROVIDER
)