com.foxsmart.csu.config.global.line
Class AutocommandOptionsComponent

java.lang.Object
  extended by com.foxsmart.csu.config.CiscoRouterConfigParser
      extended by com.foxsmart.csu.config.CiscoRouterConfigComponent
          extended by com.foxsmart.csu.config.global.line.AutocommandOptionsComponent
All Implemented Interfaces:
java.io.Serializable

public class AutocommandOptionsComponent
extends CiscoRouterConfigComponent

The autocommand options class represents a line's autocommand options.

See Also:
Serialized Form

Field Summary
static java.lang.String ABORT_CHARACTER
           
static java.lang.String AUTOCOMMAND_OPTIONS
           
static java.lang.String DELAY
           
static java.lang.Integer MAX_DECIMAL_EQUIVALENT_VALUE
          The maximum decimal equivalent value.
static int MAX_DELAY_SECS
          The maximum delay in seconds.
static java.lang.Integer MIN_DECIMAL_EQUIVALENT_VALUE
          The minimum decimal equivalent value.
static int MIN_DELAY_SECS
          The minimum delay in seconds.
static java.lang.String NOHANGUP
           
 
Fields inherited from class com.foxsmart.csu.config.CiscoRouterConfigComponent
commentComponent, componentMap, log, parentComponent
 
Fields inherited from class com.foxsmart.csu.config.CiscoRouterConfigParser
NO, tokenIndex
 
Constructor Summary
AutocommandOptionsComponent()
          Constructs an auto command options object.
 
Method Summary
 java.util.List buildFromIos(java.util.List configLines)
          Parse and populate the specific CiscoRouterComponent object based on the passed in individual lines of the IOS configuration.
 Commands generateIos()
          Returns the IOS configuration commands for this component.
 java.lang.String getAbortCharacter()
          Gets the abort character.
 java.lang.Integer getDelay()
          Gets the delay in seconds.
 boolean getNoHangup()
          Gets the no hangup flag.
 void setAbortCharacter(java.lang.String abortCharacter)
          Sets the abort character.
 void setDelay(java.lang.Integer delay)
          Sets the delay in seconds before the autocommand is run.
 void setNoHangup(boolean noHangup)
          Sets the no hangup flag.
 void validate()
          Validates this object to ensure it contains a valid IOS configuration.
 
Methods inherited from class com.foxsmart.csu.config.CiscoRouterConfigComponent
addComponent, addComponent, checkComponentType, deleteOldConfigWhenUpdating, dumpComponents, generateChildrenUpdateConfiglet, generateCompositeIos, generateCompositeIos, generateDeleteIos, generateIos, generateIos, generateIos, generateMultiLineUpdateConfiglet, generateUpdateCompositeIos, generateUpdateIos, generateUpdateIos, getAllComponents, getCiscoRouterConfig, getComment, getComponentClassName, getComponentClassName, getComponentKeys, getComponents, getComponents, getDeferredDelete, getFirstComponent, getFirstComponent, getParentComponent, getTotalComponents, getTotalComponents, getUpdateConfiglet, instantiateComponent, instantiateComponent, isValid, removeAllComponents, removeAllComponents, removeAllComponents, removeComponent, removeComponent, removeComponent, requiresCommentSeparator, setComment, setParentComponent, validateChildren
 
Methods inherited from class com.foxsmart.csu.config.CiscoRouterConfigParser
checkExists, checkLineComplete, checkNotEmpty, checkRange, checkTokenCount, checkTokenCount, checkTokenMatch, checkTokenMatch, decrementTokenIndex, generateCommands, getBigDecimalNumberFromString, getDoubleNumberFromString, getEnum, getHexadecimalNumberFromString, getIntegerNumberFromString, getIpAddressFromString, getLine, getLongNumberFromString, getMacAddressFromString, getNextOptionalToken, getNextToken, getToken, getTokenIndex, getTokens, getTotalIndentedLines, getTotalLines, incrementTokenIndex, invalidConfiguration, invalidTokenFound, isEmpty, moreIndentedLines, moreLines, moreTokens, removeLines, resetTokenIndex, setTokenIndex, tokensLeft
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTOCOMMAND_OPTIONS

