com.foxsmart.csu.config.global.interfacepkg
Class IpMtuComponent

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

public class IpMtuComponent
extends CiscoRouterConfigComponent

The IpMtuComponent class sets the IP maximum transmit unit for an interface.

See Also:
Serialized Form

Field Summary
static java.lang.String IP
           
static java.lang.Integer MAX_MTU_BYTES
          The maximum "maximum" transmition unit in bytes.
static java.lang.Integer MIN_MTU_BYTES
          The minimum maximum transmition unit in bytes.
static java.lang.String MTU
           
 
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
IpMtuComponent()
          Constructs an IP maximum transmition unit.
 
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()
          Only output the encapsulation statement if the encapsulation options are no HDLC.
 java.lang.Integer getMtu()
          Gets the IP maximum transmition unit.
 void setMtu(java.lang.Integer mtu)
          Sets the IP maximum transmition unit.
 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

IP

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

MTU

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

MIN_MTU_BYTES

public static final java.lang.Integer MIN_MTU_BYTES
The minimum maximum transmition unit in bytes.


MAX_MTU_BYTES

public static final java.lang.Integer MAX_MTU_BYTES
The maximum "maximum" transmition unit in bytes.

Constructor Detail

IpMtuComponent

public IpMtuComponent()
Constructs an IP maximum transmition unit.

Method Detail

getMtu

public java.lang.Integer getMtu()
Gets the IP maximum transmition unit.

Returns:
the IP maximum transmit unit.

setMtu

public void setMtu(java.lang.Integer mtu)
Sets the IP maximum transmition unit.

Parameters:
mtu - the IP maximum transmition unit.

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
Only output the encapsulation statement if the encapsulation options are no HDLC. Otherwise, don't output anything since HDLC is the default.

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.