A set of supported protocol
s.
Schemes are identified by lowercase names.
| Method from org.apache.http.conn.scheme.SchemeRegistry Detail: |
public final synchronized Scheme get(String name) {
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;
}
Obtains a scheme by name, if registered. |
public final synchronized Scheme getScheme(String name) {
Scheme found = get(name);
if (found == null) {
throw new IllegalStateException
("Scheme '"+name+"' not registered.");
}
return found;
}
Obtains a scheme by name. |
public final synchronized Scheme getScheme(HttpHost host) {
if (host == null) {
throw new IllegalArgumentException("Host must not be null.");
}
return getScheme(host.getSchemeName());
}
Obtains the scheme for a host.
Convenience method for getScheme(host.getSchemeName()) |
public final synchronized List<String> getSchemeNames() {
return new ArrayList< String >(registeredSchemes.keySet());
}
Obtains the names of the registered schemes in their default order. |
public final synchronized Scheme register(Scheme sch) {
if (sch == null)
throw new IllegalArgumentException("Scheme must not be null.");
Scheme old = registeredSchemes.put(sch.getName(), sch);
return old;
}
Registers a scheme.
The scheme can later be retrieved by its name
using getScheme or get . |
public synchronized void setItems(Map<String, Scheme> map) {
if (map == null) {
return;
}
registeredSchemes.clear();
registeredSchemes.putAll(map);
}
Populates the internal collection of registered protocol schemes
with the content of the map passed as a parameter. |
public final synchronized Scheme unregister(String name) {
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;
}
|