|
AdventNet CLI 2.0 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.cli.transport.ssh.SshProtocolOptionsImpl
This class provides the SSH implementation of the CLIProtocolOptions
interface. It contains parameters like the Remote Host Address, Port,
login parameters, etc. In order to establish a CLI session over SSH
with a particular device the appropriate parameters has to be set on
an instance of this class and passed to the CLISession's constructor.
A subsequent call to the open() method in CLISession will
establish the Telnet connection based on the parameters set here.
CLISession session = new CLISession(cliProtocolOptionsImpl,enablePooling);
session.open();
OR it can be set on the session before calling the open() method in the
CLISession, like:
session.setCLIProtocolOptions(cliProtocolOptionsImpl);where session is an instance of CLISession and cliProtcolOptionsImpl is an instance of the class which implements this interface. The enablePooling is a boolean to indicate whether the session is dedicated or not.
| Constructor Summary | |
SshProtocolOptionsImpl()
Constructs ProtocolOptions for secure Telnet Connection. |
|
| Method Summary | |
java.lang.Object |
clone()
Returns an exact copy of this object. |
java.lang.Object |
getID()
Gets the Key based on the combination of remoteHost, Port and login name. |
java.lang.String |
getInitialMessage()
Gets the initial message sent by the device after a connection is established. |
java.lang.String |
getLoginName()
Gets the login Name. |
int |
getLoginTimeout()
Gets the login timeout of the ssh connection. |
java.lang.String |
getPassword()
Gets the login Password. |
java.lang.String |
getPrompt()
Gets the Prompt. |
java.lang.String |
getRemoteHost()
Gets the Remote Host name or IP address. |
int |
getRemotePort()
Gets the Remote Port. |
java.lang.String |
getTerminalType()
Gets the current terminal type. |
void |
setInitialMessage(java.lang.String message)
Sets the initial message sent by the device after a connection is established. |
void |
setLoginName(java.lang.String loginName)
Sets the login Name. |
void |
setLoginTimeout(int timeout)
Sets the login timeout. |
void |
setPassword(java.lang.String passwd)
Sets the login Password. |
void |
setPrompt(java.lang.String prompt)
Sets the Prompt. |
void |
setRemoteHost(java.lang.String remoteHost)
Sets the Remote Host name or IP address in dotted format. |
void |
setRemotePort(int remotePort)
Sets the Remote Port. |
void |
setTerminalType(java.lang.String terminal)
Sets the terminal type of the remote machine. |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public SshProtocolOptionsImpl()
For example to set various protocol options the following can be done:
SshProtocolOptionsImpl protocolOptions = new SshProtocolOptionsImpl()
protocolOptions.setRemoteHost("localhost");
protocolOptions.setRemotePort(22);
protocolOptions.setLoginName("guest");
protocolOptions.setPassword("guest");
protocolOptions.setPrompt("$");
CLISession cliSess = new CLISession(protocolOptions);
cliSess.setTransportProviderClassName("com.adventnet.cli.ssh.SshTransportProviderImpl");
cliSess.open();
CLIMessage msg = new CLIMessage("date");
System.out.println(cliSess.syncSend(msg).getData());
CLISession.setTransportProviderClassName(String).| Method Detail |
public void setRemoteHost(java.lang.String remoteHost)
remoteHost - the remoteHost to connect.public java.lang.String getRemoteHost()
public void setRemotePort(int remotePort)
remotePort - the remotePort to connect with.public int getRemotePort()
public java.lang.Object getID()
public void setLoginName(java.lang.String loginName)
loginName - the login user Name for the connection.public java.lang.String getLoginName()
public void setPassword(java.lang.String passwd)
passwd - the login Password.public java.lang.String getPassword()
public void setPrompt(java.lang.String prompt)
prompt - the command prompt.public java.lang.String getPrompt()
public void setTerminalType(java.lang.String terminal)
terminalType - the terminal that the remote machine emulates
such as vt100, vt320 or others as a String value.public java.lang.String getTerminalType()
String value.public java.lang.Object clone()
public java.lang.String getInitialMessage()
public void setInitialMessage(java.lang.String message)
message - the login Message from the device.public int getLoginTimeout()
public void setLoginTimeout(int timeout)
timeout - the timeout in milliseconds.
|
AdventNet CLI 2.0 API Specification | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||