public class TelnetConnection extends java.lang.Object implements IRemoteConnectionControlService, IRemoteCommandShellService, IRemoteConnectionHostService, IRemoteConnectionChangeListener
| Modifier and Type | Class and Description |
|---|---|
static class |
TelnetConnection.Factory |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT |
static int |
DEFAULT_TIMEOUT |
static java.lang.String |
HOSTNAME_ATTR |
static java.lang.String |
PASSWORD_ATTR |
static java.lang.String |
PORT_ATTR |
static java.lang.String |
TIMEOUT_ATTR |
static java.lang.String |
USERNAME_ATTR |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection.
|
void |
connectionChanged(RemoteConnectionChangeEvent event)
Notifies this listener that the status of a connection has changed.
|
IRemoteProcess |
getCommandShell(int flags)
Get a remote process that runs a command shell on the remote system.
|
java.lang.String |
getHostname()
Obtain the hostname associated with this connection.
|
java.lang.String |
getPassphrase()
Get the pass phrase associated with this connection.
|
java.lang.String |
getPassword()
Get the password associated with this connection.
|
int |
getPort()
Obtain the port associated with this connection
|
IRemoteConnection |
getRemoteConnection() |
int |
getTimeout()
Obtain the timeout used when establishing the connection.
|
java.lang.String |
getUsername()
Obtain the username associated with this connection.
|
boolean |
isOpen()
Test if the connection is open.
|
void |
open(org.eclipse.core.runtime.IProgressMonitor monitor)
Open the connection.
|
void |
setHostname(java.lang.String hostname)
Set the hostname associated with this connection.
|
void |
setPassphrase(java.lang.String passphrase)
Set the pass phrase associated with this connection.
|
void |
setPassword(java.lang.String password)
Set the password associated with this connection.
|
void |
setPort(int port)
Set the port used for the connection.
|
void |
setTimeout(int timeout)
Set the timeout used when establishing the connection.
|
void |
setUseLoginShell(boolean useLogingShell)
Set the flag indicating a login shell should be stated for this connection.
|
void |
setUsePassword(boolean usePassword)
Set the connection to try password authentication first.
|
void |
setUsername(java.lang.String username)
Set the username associated with this connection.
|
protected void |
terminated(TelnetCommandShell shell) |
boolean |
useLoginShell()
Obtain the flag that indicates a login shell should be started once the connection is established
|
boolean |
usePassword()
Get the value of the use password authentication flag.
|
public static int DEFAULT_PORT
public static int DEFAULT_TIMEOUT
public static final java.lang.String HOSTNAME_ATTR
public static final java.lang.String USERNAME_ATTR
public static final java.lang.String PASSWORD_ATTR
public static final java.lang.String PORT_ATTR
public static final java.lang.String TIMEOUT_ATTR
public IRemoteConnection getRemoteConnection()
getRemoteConnection in interface IRemoteConnection.Servicepublic IRemoteProcess getCommandShell(int flags) throws java.io.IOException
IRemoteCommandShellServiceIRemoteProcessBuilder.getSupportedFlags() to find out the flags
supported by the service provider.
Current flags are:IRemoteProcessBuilder.NONE- disable any flagsIRemoteProcessBuilder.ALLOCATE_PTY- allocate a pseudo-terminal for the process (RFC-4254 Sec. 6.2)IRemoteProcessBuilder.FORWARD_X11- enable X11 forwarding (RFC-4254 Sec. 6.3)
getCommandShell in interface IRemoteCommandShellServiceflags - bitwise-or of flagsjava.io.IOExceptionpublic int getPort()
IRemoteConnectionHostServicegetPort in interface IRemoteConnectionHostServicepublic int getTimeout()
IRemoteConnectionHostServicegetTimeout in interface IRemoteConnectionHostServicepublic void close()
IRemoteConnectionControlServiceclose in interface IRemoteConnectionControlServicepublic java.lang.String getHostname()
IRemoteConnectionHostServicegetHostname in interface IRemoteConnectionHostServicepublic boolean useLoginShell()
IRemoteConnectionHostServiceuseLoginShell in interface IRemoteConnectionHostServicepublic java.lang.String getUsername()
IRemoteConnectionHostServicegetUsername in interface IRemoteConnectionHostServicepublic void setHostname(java.lang.String hostname)
IRemoteConnectionHostServicesetHostname in interface IRemoteConnectionHostServicehostname - new hostname for connectionpublic void setPassphrase(java.lang.String passphrase)
IRemoteConnectionHostServicesetPassphrase in interface IRemoteConnectionHostServicepublic void setPassword(java.lang.String password)
IRemoteConnectionHostServicesetPassword in interface IRemoteConnectionHostServicepassword - new password for connectionpublic void setPort(int port)
IRemoteConnectionHostServicesetPort in interface IRemoteConnectionHostServiceport - new port for connectionpublic void setTimeout(int timeout)
IRemoteConnectionHostServicesetTimeout in interface IRemoteConnectionHostServicetimeout - new timeout valuepublic void setUseLoginShell(boolean useLogingShell)
IRemoteConnectionHostServicesetUseLoginShell in interface IRemoteConnectionHostServiceuseLogingShell - true to start a login shellpublic void setUsePassword(boolean usePassword)
IRemoteConnectionHostServicesetUsePassword in interface IRemoteConnectionHostServiceusePassword - use password authenticationpublic void setUsername(java.lang.String username)
IRemoteConnectionHostServicesetUsername in interface IRemoteConnectionHostServiceusername - new username for connectionpublic void open(org.eclipse.core.runtime.IProgressMonitor monitor)
throws RemoteConnectionException
IRemoteConnectionControlServiceopen in interface IRemoteConnectionControlServicemonitor - 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.RemoteConnectionExceptionpublic boolean isOpen()
IRemoteConnectionControlServiceisOpen in interface IRemoteConnectionControlServicepublic void connectionChanged(RemoteConnectionChangeEvent event)
IRemoteConnectionChangeListenerconnectionChanged in interface IRemoteConnectionChangeListenerevent - the connection change eventprotected void terminated(TelnetCommandShell shell)
public java.lang.String getPassphrase()
IRemoteConnectionHostServicegetPassphrase in interface IRemoteConnectionHostServicepublic java.lang.String getPassword()
IRemoteConnectionHostServicegetPassword in interface IRemoteConnectionHostServicepublic boolean usePassword()
IRemoteConnectionHostServiceusePassword in interface IRemoteConnectionHostService