public final class

ProviderList

extends Object
java.lang.Object
   ↳ sun.security.jca.ProviderList

Class Overview

List of Providers. Used to represent the provider preferences. The system starts out with a ProviderList that only has the classNames of the Providers. Providers are loaded on demand only when needed. For compatibility reasons, Providers that could not be loaded are ignored and internally presented as the instance EMPTY_PROVIDER. However, those objects cannot be presented to applications. Call the convert() method to force all Providers to be loaded and to obtain a ProviderList with invalid entries removed. All this is handled by the Security class. Note that all indices used by this class are 0-based per general Java convention. These must be converted to the 1-based indices used by the Security class externally when needed. Instances of this class are immutable. This eliminates the need for cloning and synchronization in consumers. The add() and remove() style methods are static in order to avoid confusion about the immutability.

Summary

Public Methods
static ProviderList add(ProviderList providerList, Provider p)
int getIndex(String name)
Return the index at which the provider with the specified name is installed or -1 if it is not present in this ProviderList.
Provider getProvider(String name)
Provider.Service getService(String type, String name)
Return a Service describing an implementation of the specified algorithm from the Provider with the highest precedence that supports that algorithm.
List<Provider.Service> getServices(String type, List<String> algorithms)
This method is deprecated. use getServices(List) instead
List<Provider.Service> getServices(List<ServiceId> ids)
List<Provider.Service> getServices(String type, String algorithm)
Return a List containing all the Services describing implementations of the specified algorithms in precedence order.
static ProviderList insertAt(ProviderList providerList, Provider p, int position)
static ProviderList newList(Provider... providers)
List<Provider> providers()
Return an unmodifiable List of all Providers in this List.
static ProviderList remove(ProviderList providerList, String name)
int size()
Provider[] toArray()
String toString()
Returns a string representation of the object.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static ProviderList add (ProviderList providerList, Provider p)

public int getIndex (String name)

Return the index at which the provider with the specified name is installed or -1 if it is not present in this ProviderList.

public Provider getProvider (String name)

public Provider.Service getService (String type, String name)

Return a Service describing an implementation of the specified algorithm from the Provider with the highest precedence that supports that algorithm. Return null if no Provider supports this algorithm.

public List<Provider.Service> getServices (String type, List<String> algorithms)

This method is deprecated.
use getServices(List) instead

This method exists for compatibility with JCE only. It will be removed once JCE has been changed to use the replacement method.

public List<Provider.Service> getServices (List<ServiceId> ids)

public List<Provider.Service> getServices (String type, String algorithm)

Return a List containing all the Services describing implementations of the specified algorithms in precedence order. If no implementation exists, this method returns an empty List. The elements of this list are determined lazily on demand. The List returned is NOT thread safe.

public static ProviderList insertAt (ProviderList providerList, Provider p, int position)

public static ProviderList newList (Provider... providers)

public List<Provider> providers ()

Return an unmodifiable List of all Providers in this List. The individual Providers are loaded on demand. Elements that could not be initialized are replaced with EMPTY_PROVIDER.

public static ProviderList remove (ProviderList providerList, String name)

public int size ()

public Provider[] toArray ()

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.