Package org.apache.http.auth
Class AuthSchemeRegistry
java.lang.Object
org.apache.http.auth.AuthSchemeRegistry
public final class AuthSchemeRegistry extends Object
Authentication scheme registry that can be used to obtain the corresponding
authentication scheme implementation for a given type of authorization challenge.
- Since:
- 4.0
- Version:
- $Revision: 652950 $
- Author:
- Oleg Kalnichevski
-
Constructor Summary
Constructors Constructor Description AuthSchemeRegistry() -
Method Summary
Modifier and Type Method Description AuthSchemegetAuthScheme(String name, HttpParams params)Gets theauthentication schemewith the given name.List<String>getSchemeNames()Obtains a list containing names of all registeredauthentication schemesin their default order.voidregister(String name, AuthSchemeFactory factory)Registers aAuthSchemeFactorywith the given identifier.voidsetItems(Map<String,AuthSchemeFactory> map)Populates the internal collection of registeredauthentication schemeswith the content of the map passed as a parameter.voidunregister(String name)Unregisters the class implementing anauthentication schemewith the given name.
-
Constructor Details
-
AuthSchemeRegistry
public AuthSchemeRegistry()
-
-
Method Details
-
register
Registers aAuthSchemeFactorywith 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 theauthentication schemefromgetAuthScheme(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 schemeto take effect.- Parameters:
name- the identifier for this schemefactory- theAuthSchemeFactoryclass to register- See Also:
getAuthScheme(java.lang.String, org.apache.http.params.HttpParams)
-
unregister
Unregisters the class implementing anauthentication schemewith the given name.- Parameters:
name- the identifier of the class to unregister
-
getAuthScheme
Gets theauthentication schemewith the given name.- Parameters:
name- theauthentication schemeidentifierparams- theHTTP parametersfor the authentication scheme.- Returns:
authentication scheme- Throws:
IllegalStateException- if a scheme with the given name cannot be found
-
getSchemeNames
Obtains a list containing names of all registeredauthentication schemesin their default order.- Returns:
- list of registered scheme names
-
setItems
Populates the internal collection of registeredauthentication schemeswith the content of the map passed as a parameter.- Parameters:
map- authentication schemes
-