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

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

public class LoggingComponent
extends CiscoRouterConfigComponent

The logging class modifies message logging facilities.

You can configure the system to synchronize unsolicited messages and debug command output with solicited device output and prompts for a specific line. You can identify the types of messages to be output asynchronously based on the level of severity. You can also determine the maximum number of buffers for storing asynchronous messages for the terminal after which messages are dropped.

When synchronous logging of unsolicited messages and debug command output is turned on, unsolicited device output is displayed on the console or printed after solicited device output is displayed or printed. Unsolicited messages and debug command output is displayed on the console after the prompt for user input is returned. Therefore, unsolicited messages and debug command output are not interspersed with solicited device output and prompts. After the unsolicited messages are displayed, the console displays the user prompt again.

Level 2

Limit 20

See Also:
Serialized Form

Field Summary
static java.lang.Integer DEFAULT_BUFFER_LIMIT
          The default buffer limit.
static java.lang.String DEFAULT_SEVERITY_LEVEL
          The default severity level.
static java.lang.String LEVEL
           
static java.lang.String LEVEL_ALL
          Turn off all severity levels for asynchronous output.
static java.lang.String LIMIT
           
static java.lang.String LOGGING
           
static java.lang.Integer MAX_LEVEL
          The maximum level.
static java.lang.Integer MAX_NUM_BUFFERS
          The maximum number of buffers.
static java.lang.Integer MIN_LEVEL
          The minimum level.
static java.lang.Integer MIN_NUM_BUFFERS
          The minimum number of buffers.
static java.lang.String SYNCHRONOUS
           
 
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
LoggingComponent()
          Constructs a logging 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 getBufferLimit()
          Gets the buffer limit.
 java.lang.String getSeverityLevel()
          Gets the severity level.
 void setBufferLimit(java.lang.Integer bufferLimit)
          Sets the buffer limit.
 void setSeverityLevel(java.lang.String severityLevel)
          Sets the message severity level.
 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

LOGGING

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

SYNCHRONOUS

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

LEVEL

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

LIMIT

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

LEVEL_ALL

public static final java.lang.String LEVEL_ALL
Turn off all severity levels for asynchronous output.

See Also:
Constant Field Values

MIN_NUM_BUFFERS

public static final java.lang.Integer MIN_NUM_BUFFERS
The minimum number of buffers.


MAX_NUM_BUFFERS

public static final java.lang.Integer MAX_NUM_BUFFERS
The maximum number of buffers.


MIN_LEVEL

public static final java.lang.Integer MIN_LEVEL
The minimum level.


MAX_LEVEL

public static final java.lang.Integer MAX_LEVEL
The maximum level.


DEFAULT_BUFFER_LIMIT

public static final java.lang.Integer DEFAULT_BUFFER_LIMIT
The default buffer limit.


DEFAULT_SEVERITY_LEVEL

public static final java.lang.String DEFAULT_SEVERITY_LEVEL
The default severity level.

See Also:
Constant Field Values
Constructor Detail

LoggingComponent

public LoggingComponent()
Constructs a logging object.

Method Detail

setSeverityLevel

public void setSeverityLevel(java.lang.String severityLevel)
Sets the message severity level. A string value of the severity level should be passed in. Valid values: 0-7 or "all". The "LEVEL_ALL" constant should be passed in for "all". Messages with a severity level equal to or higher than this value are printed asynchronously. Low numbers indicate greater severity and high numbers indicate lesser severity. LEVEL_ALL specifies that all messages are printed asynchronously, regardless of the severity level. Default value: 2.

Parameters:
severityLevel - The severity level.

getSeverityLevel

public java.lang.String getSeverityLevel()
Gets the severity level.

Returns:
the severity level.

setBufferLimit

public void setBufferLimit(java.lang.Integer bufferLimit)
Sets the buffer limit. Specifies the number of buffers to be queued for the terminal after which new messages are dropped. Valid values: 0-2147483647. Default value: 20.

Parameters:
bufferLimit - The buffer limit.

getBufferLimit

public java.lang.Integer getBufferLimit()
Gets the buffer limit.

Returns:
the buffer limit.

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.

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.