Class HttpTunnelConnection
- java.lang.Object
- org.springframework.boot.devtools.tunnel.client.HttpTunnelConnection
- All Implemented Interfaces:
TunnelConnection
public class HttpTunnelConnection extends Object implements TunnelConnection
TunnelConnection
implementation 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 class
HttpTunnelConnection.TunnelChannel
AWritableByteChannel
used to transfer traffic.
Constructor Summary
Constructors Modifier Constructor Description HttpTunnelConnection(String url, org.springframework.http.client.ClientHttpRequestFactory requestFactory)
Create a newHttpTunnelConnection
instance.protected
HttpTunnelConnection(String url, org.springframework.http.client.ClientHttpRequestFactory requestFactory, Executor executor)
Create a newHttpTunnelConnection
instance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.http.client.ClientHttpRequest
createRequest(boolean hasPayload)
HttpTunnelConnection.TunnelChannel
open(WritableByteChannel incomingChannel, Closeable closeable)
Open the tunnel connection.
Constructor Detail
HttpTunnelConnection
public HttpTunnelConnection(String url, org.springframework.http.client.ClientHttpRequestFactory requestFactory)
Create a newHttpTunnelConnection
instance.- 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 newHttpTunnelConnection
instance.- 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:TunnelConnection
Open the tunnel connection.- Specified by:
open
in interfaceTunnelConnection
- Parameters:
incomingChannel
- aWritableByteChannel
that should be used to write any incoming data received from the remote servercloseable
- a closeable to call when the channel is closed- Returns:
- a
WritableByteChannel
that 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