@ThreadSafe public final class AuthSchemeRegistry extends Object
Constructor and Description |
---|
AuthSchemeRegistry() |
Modifier and Type | Method and Description |
---|---|
AuthScheme |
getAuthScheme(String name,
org.apache.http.params.HttpParams params)
Gets the
authentication scheme with the given name. |
List<String> |
getSchemeNames()
Obtains a list containing the names of all registered
authentication
schemes |
void |
register(String name,
AuthSchemeFactory factory)
Registers a
AuthSchemeFactory with the given identifier. |
void |
setItems(Map<String,AuthSchemeFactory> map)
Populates the internal collection of registered
authentication schemes
with the content of the map passed as a parameter. |
void |
unregister(String name)
Unregisters the class implementing an
authentication scheme with
the given name. |
public void register(String name, AuthSchemeFactory factory)
AuthSchemeFactory
with the given identifier. If a factory with the
given name already exists it will be overridden. This name is the same one used to
retrieve the authentication scheme
from getAuthScheme(java.lang.String, org.apache.http.params.HttpParams)
.
Please note that custom authentication preferences, if used, need to be updated accordingly
for the new authentication scheme
to take effect.
name
- the identifier for this schemefactory
- the AuthSchemeFactory
class to registergetAuthScheme(java.lang.String, org.apache.http.params.HttpParams)
public void unregister(String name)
authentication scheme
with
the given name.name
- the identifier of the class to unregisterpublic AuthScheme getAuthScheme(String name, org.apache.http.params.HttpParams params) throws IllegalStateException
authentication scheme
with the given name.name
- the authentication scheme
identifierparams
- the HTTP parameters
for the authentication
scheme.authentication scheme
IllegalStateException
- if a scheme with the given name cannot be foundpublic List<String> getSchemeNames()
authentication
schemes
public void setItems(Map<String,AuthSchemeFactory> map)
authentication schemes
with the content of the map passed as a parameter.map
- authentication schemesCopyright © 1999-2013 The Apache Software Foundation. All Rights Reserved.