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

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

public class ModemComponent
extends CiscoRouterConfigComponent
implements MultiLineComponent

The Modem class configures the modem control lines.

See Also:
Serialized Form

Field Summary
static java.lang.String ANSWER_TIMEOUT
           
static java.lang.String BUSYOUT
           
static java.lang.String CTS_ALARM
           
static java.lang.String DIALIN
           
static java.lang.String DTR_ACTIVE
           
static java.lang.String DTR_DELAY
           
static java.lang.String HOST
           
static java.lang.String INOUT
           
static java.lang.String MODEM
           
static java.lang.String PRINTER
           
 
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
ModemComponent()
          Constructs a modem 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.Integer getAnswerTimeout()
          Gets the answer timout in seconds.
 boolean getBusyOutFlag()
          Gets the the busy out flag.
 java.lang.String getDeviceConfig()
          Gets the main device configuration.
 java.lang.Integer getDtrDelay()
          Gets the DTR delay in seconds.
 ModemAutoConfigure getModemAutoConfigure()
          Gets the the modem autoconfigure information.
 void setAnswerTimeout(java.lang.Integer answerTimeout)
          Sets the answer timout in seconds.
 void setBusyOutFlag(boolean busyOutFlag)
          Sets the the busy out flag.
 void setDeviceConfig(java.lang.String deviceConfig)
          Sets the main device configuration.
 void setDtrDelay(java.lang.Integer dtrDelay)
          Sets the DTR delay in seconds.
 void setModemAutoConfigure(ModemAutoConfigure modemAutoConfigure)
          Sets the the modem autoconfigure information.
 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

MODEM

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

CTS_ALARM

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

DTR_ACTIVE

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

DIALIN

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

HOST

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

INOUT

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

PRINTER

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

ANSWER_TIMEOUT

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

BUSYOUT

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

DTR_DELAY

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

ModemComponent

public ModemComponent()
Constructs a modem object.

Method Detail

setDeviceConfig

public void setDeviceConfig(java.lang.String deviceConfig)
Sets the main device configuration. Valid values are null, or one of the following class constants: CTS_ALARM, DTR_ACTIVE, DIALIN, HOST, INOUT, or PRINTER. The following is a description of each value:

CTS_ALARM: Alarm device which only uses CTS for call control.

DTR_ACTIVE: Leave DTR low unless line has an active incoming connection or EXEC.

DIALIN: Configure line for a modern dial-in modem.

HOST: Devices that expect an incoming modem call.

INOUT: Configure line for incoming AND outgoing use of modem. PRINTER: Devices that require DSR/CD active.

Parameters:
deviceConfig - The main device configuration.

getDeviceConfig

public java.lang.String getDeviceConfig()
Gets the main device configuration.

Returns:
the main device configuration.

setAnswerTimeout

public void setAnswerTimeout(java.lang.Integer answerTimeout)
Sets the answer timout in seconds. This value defines the interval between raising DTR and CTS responses. Valid values are from 0-65535 seconds.

Parameters:
answerTimeout - The answer timout in seconds.

getAnswerTimeout

public java.lang.Integer getAnswerTimeout()
Gets the answer timout in seconds.

Returns:
the answer timout in seconds.

setDtrDelay

public void setDtrDelay(java.lang.Integer dtrDelay)
Sets the DTR delay in seconds. This value is the interval during which DTR is held low.

Parameters:
dtrDelay - The DTR delay in seconds.

getDtrDelay

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

Returns:
the DTR delay in seconds.

setBusyOutFlag

public void setBusyOutFlag(boolean busyOutFlag)
Sets the the busy out flag. If the flag is set, the device will block calls to and from the modem.

Parameters:
busyOutFlag - The the busy out flag.

getBusyOutFlag

public boolean getBusyOutFlag()
Gets the the busy out flag.

Returns:
the the busy out flag.

setModemAutoConfigure

public void setModemAutoConfigure(ModemAutoConfigure modemAutoConfigure)
Sets the the modem autoconfigure information.

Parameters:
modemAutoConfigure - The the modem autoconfigure information.

getModemAutoConfigure

public ModemAutoConfigure getModemAutoConfigure()
Gets the the modem autoconfigure information.

Returns:
the the modem autoconfigure information.

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.