AdventNet WiFi Mediation API, v1.0

com.adventnet.wifi.mediation
Class CLICredentials

java.lang.Object
  extended bycom.adventnet.wifi.mediation.CLICredentials

public class CLICredentials
extends java.lang.Object

Class that contains the CLI related properties such as
1. Login Prompt 2. Login Name 3. Password Prompt 4. Password 5. Time out
These properties will be used to log into the the device to retrieve or configure the device using CLI.

See Also:
Device.setCLICredentials(CLICredentials)

Field Summary
static int CLI_LOGIN_TIMEOUT
          Constant to represent the CLI login timeout value.
static int CLI_PORT
          Constant that represents the CLI PORT value.
static int CLI_REQUEST_TIMEOUT
          Constant to represent the CLI request timeout value.
 
Constructor Summary
CLICredentials(int port, java.lang.String loginName, java.lang.String password)
          Constructs a CLICredential Obj with the given port,login name and password.
CLICredentials(int port, java.lang.String loginName, java.lang.String password, boolean useSSH)
          Constructs a CLICredential with the given port, login name, password and a boolean indicating if SSH is to be used for communicating with the device.
 
Method Summary
 java.lang.String getEnablePassword()
          Fetches the enable password for the device.
 java.lang.String getEnablePrompt()
          Fetches the enable prompt.
 java.lang.String getLoginName()
          Returns the login id to log on to the device
 java.lang.String getLoginPrompt()
          Returns the login Prompt of the service.
 int getLoginTimeout()
          Fetches the login request's timeout in millisecond.
 java.lang.String getPassword()
          Returns the Password to log on to the device
 java.lang.String getPasswordPrompt()
          Returns the password prompt of the service.
 int getPort()
          Returns the port in which the CLI service is enabled.
 int getRequestTimeout()
          Fetches the Request timeout in millisecond.
 java.lang.String getShellPrompt()
          Returns the ShellPrompt of the service.
 boolean isSecureShellEnabled()
          A method to indicate if the CLI commands are to be sent over SSH
 void setEnablePassword(java.lang.String passwd)
          Sets the enable password.
 void setEnablePrompt(java.lang.String prompt)
          Sets the enable prompt.
 void setLoginName(java.lang.String loginName)
          A method to set the loginName that is to log on to the device
 void setLoginPrompt(java.lang.String loginPrompt)
          Sets the login prompt for the service.
 void setLoginTimeout(int timeout)
          Sets the login request's timeout in millisecond.
 void setPassword(java.lang.String password)
          Sets the password to login to the device
 void setPasswordPrompt(java.lang.String passwordPrompt)
          Sets the passwordPrompt for the service.
 void setPort(int port)
          A method to set the port number on which the CLI service in the device is enabled.
 void setRequestTimeout(int timeout)
          Sets the request timeout in millisecond.
 void setShellPrompt(java.lang.String shellPrompt)
          Sets the Shell Prompt for the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLI_PORT

public static int CLI_PORT
Constant that represents the CLI PORT value. Whenever a CLICredentials class is instantiated its port value will default to the value(23) specified in this variable. The setPort method will not affect the status of this variable, it will impact the value of the specific instance on which it is called.


CLI_LOGIN_TIMEOUT

public static int CLI_LOGIN_TIMEOUT
Constant to represent the CLI login timeout value. Whenever a CLICredentials class is instantiated its login timeout value will default to the value(5000ms) specified in this variable. The setLoginTimeout method will not affect the status of this variable, it will impact the value of the specific instance on which it is called.


CLI_REQUEST_TIMEOUT

public static int CLI_REQUEST_TIMEOUT
Constant to represent the CLI request timeout value. Whenever a CLICredentials class is instantiated its request timeout value will default to the value(5000ms) specified in this variable. The setRequestTimeout method will not affect the status of this variable, it will impact the value of the specific instance on which it is called.

Constructor Detail

CLICredentials

public CLICredentials(int port,
                      java.lang.String loginName,
                      java.lang.String password)
Constructs a CLICredential Obj with the given port,login name and password.

Parameters:
port - The port number on which the CLI service in the device is enabled.
loginName - The login id to log on to the device
password - the password to login to the device.

CLICredentials

public CLICredentials(int port,
                      java.lang.String loginName,
                      java.lang.String password,
                      boolean useSSH)
