Top Description Fields Methods
org.eclipse.jgit.internal.transport.sshd.proxy

public Interface StatefulProxyConnector

extends ClientProxyConnector
Known Direct Implementers
org.eclipse.jgit.internal.transport.sshd.proxy.AbstractClientProxyConnector
Imports
java.util.concurrent.Callable, org.apache.sshd.client.session.ClientProxyConnector, org.apache.sshd.common.io.IoSession, org.apache.sshd.common.util.Readable

Some proxy connections are stateful and require the exchange of multiple request-reply messages. The default ClientProxyConnector has only support for sending a message; replies get routed through the Ssh session, and don't get back to this proxy connector. Augment the interface so that the session can know when to route messages received to the proxy connector, and when to start handling them itself.

Field Summary

Modifier and TypeField and Description
public static final String
TIMEOUT_PROPERTY

A property key for a session property defining the timeout for setting up the proxy connection.

Method Summary

Modifier and TypeMethod and Description
public void
messageReceived(IoSession
to use for writing data
session
,
Readable
received data
buffer
)

Handle a received message.

public void
runWhenDone(Callable<Void>
operation to run
command
)

Runs command once the proxy connection is established.

Inherited from org.apache.sshd.client.session.ClientProxyConnector:
sendClientProxyMetadata

Field Detail

TIMEOUT_PROPERTYback to summary
public static final String TIMEOUT_PROPERTY

A property key for a session property defining the timeout for setting up the proxy connection.

Method Detail

messageReceivedback to summary
public void messageReceived(IoSession session, Readable buffer) throws Exception

Handle a received message.

Parameters
session:IoSession

to use for writing data

buffer:Readable

received data

Exceptions
Exception:
if data cannot be read, or the connection attempt fails
runWhenDoneback to summary
public void runWhenDone(Callable<Void> command) throws Exception

Runs command once the proxy connection is established. May be called multiple times; commands are run sequentially. If the proxy connection is already established, command is executed directly synchronously.

Parameters
command:Callable<Void>

operation to run

Exceptions
Exception:
if the operation is run synchronously and throws an exception