Top Description Fields Constructors Methods
org.eclipse.jetty.client

public Class ProtocolHandlers

extends Object
implements Dumpable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.Dumpable
Imports
java.io.IOException, java.util.LinkedHashMap, .Map, org.eclipse.jetty.util.component.Dumpable

A container for ProtocolHandlers accessible from HttpClient#getProtocolHandlers().

Field Summary

Modifier and TypeField and Description
private final Map<String, ProtocolHandler>

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Removes all protocol handlers from this container.

public String
public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

public ProtocolHandler

Returns:

the protocol handler that accepted the request and response, or null if none of the protocol handlers accepted the request and response
find
(Request
the request to accept
request
,
Response
the response to accept
response
)

Finds the first protocol handler that accepts the given request and response.

public ProtocolHandler

Returns:

the existing protocol handler with the same name, or null if no protocol handler with that name was already stored
put
(ProtocolHandler
the protocol handler to store
protocolHandler
)

Stores the given protocolHandler in this container.

public ProtocolHandler

Returns:

the removed protocol handler, or null if no protocol handler with that name was already stored
remove
(String
the name of the protocol handler to remove
name
)

Removes the protocol handler with the given name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

handlersback to summary
private final Map<String, ProtocolHandler> handlers

Constructor Detail

ProtocolHandlersback to summary
protected ProtocolHandlers()

Method Detail

clearback to summary
public void clear()

Removes all protocol handlers from this container.

dumpback to summary
public String dump()

Overrides default org.eclipse.jetty.util.component.Dumpable.dump.

Annotations
@Override
dumpback to summary
public void dump(Appendable out, String indent) throws IOException

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Doc from org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.

Parameters
out:Appendable

The appendable to dump to

indent:String

The indent to apply after any new lines.

Annotations
@Override
Exceptions
IOException:
if unable to write to Appendable
findback to summary
public ProtocolHandler find(Request request, Response response)

Finds the first protocol handler that accepts the given request and response.

Parameters
request:Request

the request to accept

response:Response

the response to accept

Returns:ProtocolHandler

the protocol handler that accepted the request and response, or null if none of the protocol handlers accepted the request and response

putback to summary
public ProtocolHandler put(ProtocolHandler protocolHandler)

Stores the given protocolHandler in this container.

If a protocol handler with the same name exists, it is replaced by the given one, and the existing returned.

Parameters
protocolHandler:ProtocolHandler

the protocol handler to store

Returns:ProtocolHandler

the existing protocol handler with the same name, or null if no protocol handler with that name was already stored

See Also
remove(String)
removeback to summary
public ProtocolHandler remove(String name)

Removes the protocol handler with the given name.

Parameters
name:String

the name of the protocol handler to remove

Returns:ProtocolHandler

the removed protocol handler, or null if no protocol handler with that name was already stored

See Also
put(ProtocolHandler), clear()