AdventNet Web NMS 4 API Specification

com.adventnet.management.config.telnet
Class TelnetDevice

java.lang.Object
  |
  +--com.adventnet.management.config.xml.BaseElement
        |
        +--com.adventnet.management.config.xml.Device
              |
              +--com.adventnet.management.config.telnet.TelnetDevice
All Implemented Interfaces:
java.io.Serializable

public class TelnetDevice
extends Device

This class holds TELNET specific properties like loginName, loginPrompt, Password, passwordPrompt , shellPrompt etc for establishing a connection with the device via Telnet.

Attribute loginName need to be specified for devices which requires login for executing the commands. Device displays the loginPrompt for accepting the login name, so the attribute loginPrompt should match with the device's loginPrompt in order to pass the loginName. If the attribute loginPrompt does n't match with the device's loginPrompt,loginName won't be passed to the device as the server waits for the specified loginPrompt in order to pass the loginName and this results in Read Timed Out. Similarly password will be passed only if the passwordPrompt matches with the device's passwordPrompt.

LoginName and password need to be specifed ,only if the devices to be contacted need these values.

Shell prompt for a device specifies the start of execution of commands, so in order to start execution of commands after logging in ( if required ), the shell prompt should match with the device's shellprompt, otherwise Read Timed Out or Login Parameter Incorrect may result even though loginName and Password are correctly given.

See Also:
Serialized Form

Fields inherited from class com.adventnet.management.config.xml.BaseElement
element, isServer
 
Constructor Summary
TelnetDevice()
          Constructs a TelnetDevice with localhost as deviceName and 23 as telnet port.
TelnetDevice(Device device)
          Constructs a TelnetDevice from Device's Element.
TelnetDevice(java.lang.String deviceName)
          Constructs a TelnetDevice with default telnet port.
TelnetDevice(java.lang.String deviceName, java.lang.String port)
          Constructs a TelnetDevice for the specified device and port.
TelnetDevice(java.lang.String deviceName, java.lang.String port, int retries)
          Constructs a TelnetDevice for the specified device and port.
TelnetDevice(java.lang.String deviceName, java.lang.String port, int retries, int timeout)
          Constructs a TelnetDevice for the specified device and port.
TelnetDevice(java.lang.String deviceName, java.lang.String port, java.lang.String loginName, java.lang.String password, int retries, int timeout)
          Constructs a TelnetDevice for the specified device and port.
 
Method Summary
 java.lang.String getLoginName()
          Returns the loginName.
 java.lang.String getLoginPrompt()
          Returns the login Prompt of the device.
 java.lang.String getPassword()
          Returns the Password of the device.
 java.lang.String getPasswordPrompt()
          Returns the password prompt of the device.
 java.lang.String getShellPrompt()
          Returns the ShellPrompt of the device.
 void setLoginName(java.lang.String loginName)
          Specifies the name for signing on to a system.
 void setLoginPrompt(java.lang.String loginPrompt)
          Sets the login prompt for the device.
 void setPassword(java.lang.String password)
          Sets the password for the user who is signing in.
 void setPasswordPrompt(java.lang.String passwordPrompt)
          Sets the passwordPrompt for the device.
 void setShellPrompt(java.lang.String shellPrompt)
          Sets the Shell Prompt for the device.
 
Methods inherited from class com.adventnet.management.config.xml.Device
getDeviceName, getMOName, getPort, getRetries, getTimeout, setMOName, setRetries, setTimeout
 
Methods inherited from class com.adventnet.management.config.xml.BaseElement
addSubTag, getAttribute, getElement, getProperties, getSubTagsByName, hasAttribute, removeSubTagsByName, setAttribute, setProperties, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TelnetDevice

public TelnetDevice(java.lang.String deviceName)
Constructs a TelnetDevice with default telnet port.

TelnetDevice

public TelnetDevice()
Constructs a TelnetDevice with localhost as deviceName and 23 as telnet port.

TelnetDevice

public TelnetDevice(Device device)
Constructs a TelnetDevice from Device's Element.

TelnetDevice

public TelnetDevice(java.lang.String deviceName,
                    java.lang.String port)
Constructs a TelnetDevice for the specified device and port.
Parameters:
deviceName - Specifies DNS name / IPAddress of the device to be configured.
port - port where telnet service is listening.

TelnetDevice

public TelnetDevice(java.lang.String deviceName,
                    java.lang.String port,
                    int retries)
Constructs a TelnetDevice for the specified device and port.
Parameters:
deviceName - Specifies DNS name / IPAddress of the device to be configured.
port - port where telnet service is listening.
retries - number of retries to be carried out by ConfigServer if configuration fails for this device.

TelnetDevice

public TelnetDevice(java.lang.String deviceName,
                    java.lang.String port,
                    int retries,
                    int timeout)
Constructs a TelnetDevice for the specified device and port.
Parameters:
deviceName - Specifies DNS name / IPAddress of the device to be configured.
port - port where telnet service is listening.
retries - number of retries to be carried out by ConfigServer if configuration fails for this device.
timeout - timeout value in milliseconds.

TelnetDevice

public TelnetDevice(java.lang.String deviceName,
                    java.lang.String port,
                    java.lang.String loginName,
                    java.lang.String password,
                    int retries,
                    int timeout)
Constructs a TelnetDevice for the specified device and port.
Parameters:
deviceName - specifies DNS name / IPAddress of the device to be configured.
port - port where telnet service is listening.
loginName - specifies the name for signing on to a system.
password - password for the user who is signing in.
retries - number of retries to be carried out by ConfigServer if configuration fails for this device.
timeout - timeout value in milliseconds.
Method Detail

getLoginName

public java.lang.String getLoginName()
Returns the loginName.

setLoginName

public void setLoginName(java.lang.String loginName)
Specifies the name for signing on to a system.

getPassword

public java.lang.String getPassword()
Returns the Password of the device.

setPassword

public void setPassword(java.lang.String password)
Sets the password for the user who is signing in.

getLoginPrompt

public java.lang.String getLoginPrompt()
Returns the login Prompt of the device. LoginName and its prompt need to be set only if the device requires login.

setLoginPrompt

public void setLoginPrompt(java.lang.String loginPrompt)
Sets the login prompt for the device. This value should match with the device's login prompt in order to pass the loginName to the device. Timed Out may result if the loginPrompt does n't match ,as server waits for the specified loginPrompt to pass the loginName. LoginPrompt and LoginName need to be set only if the devices requires login.

getPasswordPrompt

public java.lang.String getPasswordPrompt()
Returns the password prompt of the device. Password and its prompt need to be set only if the device needs password.

setPasswordPrompt

public void setPasswordPrompt(java.lang.String passwordPrompt)
Sets the passwordPrompt for the device. This value should match with the device's password prompt in order to pass the password to the device. Timed Out may result if the password prompt does n't match , as server waits for the specified password prompt to pass the password. Password and Password prompt need to be set only if the devices require login.

getShellPrompt

public java.lang.String getShellPrompt()
Returns the ShellPrompt of the device.

setShellPrompt

public void setShellPrompt(java.lang.String shellPrompt)
Sets the Shell Prompt for the device. This should match with the device's shell prompt to start execution of commands on the device. Timed Out may result if the prompt does n't match with the device's shell.

AdventNet Web NMS 4 API Specification