Class ProxyHandlerImpl

  • All Implemented Interfaces:
    ProxyHandler

    public class ProxyHandlerImpl
    extends java.lang.Object
    implements ProxyHandler
    Implementation class that handles connecting to the proxy.
    See Also:
    Proxy, ProxyHandler
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String createProxyRequest​(java.lang.String hostName, java.util.Map<java.lang.String,​java.lang.String> additionalHeaders)
      Creates a CONNECT request to the provided hostName and adds additionalHeaders to the request.
      boolean validateProxyResponse​(ProxyResponse response)
      Verifies that httpResponse contains a successful CONNECT response.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProxyHandlerImpl

        public ProxyHandlerImpl()
    • Method Detail

      • createProxyRequest

        public java.lang.String createProxyRequest​(java.lang.String hostName,
                                                   java.util.Map<java.lang.String,​java.lang.String> additionalHeaders)
        Creates a CONNECT request to the provided hostName and adds additionalHeaders to the request.
        Specified by:
        createProxyRequest in interface ProxyHandler
        Parameters:
        hostName - Name of the host to connect to.
        additionalHeaders - Optional. Additional headers to add to the request.
        Returns:
        A string representing the HTTP CONNECT request.
      • validateProxyResponse

        public boolean validateProxyResponse​(ProxyResponse response)
        Verifies that httpResponse contains a successful CONNECT response.
        Specified by:
        validateProxyResponse in interface ProxyHandler
        Parameters:
        response - HTTP response to validate for a successful CONNECT response.
        Returns:
        true if the HTTP response is successful and correct, and false otherwise.