org.apache.subversion.javahl.callback
Interface TunnelAgent


public interface TunnelAgent

Callback interface for creating and managing tunnels for ra_svn connections. Note that tunnel agent implementations should run in a separate thread of control than the one that invokes an ISVNClient or RemoteSession method that requires a tunnel, otherwise the method will deadlock.

Since:
1.9

Nested Class Summary
static interface TunnelAgent.CloseTunnelCallback
          Callback interface returned from #openTunnel().
 
Method Summary
 boolean checkTunnel(String name)
          This callback method is called before a tunnel is created, to determine whether to use this tunnel implementation, or revert to the default (native) tunnel implementation.
 TunnelAgent.CloseTunnelCallback openTunnel(ReadableByteChannel request, WritableByteChannel response, String name, String user, String hostname, int port)
          This callback method is called when a tunnel needs to be created and the request and response streams attached to it.
 

Method Detail

checkTunnel

boolean checkTunnel(String name)
This callback method is called before a tunnel is created, to determine whether to use this tunnel implementation, or revert to the default (native) tunnel implementation.

Parameters:
name - the name of the tunnel, as in svn+name://...
Returns:
false to defer to the default implementation.

openTunnel

TunnelAgent.CloseTunnelCallback openTunnel(ReadableByteChannel request,
                                           WritableByteChannel response,
                                           String name,
                                           String user,
                                           String hostname,
                                           int port)
                                           throws Throwable
This callback method is called when a tunnel needs to be created and the request and response streams attached to it.

Parameters:
request - The request stream of the tunnel. The tunnel agent implementation will read requests from this channel and send them to the tunnel process.
response - The request stream of the tunnel. The tunnel agent implementation will read requests from this channel and send them to the tunnel process.
name - the name of the tunnel, as in svn+name://...
user - the tunnel username
hostname - the host part of the svn+tunnel:// URL
port - the port part of the svn+tunnel:// URL
Returns:
an instance od TunnelAgent.CloseTunnelCallback, which will be invoked when the connection is closed, or null.
Throws:
any - exception will abort the connection
Throwable