Methods Summary |
---|
public synchronized org.apache.http.auth.AuthScheme | getAuthScheme(java.lang.String name, org.apache.http.params.HttpParams params)Gets the {@link AuthScheme authentication scheme} with the given name.
if (name == null) {
throw new IllegalArgumentException("Name may not be null");
}
AuthSchemeFactory factory = registeredSchemes.get(name.toLowerCase(Locale.ENGLISH));
if (factory != null) {
return factory.newInstance(params);
} else {
throw new IllegalStateException("Unsupported authentication scheme: " + name);
}
|
public synchronized java.util.List | getSchemeNames()Obtains a list containing names of all registered {@link AuthScheme authentication
schemes} in their default order.
return new ArrayList<String>(registeredSchemes.keySet());
|
public synchronized void | register(java.lang.String name, org.apache.http.auth.AuthSchemeFactory factory)Registers a {@link 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 {@link AuthScheme authentication scheme} from {@link #getAuthScheme}.
Please note that custom authentication preferences, if used, need to be updated accordingly
for the new {@link AuthScheme authentication scheme} to take effect.
if (name == null) {
throw new IllegalArgumentException("Name may not be null");
}
if (factory == null) {
throw new IllegalArgumentException("Authentication scheme factory may not be null");
}
registeredSchemes.put(name.toLowerCase(Locale.ENGLISH), factory);
|
public synchronized void | setItems(java.util.Map map)Populates the internal collection of registered {@link AuthScheme authentication schemes}
with the content of the map passed as a parameter.
if (map == null) {
return;
}
registeredSchemes.clear();
registeredSchemes.putAll(map);
|
public synchronized void | unregister(java.lang.String name)Unregisters the class implementing an {@link AuthScheme authentication scheme} with
the given name.
if (name == null) {
throw new IllegalArgumentException("Name may not be null");
}
registeredSchemes.remove(name.toLowerCase(Locale.ENGLISH));
|