Class ProviderUtil
- java.lang.Object
-
- org.wildfly.security.provider.util.ProviderUtil
-
public final class ProviderUtil extends Object
Utilities for dealing with security providers.- Author:
- David M. Lloyd
-
-
Field Summary
Fields Modifier and Type Field Description static Supplier<Provider[]>INSTALLED_PROVIDERS
-
Constructor Summary
Constructors Constructor Description ProviderUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Supplier<Provider[]>aggregate(Supplier<Provider[]>... suppliers)Create aSupplierof providers that is an aggregation of the result of multiple suppliers.static ProviderfindProvider(Provider[] providers, String providerName, Class<?> serviceType, String algorithm)Find the first provider from the supplier which provides the given service type and algorithm name.static ProviderfindProvider(Provider[] providers, String providerName, String serviceType, String algorithm)Find the first provider from the supplier which provides the given service type and algorithm name.static ProviderfindProvider(Supplier<Provider[]> providerSupplier, String providerName, Class<?> serviceType, String algorithm)Find the first provider from the supplier which provides the given service type and algorithm name.static ProviderfindProvider(Supplier<Provider[]> providerSupplier, String providerName, String serviceType, String algorithm)Find the first provider from the supplier which provides the given service type and algorithm name.static Provider.ServicefindProviderService(Provider[] providers, String providerName, Class<?> serviceType, String algorithm)Find a provider service which provides the given service type and algorithm name.static Provider.ServicefindProviderService(Provider[] providers, String providerName, String serviceType, String algorithm)Find a provider service which provides the given service type and algorithm name.static Provider.ServicefindProviderService(Provider[] providers, Predicate<Provider.Service> matchPredicate)Find a provider service which matches the given predicate.static Provider.ServicefindProviderService(Supplier<Provider[]> providerSupplier, String providerName, Class<?> serviceType, String algorithm)Find a provider service which provides the given service type and algorithm name.static Provider.ServicefindProviderService(Supplier<Provider[]> providerSupplier, String providerName, String serviceType, String algorithm)Find a provider service which provides the given service type and algorithm name.static Provider.ServicefindProviderService(Supplier<Provider[]> providerSupplier, Predicate<Provider.Service> matchPredicate)Find a provider service which matches the given predicate.
-
-
-
Method Detail
-
findProvider
public static Provider findProvider(Supplier<Provider[]> providerSupplier, String providerName, Class<?> serviceType, String algorithm)
Find the first provider from the supplier which provides the given service type and algorithm name. The simple name of the service type class is used to identify the service. If a providerName is specified the match will only be tested against providers with the name specified.- Parameters:
providerSupplier- the provider supplier (must not benull)providerName- the name of the provider, can benullserviceType- the service type as a class name (must not benull)algorithm- the algorithm name (must not benull)- Returns:
- the provider, or
nullif none is found
-
findProvider
public static Provider findProvider(Provider[] providers, String providerName, Class<?> serviceType, String algorithm)
Find the first provider from the supplier which provides the given service type and algorithm name. The simple name of the service type class is used to identify the service. If a providerName is specified the match will only be tested against providers with the name specified.- Parameters:
providers- the providers to searchr (must not benull)providerName- the name of the provider, can benullserviceType- the service type as a class name (must not benull)algorithm- the algorithm name (must not benull)- Returns:
- the provider, or
nullif none is found
-
findProvider
public static Provider findProvider(Supplier<Provider[]> providerSupplier, String providerName, String serviceType, String algorithm)
Find the first provider from the supplier which provides the given service type and algorithm name. If a providerName is specified the match will only be tested against providers with the name specified.- Parameters:
providerSupplier- the provider supplier (must not benull)providerName- the name of the provider, can benullserviceType- the service type (must not benull)algorithm- the algorithm name (must not benull)- Returns:
- the provider, or
nullif none is found
-
findProvider
public static Provider findProvider(Provider[] providers, String providerName, String serviceType, String algorithm)
Find the first provider from the supplier which provides the given service type and algorithm name. If a providerName is specified the match will only be tested against providers with the name specified.- Parameters:
providers- the providers to search (must not benull)providerName- the name of the provider, can benullserviceType- the service type (must not benull)algorithm- the algorithm name (must not benull)- Returns:
- the provider, or
nullif none is found
-
findProviderService
public static Provider.Service findProviderService(Supplier<Provider[]> providerSupplier, String providerName, Class<?> serviceType, String algorithm)
Find a provider service which provides the given service type and algorithm name. If a providerName is specified the match will only be tested against providers with the name specified.- Parameters:
providerSupplier- the provider supplier (must not benull)providerName- the name of the provider, can benullserviceType- the service type (must not benull)algorithm- the algorithm name (must not benull)- Returns:
- the provider service, or
nullif none is found
-
findProviderService
public static Provider.Service findProviderService(Provider[] providers, String providerName, Class<?> serviceType, String algorithm)
Find a provider service which provides the given service type and algorithm name. If a providerName is specified the match will only be tested against providers with the name specified.- Parameters:
providers- the providers to search (must not benull)providerName- the name of the provider, can benullserviceType- the service type (must not benull)algorithm- the algorithm name (must not benull)- Returns:
- the provider service, or
nullif none is found
-
findProviderService
public static Provider.Service findProviderService(Supplier<Provider[]> providerSupplier, String providerName, String serviceType, String algorithm)
Find a provider service which provides the given service type and algorithm name. If a providerName is specified the match will only be tested against providers with the name specified.- Parameters:
providerSupplier- the provider supplier (must not benull)providerName- the name of the provider, can benullserviceType- the service type (must not benull)algorithm- the algorithm name (must not benull)- Returns:
- the provider service, or
nullif none is found
-
findProviderService
public static Provider.Service findProviderService(Provider[] providers, String providerName, String serviceType, String algorithm)
Find a provider service which provides the given service type and algorithm name. If a providerName is specified the match will only be tested against providers with the name specified.- Parameters:
providers- the providers to search (must not benull)providerName- the name of the provider, can benullserviceType- the service type (must not benull)algorithm- the algorithm name (must not benull)- Returns:
- the provider service, or
nullif none is found
-
findProviderService
public static Provider.Service findProviderService(Supplier<Provider[]> providerSupplier, Predicate<Provider.Service> matchPredicate)
Find a provider service which matches the given predicate.- Parameters:
providerSupplier- the provider suppliermatchPredicate- the predicate to test- Returns:
- the provider service, or
nullif none is found
-
findProviderService
public static Provider.Service findProviderService(Provider[] providers, Predicate<Provider.Service> matchPredicate)
Find a provider service which matches the given predicate.- Parameters:
providers- the providers to searchmatchPredicate- the predicate to test- Returns:
- the provider service, or
nullif none is found
-
aggregate
public static Supplier<Provider[]> aggregate(Supplier<Provider[]>... suppliers)
Create aSupplierof providers that is an aggregation of the result of multiple suppliers. The aggregation will be performed the first time the supplier is called and the results cached.- Parameters:
suppliers- the suppliers to aggregate.- Returns:
- A supplier which will return an aggregation of all of the suppliers.
-
-