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

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

public class TelnetComponent
extends CiscoRouterConfigComponent
implements MultiLineComponent

The Telnet class represents the telnet protocol-specific configuration.

See Also:
Serialized Form

Field Summary
static java.lang.String BREAK_ON_IP
           
static java.lang.String IP_ON_BREAK
           
static int MAX_DTR_DELAY_SECS
          The maximum DTR delay in seconds.
static int MIN_DTR_DELAY_SECS
          The minimum DTR delay in seconds.
static java.lang.String REFUSE_NEGOTIATIONS
           
static java.lang.String SPEED
           
static java.lang.String SYNC_ON_BREAK
           
static java.lang.String TELNET
           
static java.lang.String TRANSPARENT
           
 
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
TelnetComponent()
          Constructs a telnet 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.
 boolean getBreakOnIpFlag()
          Gets the break on ip flag.
 boolean getIpOnBreakFlag()
          Gets the ip on break flag.
 boolean getRefuseNegotiationsFlag()
          Gets the refuse negotiations flag.
 boolean getSyncOnBreakFlag()
          Gets the sync on break flag.
 TelnetSpeed getTelnetSpeed()
          Gets the telnet speed information.
 boolean getTransparentFlag()
          Gets the transparent flag.
 void setBreakOnIpFlag(boolean breakOnIpFlag)
          Sets the break on ip flag.
 void setIpOnBreakFlag(boolean ipOnBreakFlag)
          Sets the ip on break flag.
 void setRefuseNegotiationsFlag(boolean refuseNegotiationsFlag)
          Sets the refuse negotiations flag.
 void setSyncOnBreakFlag(boolean syncOnBreakFlag)
          Sets the sync on break flag.
 void setTelnetSpeed(TelnetSpeed telnetSpeed)
          Sets the telnet speed information.
 void setTransparentFlag(boolean transparentFlag)
          Sets the transparent 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, 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

MIN_DTR_DELAY_SECS

public static final int MIN_DTR_DELAY_SECS
The minimum DTR delay in seconds.

See Also:
Constant Field Values

MAX_DTR_DELAY_SECS

public static final int MAX_DTR_DELAY_SECS
The maximum DTR delay in seconds.

See Also:
Constant Field Values

TELNET

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

BREAK_ON_IP

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

IP_ON_BREAK

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

REFUSE_NEGOTIATIONS

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

SYNC_ON_BREAK

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

TRANSPARENT

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

SPEED

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

TelnetComponent

public TelnetComponent()
Constructs a telnet object.

Method Detail

setBreakOnIpFlag

public void setBreakOnIpFlag(boolean breakOnIpFlag)
Sets the break on ip flag.

Parameters:
breakOnIpFlag - The break on ip flag.

getBreakOnIpFlag

public boolean getBreakOnIpFlag()
Gets the break on ip flag.

Returns:
the break on ip flag.

setIpOnBreakFlag

public void setIpOnBreakFlag(boolean ipOnBreakFlag)
Sets the ip on break flag.

Parameters:
ipOnBreakFlag - The ip on break flag.

getIpOnBreakFlag

public boolean getIpOnBreakFlag()
Gets the ip on break flag.

Returns:
the ip on break flag.

setRefuseNegotiationsFlag

public void setRefuseNegotiationsFlag(boolean refuseNegotiationsFlag)
Sets the refuse negotiations flag.

Parameters:
refuseNegotiationsFlag - The refuse negotiations flag.

getRefuseNegotiationsFlag

public boolean getRefuseNegotiationsFlag()
Gets the refuse negotiations flag.

Returns:
the refuse negotiations flag.

setSyncOnBreakFlag

public void setSyncOnBreakFlag(boolean syncOnBreakFlag)
Sets the sync on break flag.

Parameters:
syncOnBreakFlag - The sync on break flag.

getSyncOnBreakFlag

public boolean getSyncOnBreakFlag()
Gets the sync on break flag.

Returns:
the sync on break flag.

setTransparentFlag

public void setTransparentFlag(boolean transparentFlag)
Sets the transparent flag.

Parameters:
transparentFlag - The transparent flag.

getTransparentFlag

public boolean getTransparentFlag()
Gets the transparent flag.

Returns:
the transparent flag.

setTelnetSpeed

public void setTelnetSpeed(TelnetSpeed telnetSpeed)
Sets the telnet speed information.

Parameters:
telnetSpeed - The telnet speed information.

getTelnetSpeed

public TelnetSpeed getTelnetSpeed()
Gets the telnet speed information.

Returns:
the telnet speed 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.