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

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

public class TransportComponent
extends CiscoRouterConfigComponent
implements MultiLineComponent

The Transport class defines transport protocols for the line.

See Also:
Serialized Form

Field Summary
static java.lang.String ALL
           
static java.lang.String INPUT
           
static java.lang.String NONE
           
static java.lang.String OUTPUT
           
static java.lang.String PAD
           
static java.lang.String PREFERRED
           
static java.lang.String RLOGIN
           
static java.lang.String SSH
           
static java.lang.String TELNET
           
static java.lang.String TRANSPORT
           
static java.lang.String UDPTN
           
 
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
TransportComponent()
          Constructs a scheduler object.
 
Method Summary
 void addInputProtocol(java.lang.String protocol)
          Adds an input transport protocol.
 void addOutputProtocol(java.lang.String protocol)
          Adds an output transport protocol.
 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.
 boolean containsInputProtocol(java.lang.String protocol)
          Determines if an input protocol is specified.
 boolean containsOutputProtocol(java.lang.String protocol)
          Determines if an output protocol is specified.
 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 getPreferredProtocol()
          Gets the preferred protocol.
 void removeAllInputProtocols()
          Removes all input protocols.
 void removeAllOutputProtocols()
          Removes all output protocols.
 void removeInputProtocol(java.lang.String protocol)
          Removes an input transport protocol.
 void removeOutputProtocol(java.lang.String protocol)
          Removes an output transport protocol.
 void setPreferredProtocol(java.lang.String protocol)
          Sets the preferred protocol.
 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

TRANSPORT

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

ALL

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

INPUT

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

NONE

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

OUTPUT

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

PAD

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

PREFERRED

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

RLOGIN

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

TELNET

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

UDPTN

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

SSH

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

TransportComponent

public TransportComponent()
Constructs a scheduler object.

Method Detail

addInputProtocol

public void addInputProtocol(java.lang.String protocol)
Adds an input transport protocol. Valid protocols are PAD, RLOGIN, TELNET, UDPTN, ALL and NONE. If ALL or NONE are used, no other protocols can exist.

Parameters:
protocol - The protocol to add.

addOutputProtocol

public void addOutputProtocol(java.lang.String protocol)
Adds an output transport protocol. Valid protocols are PAD, RLOGIN, TELNET, UDPTN, ALL and NONE. If ALL or NONE are used, no other protocols can exist.

Parameters:
protocol - The protocol to add.

removeInputProtocol

public void removeInputProtocol(java.lang.String protocol)
Removes an input transport protocol.

Parameters:
protocol - The protocol to remove.

removeAllInputProtocols

public void removeAllInputProtocols()
Removes all input protocols. This is the same as adding ALL protocols.


removeAllOutputProtocols

public void removeAllOutputProtocols()
Removes all output protocols. This is the same as adding ALL protocols.


removeOutputProtocol

public void removeOutputProtocol(java.lang.String protocol)
Removes an output transport protocol.

Parameters:
protocol - The protocol to remove.

containsInputProtocol

public boolean containsInputProtocol(java.lang.String protocol)
Determines if an input protocol is specified.

Parameters:
protocol - The protocol to check.
Returns:
whether the protocol is contained in the list.

containsOutputProtocol

public boolean containsOutputProtocol(java.lang.String protocol)
Determines if an output protocol is specified.

Parameters:
protocol - The protocol to check.
Returns:
whether the protocol is contained in the list.

setPreferredProtocol

public void setPreferredProtocol(java.lang.String protocol)
Sets the preferred protocol. Valid protocols are PAD, RLOGIN, TELNET, UDPTN, SSH, ALL and NONE. Null is the same as ALL.

Parameters:
protocol - The preferred protocol.

getPreferredProtocol

public java.lang.String getPreferredProtocol()
Gets the preferred protocol. Null represents ALL protocols.

Returns:
the preferred protocol.

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.