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

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.ScriptComponent
All Implemented Interfaces:
MultiLineComponent, java.io.Serializable

public class ScriptComponent
extends CiscoRouterConfigComponent
implements MultiLineComponent

The script command specifies event related chat scripts to run on the line.

See Also:
Serialized Form

Field Summary
static java.lang.String ACTIVATION
           
static java.lang.String ARAP_CALLBACK
           
static java.lang.String CALLBACK
           
static java.lang.String CONNECTION
           
static java.lang.String DIALER
           
static java.lang.String RESET
           
static java.lang.String SCRIPT
           
static java.lang.String STARTUP
           
 
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
ScriptComponent()
          Constructs a script 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 generateDeleteIos(CiscoRouterConfig updatedCiscoRouterConfig)
          Generates the IOS configuration commands to delete this component.
 Commands generateIos()
          Returns the IOS configuration commands for this component.
 java.lang.String getActivationScript()
          Gets the activation chat script name.
 java.lang.String getArapCallbackScript()
          Gets the arap callback chat script name.
 java.lang.String getCallbackScript()
          Gets the callback chat script name.
 java.lang.String getConnectionScript()
          Gets the connection chat script name.
 java.lang.String getDialerScript()
          Gets the dialer chat script name.
 java.lang.String getResetScript()
          Gets the reset chat script name.
 java.lang.String getStartupScript()
          Gets the startup chat script name.
 void setActivationScript(java.lang.String activationScript)
          Sets the activation chat script name.
 void setArapCallbackScript(java.lang.String arapCallbackScript)
          Sets the arap callback chat script name.
 void setCallbackScript(java.lang.String callbackScript)
          Sets the callback chat script name.
 void setConnectionScript(java.lang.String connectionScript)
          Sets the connection chat script name.
 void setDialerScript(java.lang.String dialerScript)
          Sets the dialer chat script name.
 void setResetScript(java.lang.String resetScript)
          Sets the reset chat script name.
 void setStartupScript(java.lang.String startupScript)
          Sets the startup chat script name.
 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, 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

SCRIPT

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

STARTUP

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

CONNECTION

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

DIALER

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

RESET

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

ACTIVATION

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

ARAP_CALLBACK

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

CALLBACK

public static final java.lang.String CALLBACK
See Also:
Constant Field Values
Constructor Detail

ScriptComponent

public ScriptComponent()
Constructs a script object.

Method Detail

setStartupScript

public void setStartupScript(java.lang.String startupScript)
Sets the startup chat script name.

Parameters:
startupScript - The startup chat script name.

getStartupScript

public java.lang.String getStartupScript()
Gets the startup chat script name.

Returns:
the startup chat script name.

setConnectionScript

public void setConnectionScript(java.lang.String connectionScript)
Sets the connection chat script name.

Parameters:
connectionScript - The connection chat script name.

getConnectionScript

public java.lang.String getConnectionScript()
Gets the connection chat script name.

Returns:
the connection chat script name.

setDialerScript

public void setDialerScript(java.lang.String dialerScript)
Sets the dialer chat script name.

Parameters:
dialerScript - The dialer chat script name.

getDialerScript

public java.lang.String getDialerScript()
Gets the dialer chat script name.

Returns:
the dialer chat script name.

setResetScript

public void setResetScript(java.lang.String resetScript)
Sets the reset chat script name.

Parameters:
resetScript - The reset chat script name.

getResetScript

public java.lang.String getResetScript()
Gets the reset chat script name.

Returns:
the reset chat script name.

setActivationScript

public void setActivationScript(java.lang.String activationScript)
Sets the activation chat script name.

Parameters:
activationScript - The activation chat script name.

getActivationScript

public java.lang.String getActivationScript()
Gets the activation chat script name.

Returns:
the activation chat script name.

setArapCallbackScript

public void setArapCallbackScript(java.lang.String arapCallbackScript)
Sets the arap callback chat script name.

Parameters:
arapCallbackScript - The arap callback chat script name.

getArapCallbackScript

public java.lang.String getArapCallbackScript()
Gets the arap callback chat script name.

Returns:
the arap callback chat script name.

setCallbackScript

public void setCallbackScript(java.lang.String callbackScript)
Sets the callback chat script name.

Parameters:
callbackScript - The callback chat script name.

getCallbackScript

public java.lang.String getCallbackScript()
Gets the callback chat script name.

Returns:
the callback chat script name.

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

generateDeleteIos

public Commands generateDeleteIos(CiscoRouterConfig updatedCiscoRouterConfig)
                           throws InvalidConfigurationException
Description copied from class: CiscoRouterConfigComponent
Generates the IOS configuration commands to delete this component. This is the default implementation that generates a "no" statement followed by the generateIos() string for non CompositeComponents or generateHeaderIos() for CompositeComponents. Specific components may choose to override this method if this implementation is incorrect. The "no" keyword is placed where the first character of the command is located. For example, if the IOS command is " length 255", then the returned command will be " no length 255" (and not "no length 255").

Note that this implementation will call the getDeferredDelete method on the component and set the "deferred flag" on the returned Commands with its returned value.

Specified by:
generateDeleteIos in interface MultiLineComponent
Overrides:
generateDeleteIos in class CiscoRouterConfigComponent
Parameters:
updatedCiscoRouterConfig - the updated Cisco router configuration.
Returns:
The generated IOS string to deleted the component.
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:
MultiLineComponent


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