AdventNet CLI 2.0 API Specification

com.adventnet.cli.config
Class LoginLevel

java.lang.Object
  |
  +--com.adventnet.cli.config.LoginLevel

public class LoginLevel
extends java.lang.Object

This class represents the mode in which the command or script task is to be executed. The commands available to the user vary with the login level or the mode in which the user has logged in.

Since:
CLI2.0

Method Summary
 java.lang.String getCommandPrompt()
          Gets the Prompt.
 java.lang.String getLevelExitCmd()
          Gets the command for exiting the current mode and returning to the parent mode, if any.
 java.lang.String getLoginCommand()
          Gets the command to be sent for entering the loginLevel.
 java.lang.String getLoginLevel()
          Gets the name of the loginLevel of the device.
 java.lang.String getLoginName()
          Gets the login name (or username) to logon to a level.
 java.lang.String getLoginPassword()
          Gets the password to be given for the login level.
 java.lang.String getLoginPrompt()
          Gets the login prompt.
 java.lang.String getParentLevel()
          Gets the parent of the current level or mode.
 java.lang.String getPasswordPrompt()
          Gets the password prompt for the level.
 java.lang.String[] getSubLevels()
          Gets the sublevels of the current level or mode.
 boolean isPasswordRequired()
          Returns true if password prompt exist for the mode.
 boolean isUserNameRequired()
          Returns true is login name is required for the mode or login prompt exists for the mode.
 void setCommandPrompt(java.lang.String cmdPrompt)
          Sets the Prompt.
 void setLevelExitCmd(java.lang.String cmd)
          Sets the command for exiting the current mode.
 void setLoginCommand(java.lang.String logCommand)
          Sets the command for the user to logon into the level or mode.
 void setLoginLevel(java.lang.String logLevel)
          Sets the loginLevel of the device.
 void setLoginName(java.lang.String logName)
          Sets the login name (or username) for the level.
 void setLoginPassword(java.lang.String logPassword)
          Sets the password to be given for the login level.
 void setLoginPrompt(java.lang.String logPrompt)
          Sets the login prompt.
 void setParentLevel(java.lang.String parentlevel)
          Sets the parent of the current level.
 void setPasswordPrompt(java.lang.String passwdPrompt)
          Sets the password prompt.
 void setSubLevels(java.lang.String[] sublevels)
          Sets the sublevels of the current level or mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLoginLevel

public java.lang.String getLoginLevel()
Gets the name of the loginLevel of the device. This is used as an identifier for the different levels maintained for a device. Hence it should be unique.
Returns:
the login level

setLoginLevel

public void setLoginLevel(java.lang.String logLevel)
Sets the loginLevel of the device. This should be unique.
Parameters:
logLevel - the login level the device is in.

getLoginCommand

public java.lang.String getLoginCommand()
Gets the command to be sent for entering the loginLevel. On execution of this command, the user will be switched to this loginLevel.
Returns:
the command for logging into the level

setLoginCommand

public void setLoginCommand(java.lang.String logCommand)
Sets the command for the user to logon into the level or mode. This is used by the ConfigAPI to switch over the login level.
Parameters:
logCommand - the command for logging into the level.

getLoginName

public java.lang.String getLoginName()
Gets the login name (or username) to logon to a level. Note that this can be null in case there is no login prompt for the level.
Returns:
the login name for the level.

setLoginName

public void setLoginName(java.lang.String logName)
Sets the login name (or username) for the level. Note that this can be null in case there is no login prompt for the level.
Parameters:
logName - the login name for the level.

getLoginPassword

public java.lang.String getLoginPassword()
Gets the password to be given for the login level. Note that this can be null in case the level requires no password (i.e. if passwordPrompt is null).
Returns:
the password for the level.

setLoginPassword

public void setLoginPassword(java.lang.String logPassword)
Sets the password to be given for the login level. Note that this can be null in case the level requires no password (i.e. if passwordPrompt is null).
Parameters:
logPassword - the password for the level.

getPasswordPrompt

public java.lang.String getPasswordPrompt()
Gets the password prompt for the level. This is the String the device issues before waiting for the password.
Returns:
the password prompt

setPasswordPrompt

public void setPasswordPrompt(java.lang.String passwdPrompt)
Sets the password prompt. This can be null in case the device doesn't prompt for a password.
Parameters:
passwdPrompt - the password prompt

getLoginPrompt

public java.lang.String getLoginPrompt()
Gets the login prompt. This is the String the device issues before waiting for the login name.
Returns:
the login prompt

setLoginPrompt

public void setLoginPrompt(java.lang.String logPrompt)
Sets the login prompt. This is the String the device issues before waiting for the login name.
Parameters:
logPrompt - login prompt as a String value

getCommandPrompt

public java.lang.String getCommandPrompt()
Gets the Prompt. This is the String that is issued by the device after a successful login.
Returns:
the command prompt as a String instance.

setCommandPrompt

public void setCommandPrompt(java.lang.String cmdPrompt)
Sets the Prompt. This is the String that is issued by the device after a successful login. Usually this is also sent back by the device after the execution of each command.
Parameters:
cmdPrompt - the command prompt.

getSubLevels

public java.lang.String[] getSubLevels()
Gets the sublevels of the current level or mode. This will be null if there are no sublevels for a given level.
Returns:
a String[] array having the names of the sublevels.

setSubLevels

public void setSubLevels(java.lang.String[] sublevels)
Sets the sublevels of the current level or mode.
Parameters:
sublevels - a String[] array having the names of the sublevels.

getParentLevel

public java.lang.String getParentLevel()
Gets the parent of the current level or mode. This is mainly to find the heirarchy of the levels.
Returns:
the name of the parent of the current level.

setParentLevel

public void setParentLevel(java.lang.String parentlevel)
Sets the parent of the current level.
Parameters:
parentlevel - the name of the parent of the current level.

getLevelExitCmd

public java.lang.String getLevelExitCmd()
Gets the command for exiting the current mode and returning to the parent mode, if any.
Returns:
the command for exiting the mode.

setLevelExitCmd

public void setLevelExitCmd(java.lang.String cmd)
Sets the command for exiting the current mode.
Parameters:
cmd - the command to exit the current mode.

isPasswordRequired

public boolean isPasswordRequired()
Returns true if password prompt exist for the mode.
Returns:
true if password prompt is not null.

isUserNameRequired

public boolean isUserNameRequired()
Returns true is login name is required for the mode or login prompt exists for the mode.
Returns:
true if login prompt is not null.

AdventNet CLI 2.0 API Specification