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
Nested Classes Modifier and Type Interface Description static interface
TunnelAgent.CloseTunnelCallback
Callback interface returned from#openTunnel()
. -
Method Summary
Modifier and Type Method Description 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 Details
-
checkTunnel
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 ThrowableThis 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 usernamehostname
- the host part of the svn+tunnel:// URLport
- the port part of the svn+tunnel:// URL- Returns:
- an instance od
TunnelAgent.CloseTunnelCallback
, which will be invoked when the connection is closed, ornull
. - Throws:
any
- exception will abort the connectionThrowable
-