public static final java.lang.String AUTOCOMMAND_OPTIONS
See Also:
Constant Field Values

ABORT_CHARACTER

public static final java.lang.String ABORT_CHARACTER
See Also:
Constant Field Values

DELAY

public static final java.lang.String DELAY
See Also:
Constant Field Values

NOHANGUP

public static final java.lang.String NOHANGUP
See Also:
Constant Field Values

MIN_DECIMAL_EQUIVALENT_VALUE

public static final java.lang.Integer MIN_DECIMAL_EQUIVALENT_VALUE
The minimum decimal equivalent value.


MAX_DECIMAL_EQUIVALENT_VALUE

public static final java.lang.Integer MAX_DECIMAL_EQUIVALENT_VALUE
The maximum decimal equivalent value.


MIN_DELAY_SECS

public static final int MIN_DELAY_SECS
The minimum delay in seconds.

See Also:
Constant Field Values

MAX_DELAY_SECS

public static final int MAX_DELAY_SECS
The maximum delay in seconds.

See Also:
Constant Field Values
Constructor Detail

AutocommandOptionsComponent

public AutocommandOptionsComponent()
Constructs an auto command options object.

Method Detail

setAbortCharacter

public void setAbortCharacter(java.lang.String abortCharacter)
Sets the abort character. Valid values include a character (e.g. "A") or a decimal equivalent (e.g. 65). To set the abort character to a single digit (e.g. 1), the associated decimal equivalent must be used since the passed in digit will be interpreted as a decimal value rather than a character. If a decimal equivalent value is used, it must be between 0 and 255.

Parameters:
abortCharacter - The abort character.

getAbortCharacter

public java.lang.String getAbortCharacter()
Gets the abort character.

Returns:
the abort character.

setDelay

public void setDelay(java.lang.Integer delay)
Sets the delay in seconds before the autocommand is run. Valid values: 0-120 seconds.

Parameters:
delay - The delay in seconds.

getDelay

public java.lang.Integer getDelay()
Gets the delay in seconds.

Returns:
the delay in seconds.

setNoHangup

public void setNoHangup(boolean noHangup)
Sets the no hangup flag. If true, no hangup after autocommand completion. Default is false.

Parameters:
noHangup - The no hangup flag.

getNoHangup

public boolean getNoHangup()
Gets the no hangup flag.

Returns:
the no hangup flag.

buildFromIos

public java.util.List buildFromIos(java.util.List configLines)
                            throws InvalidConfigurationException
Description copied from class: CiscoRouterConfigComponent
Parse and populate the specific CiscoRouterComponent object based on the passed in individual lines of the IOS configuration. The passed in configuration lines should represent the first line in the configuration that applies to the specific component. The component should use all lines needed by its specific part of the configuration and return a List with the remaining lines that are not part of the component's configuration.

Specified by:
buildFromIos in class CiscoRouterConfigComponent
Parameters:
configLines - The list of IOS configuration lines.
Returns:
The rest of the lines that were not parsed by the component.
Throws:
InvalidConfigurationException - if the IOS configuration can not be parsed for any reason.
See Also:
CiscoRouterConfigComponent

validate

public void validate()
              throws InvalidConfigurationException
Description copied from class: CiscoRouterConfigComponent
Validates this object to ensure it contains a valid IOS configuration.

Specified by:
validate in class CiscoRouterConfigComponent
Throws:
InvalidConfigurationException - if the configuration is invalid.
See Also:
CiscoRouterConfigComponent

generateIos

public Commands generateIos()
                     throws InvalidConfigurationException
Description copied from class: CiscoRouterConfigComponent
Returns the IOS configuration commands for this component.

Specified by:
generateIos in class CiscoRouterConfigComponent
Returns:
The IOS configuration string as a list of Command objects. To generate a configlet from the list of Command objects, use Command.getConfiglet().
Throws:
InvalidConfigurationException - if the IOS configuration is invalid and the IOS string can not be generated. The validate() method is used to determine if the configuration is valid.
See Also:
CiscoRouterConfigComponent


Copyright © 2005-2008 Fox Smart, Inc. All Rights Reserved.