public class HttpTunnelConnection extends Object implements TunnelConnection
TunnelConnection
implementation that uses HTTP to transfer data.TunnelClient
,
HttpTunnelServer
Modifier and Type | Class and Description |
---|---|
protected class |
HttpTunnelConnection.TunnelChannel
A
WritableByteChannel used to transfer traffic. |
Modifier | Constructor and Description |
---|---|
|
HttpTunnelConnection(String url,
org.springframework.http.client.ClientHttpRequestFactory requestFactory)
Create a new
HttpTunnelConnection instance. |
protected |
HttpTunnelConnection(String url,
org.springframework.http.client.ClientHttpRequestFactory requestFactory,
Executor executor)
Create a new
HttpTunnelConnection instance. |
Modifier and Type | Method and Description |
---|---|
protected org.springframework.http.client.ClientHttpRequest |
createRequest(boolean hasPayload) |
HttpTunnelConnection.TunnelChannel |
open(WritableByteChannel incomingChannel,
Closeable closeable)
Open the tunnel connection.
|
public HttpTunnelConnection(String url, org.springframework.http.client.ClientHttpRequestFactory requestFactory)
HttpTunnelConnection
instance.url
- the URL to connect torequestFactory
- the HTTP request factoryprotected HttpTunnelConnection(String url, org.springframework.http.client.ClientHttpRequestFactory requestFactory, Executor executor)
HttpTunnelConnection
instance.url
- the URL to connect torequestFactory
- the HTTP request factoryexecutor
- the executor used to handle connectionspublic HttpTunnelConnection.TunnelChannel open(WritableByteChannel incomingChannel, Closeable closeable) throws Exception
TunnelConnection
open
in interface TunnelConnection
incomingChannel
- A WritableByteChannel
that should be used to write
any incoming data received from the remote server.closeable
- a closeable to call when the channel is closedWritableByteChannel
that should be used to send any outgoing data
destined for the remote serverException
- in case of errorsprotected final org.springframework.http.client.ClientHttpRequest createRequest(boolean hasPayload) throws IOException
IOException
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.