g-Eclipse
Release 1.0.0

eu.geclipse.core.portforward
Class Forward

java.lang.Object
  extended by eu.geclipse.core.portforward.Forward
All Implemented Interfaces:
IForward

public class Forward
extends java.lang.Object
implements IForward

Implementation of the IForward interface, provided for convenience. Allows to set all values of a port forward.


Constructor Summary
Forward()
          Creates an empty forward.
Forward(ForwardType type, int bindPort, java.lang.String hostname, int port)
          Creates a new forward.
 
Method Summary
 int getBindPort()
          Returns the port number of the listening server socket.
 java.lang.String getHostname()
          Returns the name of the host where the connections get redirected to.
 int getPort()
          Port to connect on on the host where the redirections go to.
 ForwardType getType()
          Type of the port forward (either LOCAL or REMOTE).
 void setBindPort(int bindPort)
          Sets the port to listens for new connections.
 void setHostname(java.lang.String hostname)
          Sets the port of the host to forward connections to.
 void setPort(int port)
          Sets the port on the host to connect to.
 void setType(ForwardType type)
          Sets the type of forward (LOCAL or REMOTE).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Forward

public Forward()
Creates an empty forward. Values have to be set using the set-methods.


Forward

public Forward(ForwardType type,
               int bindPort,
               java.lang.String hostname,
               int port)
Creates a new forward. Allows to set all values at once.

Parameters:
type - type of the forward (LOCAL or REMOTE).
bindPort - port to bind on.
hostname - name of the host to connect to.
port - port on the host to connect to.
Method Detail

getBindPort

public int getBindPort()
Description copied from interface: IForward
Returns the port number of the listening server socket. (Bound on the local host in case of a LOCAL port forward, bound on the remote host in case of a REMOTE port forward.

Specified by:
getBindPort in interface IForward
Returns:
the port number ob the listening socket.

setBindPort

public void setBindPort(int bindPort)
Sets the port to listens for new connections.

Parameters:
bindPort - port to bind on.

getHostname

public java.lang.String getHostname()
Description copied from interface: IForward
Returns the name of the host where the connections get redirected to.

Specified by:
getHostname in interface IForward
Returns:
name of the host to forward connections to.

setHostname

public void setHostname(java.lang.String hostname)
Sets the port of the host to forward connections to.

Parameters:
hostname - host to connect to.

getPort

public int getPort()
Description copied from interface: IForward
Port to connect on on the host where the redirections go to.

Specified by:
getPort in interface IForward
Returns:
port on the host to connect to.

setPort

public void setPort(int port)
Sets the port on the host to connect to.

Parameters:
port - port to connect to.

getType

public ForwardType getType()
Description copied from interface: IForward
Type of the port forward (either LOCAL or REMOTE).

Specified by:
getType in interface IForward
Returns:
type of the port forward.

setType

public void setType(ForwardType type)
Sets the type of forward (LOCAL or REMOTE).

Parameters:
type - type of the forward.

g-Eclipse
Release 1.0.0