com.atlassian.tunnel.tunnel.client
Class Tunnel

java.lang.Object
  extended by com.atlassian.tunnel.tunnel.client.Tunnel
All Implemented Interfaces:
Runnable

public class Tunnel
extends Object
implements Runnable

Author:
rinaldo, jayd, Forked by Atlassian

Constructor Summary
Tunnel(int remoteProxyPort, TunnelServerAddressProvider tunnelAddressProvider, String destinationHost, int destinationPort, TunnelStatusTracker statusTracker, SocketFactory tunnelSocketFactory, SocketFactory forwardingSocketFactory)
           
 
Method Summary
 void close()
           
 void closeAllTunnels(String previousAddressStr)
           
 Thread open()
           
 void run()
          Open a Server socket on LocalPort and wait for a client connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tunnel

public Tunnel(int remoteProxyPort,
              @NotNull
              TunnelServerAddressProvider tunnelAddressProvider,
              @NotNull
              String destinationHost,
              int destinationPort,
              @Nullable
              TunnelStatusTracker statusTracker,
              @NotNull
              SocketFactory tunnelSocketFactory,
              @NotNull
              SocketFactory forwardingSocketFactory)
Parameters:
remoteProxyPort - The TCP port number on the tunnel server which is to serve as the proxy for the final destination
tunnelHost - The IP address or host name of the tunnel server
tunnelPort - The TCP port number at which the tunnel server is accepting tunnel connections
destinationHost - The IP address or host name of the destination for the tunnelled traffic
destinationPort - The TCP port number of the destination for the tunnelled traffic
statusTracker - retry handler used to handle tunnel failures (and successes)
tunnelSocketFactory - The SocketFactory for creation of connections to the tunnel server. This will probably be a ServerSocketFactory.
forwardingSocketFactory - The SocketFactory for creation of connections to the destination.
Method Detail

open

public Thread open()

close

public void close()

run

public void run()
Open a Server socket on LocalPort and wait for a client connection. When client socket established, complete the connection to the remote service via call to getRemoteSocket().

Specified by:
run in interface Runnable

closeAllTunnels

public void closeAllTunnels(String previousAddressStr)


Copyright © 2015 Atlassian. All rights reserved.