Class ProtocolHandlers

All Implemented Interfaces:

public class ProtocolHandlers extends Object implements Dumpable

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

  • Constructor Details

    • ProtocolHandlers

      protected ProtocolHandlers()
  • Method Details

    • put

      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.

      protocolHandler - the protocol handler to store
      the existing protocol handler with the same name, or null if no protocol handler with that name was already stored
      See Also:
    • remove

      public ProtocolHandler remove(String name)

      Removes the protocol handler with the given name.

      name - the name of the protocol handler to remove
      the removed protocol handler, or null if no protocol handler with that name was already stored
      See Also:
    • clear

      public void clear()

      Removes all protocol handlers from this container.

    • find

      public ProtocolHandler find(Request request, Response response)

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

      request - the request to accept
      response - the response to accept
      the protocol handler that accepted the request and response, or null if none of the protocol handlers accepted the request and response
    • dump

      public String dump()
      Specified by:
      dump in interface Dumpable
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Description copied from interface: Dumpable
      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.
      Specified by:
      dump in interface Dumpable
      out - The appendable to dump to
      indent - The indent to apply after any new lines.
      IOException - if unable to write to Appendable