Class ProtocolHandlers

  • All Implemented Interfaces:
    org.eclipse.jetty.util.component.Dumpable

    public class ProtocolHandlers
    extends java.lang.Object
    implements org.eclipse.jetty.util.component.Dumpable

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

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

        org.eclipse.jetty.util.component.Dumpable.DumpableContainer
    • Field Summary

      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ProtocolHandlers()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Removes all protocol handlers from this container.
      java.lang.String dump()  
      void dump​(java.lang.Appendable out, java.lang.String indent)  
      ProtocolHandler find​(Request request, Response response)
      Finds the first protocol handler that accepts the given request and response.
      ProtocolHandler put​(ProtocolHandler protocolHandler)
      Stores the given protocolHandler in this container.
      ProtocolHandler remove​(java.lang.String name)
      Removes the protocol handler with the given name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

        dumpSelf
    • Constructor Detail

      • ProtocolHandlers

        protected ProtocolHandlers()
    • Method Detail

      • 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.

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

        public ProtocolHandler remove​(java.lang.String name)

        Removes the protocol handler with the given name.

        Parameters:
        name - the name of the protocol handler to remove
        Returns:
        the removed protocol handler, or null if no protocol handler with that name was already stored
        See Also:
        put(ProtocolHandler), clear()
      • 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.

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

        public java.lang.String dump()
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable
        Throws:
        java.io.IOException