Methods Summary |
---|
public final synchronized org.apache.http.conn.scheme.Scheme | get(java.lang.String name)Obtains a scheme by name, if registered.
if (name == null)
throw new IllegalArgumentException("Name must not be null.");
// leave it to the caller to use the correct name - all lowercase
//name = name.toLowerCase();
Scheme found = registeredSchemes.get(name);
return found;
|
public final synchronized org.apache.http.conn.scheme.Scheme | getScheme(java.lang.String name)Obtains a scheme by name.
Scheme found = get(name);
if (found == null) {
throw new IllegalStateException
("Scheme '"+name+"' not registered.");
}
return found;
|
public final synchronized org.apache.http.conn.scheme.Scheme | getScheme(org.apache.http.HttpHost host)Obtains the scheme for a host.
Convenience method for getScheme(host.getSchemeName())
if (host == null) {
throw new IllegalArgumentException("Host must not be null.");
}
return getScheme(host.getSchemeName());
|
public final synchronized java.util.List | getSchemeNames()Obtains the names of the registered schemes in their default order.
return new ArrayList<String>(registeredSchemes.keySet());
|
public final synchronized org.apache.http.conn.scheme.Scheme | register(org.apache.http.conn.scheme.Scheme sch)Registers a scheme.
The scheme can later be retrieved by its name
using {@link #getScheme(String) getScheme} or {@link #get get}.
if (sch == null)
throw new IllegalArgumentException("Scheme must not be null.");
Scheme old = registeredSchemes.put(sch.getName(), sch);
return old;
|
public synchronized void | setItems(java.util.Map map)Populates the internal collection of registered {@link Scheme protocol schemes}
with the content of the map passed as a parameter.
if (map == null) {
return;
}
registeredSchemes.clear();
registeredSchemes.putAll(map);
|
public final synchronized org.apache.http.conn.scheme.Scheme | unregister(java.lang.String name)Unregisters a scheme.
if (name == null)
throw new IllegalArgumentException("Name must not be null.");
// leave it to the caller to use the correct name - all lowercase
//name = name.toLowerCase();
Scheme gone = registeredSchemes.remove(name);
return gone;
|