Class ProxyHandlerImpl
- java.lang.Object
-
- com.microsoft.azure.proton.transport.proxy.impl.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
-
-
Constructor Summary
Constructors Constructor Description ProxyHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcreateProxyRequest(java.lang.String hostName, java.util.Map<java.lang.String,java.lang.String> additionalHeaders)Creates a CONNECT request to the providedhostNameand addsadditionalHeadersto the request.booleanvalidateProxyResponse(ProxyResponse response)Verifies thathttpResponsecontains a successful CONNECT response.
-
-
-
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 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 boolean validateProxyResponse(ProxyResponse response)
Verifies thathttpResponsecontains a successful CONNECT response.- Specified by:
validateProxyResponsein interfaceProxyHandler- Parameters:
response- HTTP response to validate for a successful CONNECT response.- Returns:
trueif the HTTP response is successful and correct, andfalseotherwise.
-
-