com.foxsmart.csu.config.global
Class BannerComponent

java.lang.Object
  extended by com.foxsmart.csu.config.CiscoRouterConfigParser
      extended by com.foxsmart.csu.config.CiscoRouterConfigComponent
          extended by com.foxsmart.csu.config.global.BannerComponent
All Implemented Interfaces:
MultiLineComponent, java.io.Serializable

public class BannerComponent
extends CiscoRouterConfigComponent
implements MultiLineComponent

The Banner class represents various router banners.

See Also:
Serialized Form

Field Summary
static java.lang.String BANNER
           
static java.lang.String BANNER_DELIMITER
           
static char BANNER_UPDATE_DELIMITER
           
static java.lang.String EXEC
           
static java.lang.String INCOMING
           
static java.lang.String LOGIN
           
static java.lang.String MOTD
           
static java.lang.String PROMPT_TIMEOUT
           
static java.lang.String SLIP_PPP
           
 
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
BannerComponent()
          Constructs a Banner 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 getExecBanner()
          Gets the EXEC Banner.
 java.lang.String getIncomingBanner()
          Gets the Incoming Banner.
 java.lang.String getLoginBanner()
          Gets the Login Banner.
 java.lang.String getMotdBanner()
          Gets the MOTD Banner.
 java.lang.String getPromptTimeoutBanner()
          Gets the Prompt Timeout Banner.
 java.lang.String getSlipPppBanner()
          Gets the Slip PPP Banner.
 void setExecBanner(java.lang.String execBanner)
          Sets the EXEC process creation banner.
 void setIncomingBanner(java.lang.String incomingBanner)
          Sets the incoming terminal line banner.
 void setLoginBanner(java.lang.String loginBanner)
          Sets the login banner.
 void setMotdBanner(java.lang.String motdBanner)
          Sets the Message of the Day banner.
 void setPromptTimeoutBanner(java.lang.String promptTimeoutBanner)
          Sets the message for login authentication timeout banner.
 void setSlipPppBanner(java.lang.String slipPppBanner)
          Sets the SLIP/PPP message banner.
 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

BANNER

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

EXEC

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

INCOMING

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

LOGIN

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

MOTD

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

PROMPT_TIMEOUT

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

SLIP_PPP

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

BANNER_DELIMITER

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

BANNER_UPDATE_DELIMITER

public static final char BANNER_UPDATE_DELIMITER
See Also:
Constant Field Values
Constructor Detail

BannerComponent

public BannerComponent()
Constructs a Banner object.

Method Detail

setExecBanner

public void setExecBanner(java.lang.String execBanner)
Sets the EXEC process creation banner. Set to null to remove the banner.

Parameters:
execBanner - The EXEC Banner.

getExecBanner

public java.lang.String getExecBanner()
Gets the EXEC Banner.

Returns:
The EXEC Banner.

setIncomingBanner

public void setIncomingBanner(java.lang.String incomingBanner)
Sets the incoming terminal line banner. Set to null to remove the banner.

Parameters:
incomingBanner - The Incoming Banner.

getIncomingBanner

public java.lang.String getIncomingBanner()
Gets the Incoming Banner.

Returns:
The Incoming Banner.

setLoginBanner

public void setLoginBanner(java.lang.String loginBanner)
Sets the login banner. Set to null to remove the banner.

Parameters:
loginBanner - The Login Banner.

getLoginBanner

public java.lang.String getLoginBanner()
Gets the Login Banner.

Returns:
The Login Banner.

setMotdBanner

public void setMotdBanner(java.lang.String motdBanner)
Sets the Message of the Day banner. Set to null to remove the banner.

Parameters:
motdBanner - The MOTD Banner.

getMotdBanner

public java.lang.String getMotdBanner()
Gets the MOTD Banner.

Returns:
The MOTD Banner.

setPromptTimeoutBanner

public void setPromptTimeoutBanner(java.lang.String promptTimeoutBanner)
Sets the message for login authentication timeout banner. Set to null to remove the banner.

Parameters:
promptTimeoutBanner - The Prompt Timeout Banner.

getPromptTimeoutBanner

public java.lang.String getPromptTimeoutBanner()
Gets the Prompt Timeout Banner.

Returns:
The Prompt Timeout Banner.

setSlipPppBanner

public void setSlipPppBanner(java.lang.String slipPppBanner)
Sets the SLIP/PPP message banner. Set to null to remove the banner.

Parameters:
slipPppBanner - The Slip PPP Banner.

getSlipPppBanner

public java.lang.String getSlipPppBanner()
Gets the Slip PPP Banner.

Returns:
The Slip PPP Banner.

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 IOS configuration.
Throws:
InvalidConfigurationException - if the configuration is invalid.
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 commands.
Throws:
InvalidConfigurationException - if the configuration is invalid.
See Also:
CiscoRouterConfigComponent.generateIos()

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.