Class Services
- java.lang.Object
-
- org.apache.harmony.security.fortress.Services
-
public class Services extends Object
This class contains information about all registered providers and preferred implementations for all "serviceName.algName".
-
-
Constructor Summary
Constructors Constructor Description Services()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetCacheVersion()Returns the current cache version.static ProvidergetProvider(String name)Returns the provider with the specified name.static ArrayList<Provider>getProviders()Returns the actual registered providers.static Provider.ServicegetSecureRandomService()Returns the default SecureRandom service description.static ArrayList<Provider.Service>getServices(String type)Looks up the requested service by type.static ArrayList<Provider.Service>getServices(String type, String algorithm)Looks up the requested service by type and algorithm.static intinsertProviderAt(Provider provider, int position)Inserts a provider at a specified 1-based position.static voidremoveProvider(int providerNumber)Removes the provider at the specified 1-based position.static voidsetNeedRefresh()In addition to being used here when the list of providers changes, this method is also used by the Provider implementation to indicate that a provides list of services has changed.
-
-
-
Method Detail
-
getProviders
public static ArrayList<Provider> getProviders()
Returns the actual registered providers.
-
getProvider
public static Provider getProvider(String name)
Returns the provider with the specified name.
-
insertProviderAt
public static int insertProviderAt(Provider provider, int position)
Inserts a provider at a specified 1-based position.
-
removeProvider
public static void removeProvider(int providerNumber)
Removes the provider at the specified 1-based position.
-
getServices
public static ArrayList<Provider.Service> getServices(String type)
Looks up the requested service by type. The servicetypeand should be provided in the same format used when registering a service with a provider, for example, "KeyFactory". Callers can cache the returned service information but such caches should be validated against the result of Service.getCacheVersion() before use. Returnsnullif there are no services of the giventypefound.
-
getServices
public static ArrayList<Provider.Service> getServices(String type, String algorithm)
Looks up the requested service by type and algorithm. The servicetypeand should be provided in the same format used when registering a service with a provider, for example, "KeyFactory" and "RSA". Callers can cache the returned service information but such caches should be validated against the result of Service.getCacheVersion() before use. Returnsnullif there are no services found.
-
getSecureRandomService
public static Provider.Service getSecureRandomService()
Returns the default SecureRandom service description.
-
setNeedRefresh
public static void setNeedRefresh()
In addition to being used here when the list of providers changes, this method is also used by the Provider implementation to indicate that a provides list of services has changed.
-
getCacheVersion
public static int getCacheVersion()
Returns the current cache version. This has the possible side effect of updating the cache if needed.
-
-