Constructs a CLICredential with the given port, login name, password and a boolean indicating if SSH is to be used for communicating with the device.

Parameters:
port - The port number on which the CLI service in the device is enabled.
loginName - The login id to connect to the device
password - the password to login to the device.
useSSH - A boolean that indicates if the CLI commands are to be sent over a SSH connection
Method Detail

isSecureShellEnabled

public boolean isSecureShellEnabled()
A method to indicate if the CLI commands are to be sent over SSH

Returns:
boolean - Flag that indicates if SSH is to be used or not

getPort

public int getPort()
Returns the port in which the CLI service is enabled.

Returns:
The port number on which the CLI service in the device is enabled.

setPort

public void setPort(int port)
A method to set the port number on which the CLI service in the device is enabled. This method will not have any impact on the static variable CLI_PORT, this instead will set the port for the specific instance.

Parameters:
port - the port in which the CLI service is running.

getLoginName

public java.lang.String getLoginName()
Returns the login id to log on to the device

Returns:
the login name to be used to login to the device

setLoginName

public void setLoginName(java.lang.String loginName)
A method to set the loginName that is to log on to the device

Parameters:
loginName - The login id to log on to the device

getPassword

public java.lang.String getPassword()
Returns the Password to log on to the device

Returns:
the password to login to the device.

setPassword

public void setPassword(java.lang.String password)
Sets the password to login to the device

Parameters:
password - the password.

getLoginPrompt

public java.lang.String getLoginPrompt()
Returns the login Prompt of the service.

Returns:
the login prompt

setLoginPrompt

public void setLoginPrompt(java.lang.String loginPrompt)
Sets the login prompt for the service. This value should match with the device's login prompt in order to pass the loginName to the device. Time out may result if the loginPrompt doesn't match, as server waits for the specified loginPrompt to pass the loginName.

Parameters:
loginPrompt - the login prompt of the service.

getPasswordPrompt

public java.lang.String getPasswordPrompt()
Returns the password prompt of the service.

Returns:
the password prompt

setPasswordPrompt

public void setPasswordPrompt(java.lang.String passwordPrompt)
Sets the passwordPrompt for the service. This value should match with the device's password prompt in order to pass the password to the device. Time out may result if the password prompt doesn't match , as server waits for the specified password prompt to pass the password.

Parameters:
passwordPrompt - the password prompt of the service.

getShellPrompt

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

Returns:
the shell prompt.

setShellPrompt

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

Parameters:
shellPrompt - the shell prompt

setEnablePassword

public void setEnablePassword(java.lang.String passwd)
Sets the enable password. Enable prompt and password are specific to Cisco device and any configuration is possible only from the enable prompt.

Parameters:
passwd - the enable password of the device.

getEnablePassword

public java.lang.String getEnablePassword()
Fetches the enable password for the device. Enable prompt and password are specific to Cisco device and any configuration is possible only from the enable prompt.

Returns:
the enable password of the device.

setEnablePrompt

public void setEnablePrompt(java.lang.String prompt)
Sets the enable prompt. Enable prompt and password are specific to Cisco deviceand any configuration is possible only from the enable prompt.

Parameters:
prompt - the enable prompt of the device.

getEnablePrompt

public java.lang.String getEnablePrompt()
Fetches the enable prompt. Enable prompt and password are specific to Cisco device and any configuration is possible only from the enable prompt.

Returns:
the enable prompt of the device.

setLoginTimeout

public void setLoginTimeout(int timeout)
Sets the login request's timeout in millisecond. This method will not impact the value of the static variable CLI_LOGIN_TIMEOUT, but will set the value for the specific instance.

Parameters:
timeout - login timeout value in millisecond.

getLoginTimeout

public int getLoginTimeout()
Fetches the login request's timeout in millisecond.

Returns:
the login request timeout value in millisecond.

setRequestTimeout

public void setRequestTimeout(int timeout)
Sets the request timeout in millisecond. This method will not have impact on the static variable CLI_REQUEST_TIMEOUT but will set the value for the specific instance.

Parameters:
timeout - the request timeout value in millisecond.

getRequestTimeout

public int getRequestTimeout()
Fetches the Request timeout in millisecond.

Returns:
the request timeout value in millisecond.

AdventNet WiFi Mediation API, v1.0

Copyright © 2005 AdventNet Inc. All Rights Reserved.