|
Oracle Application Server HTTPClient Java API Reference 10g Release 3 (10.1.3.1.0) B32117-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
HTTPClient.AuthenticationSchemeRegistry
The AuthenticationSchemeRegistry is a collection of AuthenticationScheme
objects, each implementing a specific HTTP authentication scheme. Clients may register, unregister and get each AuthenticationScheme implementation by scheme name. An iterator of AuthenticationScheme objects may also be obtained.
AuthenticationSchemeRegistry is pre-loaded with authentication schemes inherently supported by HTTPClient. The registry may be configured using System properties to include additional authentication schemes. Or, additional authentication schemes may be added programmatically.
Field Summary | |
static java.lang.String[] |
BUILT_IN_AUTHENTICATION_SCHEMES Array of built-in AuthenticationScheme concrete class names. |
static java.lang.String |
RESP_AUTH_HEADER Response header indicating the resource server requires authentication. |
static java.lang.String |
RESP_AUTH_PROXY_HEADER Response header indicating the proxy server requires authentication. |
Constructor Summary | |
protected |
AuthenticationSchemeRegistry() Constructor |
Method Summary | |
AuthenticationScheme |
addScheme(AuthenticationScheme schemeObject) Adds the authentication scheme to the registry. |
protected AuthenticationScheme |
createScheme(java.lang.String schemeClassName) Attempts to create a new instance of the class with the given class name, which is expected to implement AuthenticationScheme . |
AuthenticationScheme |
getScheme(java.lang.String schemeName) Determines a registered AuthenticationScheme object corresponding to the given scheme name. |
int |
getSchemeCount() Determines the number of registered schemes. |
java.util.Iterator |
getSchemeNameIterator() Determines an iterator for the currently registered scheme names. |
boolean |
hasScheme(java.lang.String schemeName) Determines whether an AuthenticationScheme object corresponding to the given scheme name is registered. |
boolean |
isAnyAuthChallengeConnectionOriented(HTTPClient.CIHashtable headers, boolean forProxy) Determines whether any registered authentication scheme used in the given response headers, is connection oriented. |
boolean |
isEmpty() Determines whether the registry is empty. |
int |
loadSchemes() loadSchemes() populates the registry with AuthenticationScheme implementations specified in two different ways. |
static AuthenticationSchemeRegistry |
newInstance(boolean preLoad) A factory method for instantiating this class. |
void |
removeAllSchemes() Unregisters (removes) all authentication schemes from this registry. |
AuthenticationScheme |
removeScheme(java.lang.String schemeName) Unregisters (removes) the authentication scheme, with the associated schemeName, from the registry. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String RESP_AUTH_HEADER
public static final java.lang.String RESP_AUTH_PROXY_HEADER
public static final java.lang.String[] BUILT_IN_AUTHENTICATION_SCHEMES
Array of built-in AuthenticationScheme concrete class names. Each class MUST implement AuthenticationScheme
and MUST have a no-argument constructor.
NOTE: The dependency on built-in AuthenticationScheme implementations from the registry is "soft". If a built-in AuthenticationScheme is not found in the classpath, the scheme will simply not be loaded, and the event will be logged.
Constructor Detail |
protected AuthenticationSchemeRegistry()
Method Detail |
public static AuthenticationSchemeRegistry newInstance(boolean preLoad)
preLoad
- true
to automatically populate the registry by calling loadSchemes()
, otherwise false
.public AuthenticationScheme addScheme(AuthenticationScheme schemeObject) throws java.lang.IllegalArgumentException
Adds the authentication scheme to the registry. The scheme name is determined by calling AuthenticationScheme.getSchemeName()
.
If an AuthenticationScheme object is already registered under the scheme name, the registered scheme will be replaced with the given AuthenticationScheme object.
schemeObject
- The AuthenticationScheme objectnull
if none.java.lang.IllegalArgumentException
- Invalid arguments givenpublic AuthenticationScheme getScheme(java.lang.String schemeName) throws java.lang.IllegalArgumentException
Determines a registered AuthenticationScheme object corresponding to the given scheme name.
schemeName
- The scheme namenull
if none.java.lang.IllegalArgumentException
- Invalid arguments givenpublic boolean hasScheme(java.lang.String schemeName) throws java.lang.IllegalArgumentException
Determines whether an AuthenticationScheme object corresponding to the given scheme name is registered.
schemeName
- The scheme nametrue
if found, otherwise false
.java.lang.IllegalArgumentException
- Invalid arguments givenpublic boolean isEmpty()
Determines whether the registry is empty.
true
if empty, otherwise false
.public int getSchemeCount()
Determines the number of registered schemes.
public AuthenticationScheme removeScheme(java.lang.String schemeName) throws java.lang.IllegalArgumentException
Unregisters (removes) the authentication scheme, with the associated schemeName, from the registry.
schemeName
- The scheme namenull
if none.java.lang.IllegalArgumentException
- Invalid arguments givenpublic void removeAllSchemes()
Unregisters (removes) all authentication schemes from this registry.
public java.util.Iterator getSchemeNameIterator()
Determines an iterator for the currently registered scheme names. Use getScheme(String)
to retrieve the AuthenticationScheme object corresponding to the scheme name.
NOTE: The scheme name case is insignificant.
WARNING: If the registry is modifier while an iteration is in progress, the results of the iteration are undefined.
protected AuthenticationScheme createScheme(java.lang.String schemeClassName) throws java.lang.IllegalArgumentException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassCastException
Attempts to create a new instance of the class with the given class name, which is expected to implement AuthenticationScheme
.
schemeClassName
- The class name of the AuthenticationScheme objectjava.lang.IllegalArgumentException
- schemeClassName is null or empty stringjava.lang.ClassNotFoundException
- schemeClassName could not be resolved based on the current classpathjava.lang.InstantiationException
- schemeClassName represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason.java.lang.IllegalAccessException
- The class which schemeClassName represents, or its nullary constructor, is not accessible.java.lang.ClassCastException
- The class which schemeClassName represents is not an instance of AuthenticationScheme
.public int loadSchemes()
loadSchemes() populates the registry with AuthenticationScheme implementations specified in two different ways.
1. From System Properties (runtime configured):
System properties starting with the prefix
are assumed to specify runtime-declared AuthenticationScheme implementations. The property name (excluding the prefix) specifies the scheme name underwhich to register the scheme. The property value specifies the class name of the AuthenticationScheme implementation, which must have a no-argument constructor.SystemPropertyNames.AUTHENTICATION_SCHEME_SYSTEM_PROPERTY_NAMESPACE
2. Built-in AuthenticationScheme implementations:
HTTPClient has built-in, supported schemes. Corresponding AuthenticationScheme implementations are loaded during loadSchemes().
public boolean isAnyAuthChallengeConnectionOriented(HTTPClient.CIHashtable headers, boolean forProxy) throws java.lang.IllegalArgumentException
headers
- Response headersforProxy
- true<code/> if we are connected to a proxy, otherwise
false<code/>.true<code/> if any authentication scheme used in the given response headers is connection oriented, otherwise
false<code/>.java.lang.IllegalArgumentException
- An input is null<code/>.
|
Oracle Application Server HTTPClient Java API Reference 10g Release 3 (10.1.3.1.0) B32117-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |