Class ProxyHandlerImpl
- java.lang.Object
-
- com.microsoft.azure.proton.transport.proxy.impl.ProxyHandlerImpl
-
- All Implemented Interfaces:
ProxyHandler
public class ProxyHandlerImpl extends Object implements ProxyHandler
Implementation class that handles connecting to the proxy.- See Also:
Proxy,ProxyHandler
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.microsoft.azure.proton.transport.proxy.ProxyHandler
ProxyHandler.ProxyResponseResult
-
-
Constructor Summary
Constructors Constructor Description ProxyHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateProxyRequest(String hostName, Map<String,String> additionalHeaders)Creates a CONNECT request to the providedhostNameand addsadditionalHeadersto the request.ProxyHandler.ProxyResponseResultvalidateProxyResponse(ByteBuffer buffer)Verifies thatbuffercontains a successful CONNECT response.
-
-
-
Method Detail
-
createProxyRequest
public String createProxyRequest(String hostName, Map<String,String> additionalHeaders)
Creates a CONNECT request to the providedhostNameand addsadditionalHeadersto the request.- Specified by:
createProxyRequestin interfaceProxyHandler- 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 ProxyHandler.ProxyResponseResult validateProxyResponse(ByteBuffer buffer)
Verifies thatbuffercontains a successful CONNECT response.- Specified by:
validateProxyResponsein interfaceProxyHandler- Parameters:
buffer- Buffer containing the HTTP response.- Returns:
- Indicates if CONNECT response contained a success. If not, contains an error indicating why the call was not successful.
-
-