public interface IRemoteConnection
open(IProgressMonitor)
method. Once the connection is completed, call the close()
method to
terminate the connection.Modifier and Type | Field and Description |
---|---|
static String |
FILE_SEPARATOR_PROPERTY |
static String |
LINE_SEPARATOR_PROPERTY |
static String |
OS_ARCH_PROPERTY |
static String |
OS_NAME_PROPERTY |
static String |
OS_VERSION_PROPERTY |
static String |
PATH_SEPARATOR_PROPERTY |
static String |
USER_HOME_PROPERTY |
Modifier and Type | Method and Description |
---|---|
void |
addConnectionChangeListener(IRemoteConnectionChangeListener listener)
Register a listener that will be notified when this connection's status changes.
|
void |
close()
Close the connection.
|
void |
forwardLocalPort(int localPort,
String fwdAddress,
int fwdPort)
Forward local port localPort to remote port fwdPort on remote machine fwdAddress.
|
int |
forwardLocalPort(String fwdAddress,
int fwdPort,
IProgressMonitor monitor)
Forward a local port to remote port fwdPort on remote machine fwdAddress.
|
void |
forwardRemotePort(int remotePort,
String fwdAddress,
int fwdPort)
Forward remote port remotePort to port fwdPort on machine fwdAddress.
|
int |
forwardRemotePort(String fwdAddress,
int fwdPort,
IProgressMonitor monitor)
Forward a remote port to port fwdPort on remote machine fwdAddress.
|
String |
getAddress()
Gets the implementation dependent address for this connection
return address
|
Map<String,String> |
getAttributes()
Get the implementation specific attributes for the connection.
|
Map<String,String> |
getEnv()
Returns an unmodifiable string map view of the remote environment.
|
String |
getEnv(String name)
Returns the value of an environment variable.
|
String |
getName()
Get unique name for this connection.
|
int |
getPort()
Gets the port for this connection.
|
String |
getProperty(String key)
Gets the remote system property indicated by the specified key.
|
IRemoteServices |
getRemoteServices()
Get the remote services provider for this connection.
|
String |
getUsername()
Gets the username for this connection
return username
|
String |
getWorkingDirectory()
Get the working directory.
|
boolean |
isOpen()
Test if the connection is open.
|
void |
open(IProgressMonitor monitor)
Open the connection.
|
void |
open(IUserAuthenticator authenticator,
IProgressMonitor monitor)
Open the connection.
|
void |
removeConnectionChangeListener(IRemoteConnectionChangeListener listener)
Remove a listener that will be notified when this connection's status changes.
|
void |
removeLocalPortForwarding(int port)
Remove the local port forwarding associated with the given port.
|
void |
removeRemotePortForwarding(int port)
Remove the remote port forwarding associated with the given port.
|
void |
setAddress(String address)
Set the address for this connection
|
void |
setAttribute(String key,
String value)
Set an implementation dependent attribute for the connection.
|
void |
setName(String name)
Set the name for this connection
|
void |
setPassword(String password)
Set the password for this connection
|
void |
setPort(int port)
Set the port used for this connection.
|
void |
setUsername(String username)
Set the username for this connection
|
void |
setWorkingDirectory(String path)
Set the working directory.
|
boolean |
supportsTCPPortForwarding()
Test if this connection supports forwarding of TCP connections
|
static final String OS_NAME_PROPERTY
static final String OS_VERSION_PROPERTY
static final String OS_ARCH_PROPERTY
static final String FILE_SEPARATOR_PROPERTY
static final String PATH_SEPARATOR_PROPERTY
static final String LINE_SEPARATOR_PROPERTY
static final String USER_HOME_PROPERTY
void addConnectionChangeListener(IRemoteConnectionChangeListener listener)
listener
- void close()
void forwardLocalPort(int localPort, String fwdAddress, int fwdPort) throws RemoteConnectionException
localPort
- local port to forwardfwdAddress
- address of remote machinefwdPort
- remote port on remote machineRemoteConnectionException
int forwardLocalPort(String fwdAddress, int fwdPort, IProgressMonitor monitor) throws RemoteConnectionException
fwdAddress
- fwdPort
- monitor
- RemoteConnectionException
void forwardRemotePort(int remotePort, String fwdAddress, int fwdPort) throws RemoteConnectionException
remotePort
- remote port to forwardfwdAddress
- address of recipient machinefwdPort
- port on recipient machineRemoteConnectionException
int forwardRemotePort(String fwdAddress, int fwdPort, IProgressMonitor monitor) throws RemoteConnectionException
fwdAddress
- fwdPort
- monitor
- RemoteConnectionException
String getAddress()
Map<String,String> getAttributes()
Map<String,String> getEnv()
String getEnv(String name)
name
- name of the environment variableString getName()
int getPort()
String getProperty(String key)
os.name Operating system name os.arch Operating system architecture os.version Operating system version file.separator File separator ("/" on UNIX) path.separator Path separator (":" on UNIX) line.separator Line separator ("\n" on UNIX) user.home Home directory
key
- the name of the propertyIRemoteServices getRemoteServices()
String getUsername()
String getWorkingDirectory()
boolean isOpen()
void open(IProgressMonitor monitor) throws RemoteConnectionException
monitor
- the progress monitor to use for reporting progress to the user. It is the caller's responsibility to call done()
on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot
be cancelled.RemoteConnectionException
void open(IUserAuthenticator authenticator, IProgressMonitor monitor) throws RemoteConnectionException
authenticator
- authenticator to allow the caller to manage interaction with the usermonitor
- the progress monitor to use for reporting progress to the user. It is the caller's responsibility to call done()
on the given monitor. Accepts null, indicating that no progress should be reported and that the operation cannot
be cancelled.RemoteConnectionException
void removeConnectionChangeListener(IRemoteConnectionChangeListener listener)
listener
- void removeLocalPortForwarding(int port) throws RemoteConnectionException
port
- forwarded portRemoteConnectionException
void removeRemotePortForwarding(int port) throws RemoteConnectionException
port
- forwarded portRemoteConnectionException
void setAddress(String address)
address
- void setAttribute(String key, String value)
getAttributes()
key
- attribute keyvalue
- attribute valuevoid setName(String name)
name
- void setPassword(String password)
password
- void setPort(int port)
port
- port number for the connectionvoid setUsername(String username)
username
- void setWorkingDirectory(String path)
path
- String representing the current working directoryboolean supportsTCPPortForwarding()
Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.