Package org.wildfly.security.sasl.util
Class SaslFactories
- java.lang.Object
-
- org.wildfly.security.sasl.util.SaslFactories
-
public final class SaslFactories extends Object
A utility class for discovering SASL client and server factories.- Author:
- David M. Lloyd
-
-
Field Summary
Fields Modifier and Type Field Description private static SaslClientFactory
EMPTY_SASL_CLIENT_FACTORY
private static SaslServerFactory
EMPTY_SASL_SERVER_FACTORY
(package private) static String[]
NO_STRINGS
(package private) static String
PROVIDER_FILTER_KEY
private static SecurityProviderSaslClientFactory
providerSaslClientFactory
private static SecurityProviderSaslServerFactory
providerSaslServerFactory
-
Constructor Summary
Constructors Modifier Constructor Description private
SaslFactories()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static String[]
filterMechanismsByProvider(String[] orig, int idx, int len, Provider currentProvider, BiPredicate<String,Provider> mechFilter)
Efficiently, recursively filter mechanisms by provider.static SaslClientFactory
getElytronSaslClientFactory()
Get a SASL client factory which returns an Elytron-provided mechanism.static SaslServerFactory
getElytronSaslServerFactory()
Get a SASL server factory which returns an Elytron-provided mechanism.static SaslClientFactory
getEmptySaslClientFactory()
Get aSaslClientFactory
which does not provide any mechanisms.static SaslServerFactory
getEmptySaslServerFactory()
Get aSaslServerFactory
which does not provide any mechanisms.(package private) static BiPredicate<String,Provider>
getProviderFilterPredicate(Map<String,?> props)
static SecurityProviderSaslClientFactory
getProviderSaslClientFactory()
Get a SASL client factory which uses the currently installed security providers to locate mechanisms.static SecurityProviderSaslServerFactory
getProviderSaslServerFactory()
Get a SASL server factory which uses the currently installed security providers to locate mechanisms.static SaslClientFactory
getSearchSaslClientFactory(ClassLoader... classLoaders)
Get a SASL client factory which searches all the given class loaders in order for mechanisms.static SaslServerFactory
getSearchSaslServerFactory(ClassLoader... classLoaders)
Get a SASL server factory which searches all the given class loaders in order for mechanisms.
-
-
-
Field Detail
-
providerSaslClientFactory
private static final SecurityProviderSaslClientFactory providerSaslClientFactory
-
providerSaslServerFactory
private static final SecurityProviderSaslServerFactory providerSaslServerFactory
-
NO_STRINGS
static final String[] NO_STRINGS
-
PROVIDER_FILTER_KEY
static final String PROVIDER_FILTER_KEY
- See Also:
- Constant Field Values
-
EMPTY_SASL_CLIENT_FACTORY
private static final SaslClientFactory EMPTY_SASL_CLIENT_FACTORY
-
EMPTY_SASL_SERVER_FACTORY
private static final SaslServerFactory EMPTY_SASL_SERVER_FACTORY
-
-
Method Detail
-
getElytronSaslClientFactory
public static SaslClientFactory getElytronSaslClientFactory()
Get a SASL client factory which returns an Elytron-provided mechanism.- Returns:
- the SASL client factory (not
null
)
-
getElytronSaslServerFactory
public static SaslServerFactory getElytronSaslServerFactory()
Get a SASL server factory which returns an Elytron-provided mechanism.- Returns:
- the SASL server factory (not
null
)
-
getSearchSaslClientFactory
public static SaslClientFactory getSearchSaslClientFactory(ClassLoader... classLoaders)
Get a SASL client factory which searches all the given class loaders in order for mechanisms.- Parameters:
classLoaders
- the class loaders to search- Returns:
- the SASL client factory (not
null
)
-
getSearchSaslServerFactory
public static SaslServerFactory getSearchSaslServerFactory(ClassLoader... classLoaders)
Get a SASL server factory which searches all the given class loaders in order for mechanisms.- Parameters:
classLoaders
- the class loaders to search- Returns:
- the SASL server factory (not
null
)
-
getProviderSaslClientFactory
public static SecurityProviderSaslClientFactory getProviderSaslClientFactory()
Get a SASL client factory which uses the currently installed security providers to locate mechanisms.- Returns:
- the SASL client factory (not
null
)
-
getProviderSaslServerFactory
public static SecurityProviderSaslServerFactory getProviderSaslServerFactory()
Get a SASL server factory which uses the currently installed security providers to locate mechanisms.- Returns:
- the SASL server factory (not
null
)
-
getEmptySaslClientFactory
public static SaslClientFactory getEmptySaslClientFactory()
Get aSaslClientFactory
which does not provide any mechanisms.
-
getEmptySaslServerFactory
public static SaslServerFactory getEmptySaslServerFactory()
Get aSaslServerFactory
which does not provide any mechanisms.
-
filterMechanismsByProvider
static String[] filterMechanismsByProvider(String[] orig, int idx, int len, Provider currentProvider, BiPredicate<String,Provider> mechFilter)
Efficiently, recursively filter mechanisms by provider. If the filter accepts all array elements, the original array is returned unchanged. If the filter accepts none of the array elements, an empty array is returned.- Parameters:
orig
- the original mech arrayidx
- the recursive read index (start from 0)len
- the recursive write length (start from 0)currentProvider
- the provider being testedmechFilter
- the filter predicate- Returns:
- the filtered array
-
getProviderFilterPredicate
static BiPredicate<String,Provider> getProviderFilterPredicate(Map<String,?> props)
-
-