Class HttpTunnelConnection
- java.lang.Object
- org.springframework.boot.devtools.tunnel.client.HttpTunnelConnection
- All Implemented Interfaces:
TunnelConnection
public class HttpTunnelConnection extends Object implements TunnelConnection
TunnelConnectionimplementation that uses HTTP to transfer data.- Since:
- 1.3.0
- See Also:
TunnelClient,HttpTunnelServer
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classHttpTunnelConnection.TunnelChannelAWritableByteChannelused to transfer traffic.
Constructor Summary
Constructors Modifier Constructor Description HttpTunnelConnection(String url, org.springframework.http.client.ClientHttpRequestFactory requestFactory)Create a newHttpTunnelConnectioninstance.protectedHttpTunnelConnection(String url, org.springframework.http.client.ClientHttpRequestFactory requestFactory, Executor executor)Create a newHttpTunnelConnectioninstance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.http.client.ClientHttpRequestcreateRequest(boolean hasPayload)HttpTunnelConnection.TunnelChannelopen(WritableByteChannel incomingChannel, Closeable closeable)Open the tunnel connection.
Constructor Detail
HttpTunnelConnection
public HttpTunnelConnection(String url, org.springframework.http.client.ClientHttpRequestFactory requestFactory)
Create a newHttpTunnelConnectioninstance.- Parameters:
url- the URL to connect torequestFactory- the HTTP request factory
HttpTunnelConnection
protected HttpTunnelConnection(String url, org.springframework.http.client.ClientHttpRequestFactory requestFactory, Executor executor)
Create a newHttpTunnelConnectioninstance.- Parameters:
url- the URL to connect torequestFactory- the HTTP request factoryexecutor- the executor used to handle connections
Method Detail
open
public HttpTunnelConnection.TunnelChannel open(WritableByteChannel incomingChannel, Closeable closeable) throws Exception
Description copied from interface:TunnelConnectionOpen the tunnel connection.- Specified by:
openin interfaceTunnelConnection- Parameters:
incomingChannel- AWritableByteChannelthat should be used to write any incoming data received from the remote server.closeable- a closeable to call when the channel is closed- Returns:
- A
WritableByteChannelthat should be used to send any outgoing data destined for the remote server - Throws:
Exception- in case of errors
createRequest
protected final org.springframework.http.client.ClientHttpRequest createRequest(boolean hasPayload) throws IOException
- Throws:
IOException