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

java.lang.Object
  extended by com.foxsmart.csu.config.CiscoRouterConfigParser
      extended by com.foxsmart.csu.config.global.interfacepkg.RateLimitEntry
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class RateLimitEntry
extends CiscoRouterConfigParser
implements java.io.Serializable, java.lang.Comparable

The RateLimitEntry class represents a unique rate limit.

See Also:
Serialized Form

Field Summary
static java.lang.String ACCESS_GROUP
           
static java.lang.String CONFORM_ACTION
           
static java.lang.String DSCP
           
static java.lang.String EXCEED_ACTION
           
static java.lang.String INPUT
           
static java.lang.Integer MAX_ACCESS_LIST_INDEX
          The maximum access list index.
static java.lang.Long MAX_BANDWIDTH_BPS
          The maximum bandwidth bits per second.
static java.lang.Integer MAX_DSCP
          The maximum DSCP.
static java.lang.Long MAX_MAXIMUM_BURST_BYTES
          The maximum "maximum burst bytes".
static java.lang.Integer MAX_MPLS_EXP
          The maximum new MPLS experimental.
static java.lang.Long MAX_NORMAL_BURST_BYTES
          The maximum normal burst bytes.
static java.lang.Integer MAX_PRECEDENCE
          The maximum precedence.
static java.lang.Integer MAX_QOS_GROUP
          The maximum QOS group.
static java.lang.Integer MAX_RATE_LIMIT_ACCESS_LIST_INDEX
          The maximum rate limit precedence access list index.
static java.lang.Integer MIN_ACCESS_LIST_INDEX
          The minimum access list index.
static java.lang.Long MIN_BANDWIDTH_BPS
          The minimum bandwidth bits per second.
static java.lang.Integer MIN_DSCP
          The minimum DSCP.
static java.lang.Long MIN_MAXIMUM_BURST_BYTES
          The minimum "maximum burst bytes".
static java.lang.Integer MIN_MPLS_EXP
          The minimum new MPLS experimental.
static java.lang.Long MIN_NORMAL_BURST_BYTES
          The minimum normal burst bytes.
static java.lang.Integer MIN_PRECEDNECE
          The minimum precedence.
static java.lang.Integer MIN_QOS_GROUP
          The minimum QOS group.
static java.lang.Integer MIN_RATE_LIMIT_ACCESS_LIST_INDEX
          The minimum rate limit precedence access list index.
static java.lang.String OUTPUT
           
static java.lang.String QOS_GROUP
           
static java.lang.String RATE_LIMIT
           
 
Fields inherited from class com.foxsmart.csu.config.CiscoRouterConfigParser
log, NO, tokenIndex
 
Constructor Summary
RateLimitEntry()
          Constructs an IP route entry.
 
Method Summary
 void buildFromIos(java.lang.String line)
          Builds the IP route entry from the passed in IOS line.
 int compareTo(java.lang.Object object)
          Compares this object to the passed in RateLimitEntry object.
 boolean equals(java.lang.Object object)
          Checks the passed in RateLimitEntry object for equality.
 java.lang.String generateDeleteIosString()
          Generates the IOS configuration that will delete this rate limit entry.
 java.lang.String generateIosString()
          Generates the IOS configuration for this rate limit entry.
 java.lang.Integer getAccessListIndex()
          Gets the access list index.
 boolean getAccessListRateLimitFlag()
          Gets the access list rate limit flag.
 java.lang.Long getBandwidth()
          Gets the bandwidth in bits per second.
 RateLimitAction getConformAction()
          Gets the conform action.
 java.lang.Integer getDscpValue()
          Gets the DSCP value.
 RateLimitAction getExceedAction()
          Gets the exceed action.
 java.lang.Long getMaxBurst()
          Gets the maximum burst bytes.
 InputOutputEnum getMode()
          Gets the rate limit mode.
 java.lang.Long getNormalBurst()
          Gets the normal burst bytes.
 java.lang.Integer getQosGroupId()
          Gets the QOS group Id.
protected  RateLimitAction getRateLimitAction(java.lang.String token)
          Gets the rate limit action associated with the passed in token.
protected  RateLimitAction getRateLimitAction(java.lang.String line, java.util.List tokens)
          Gets the rate limit action from the next token(s).
protected  java.util.List getRateLimitActionList()
          Returns a list of newly instantiated rate limit actions.
 void setAccessListIndex(java.lang.Integer accessListIndex)
          Sets the access list index.
 void setAccessListRateLimitFlag(boolean accessListRateLimitFlag)
          Sets the access list rate limit flag.
 void setBandwidth(java.lang.Long bandwidth)
          Sets the bandwidth in bits per second.
 void setConformAction(RateLimitAction conformAction)
          Sets the conform action.
 void setDscpValue(java.lang.Integer dscpValue)
          Sets the DSCP value.
 void setExceedAction(RateLimitAction exceedAction)
          Sets the exceed action.
 void setMaxBurst(java.lang.Long maxBurst)
          Sets the maximum burst bytes.
 void setMode(InputOutputEnum mode)
          Sets the rate limit mode.
 void setNormalBurst(java.lang.Long normalBurst)
          Sets the normal burst bytes.
 void setQosGroupId(java.lang.Integer qosGroupId)
          Sets the QOS group Id.
 void validate()
           
 
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT

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

OUTPUT

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

ACCESS_GROUP

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

RATE_LIMIT

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

DSCP

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

QOS_GROUP

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

CONFORM_ACTION

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

EXCEED_ACTION

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

MIN_DSCP

public static final java.lang.Integer MIN_DSCP
The minimum DSCP.


MAX_DSCP

public static final java.lang.Integer MAX_DSCP
The maximum DSCP.


MIN_QOS_GROUP

public static final java.lang.Integer MIN_QOS_GROUP
The minimum QOS group.


MAX_QOS_GROUP

public static final java.lang.Integer MAX_QOS_GROUP
The maximum QOS group.


MIN_MPLS_EXP

public static final java.lang.Integer MIN_MPLS_EXP
The minimum new MPLS experimental.


MAX_MPLS_EXP

public static final java.lang.Integer MAX_MPLS_EXP
The maximum new MPLS experimental.


MIN_PRECEDNECE

public static final java.lang.Integer MIN_PRECEDNECE
The minimum precedence.


MAX_PRECEDENCE

public static final java.lang.Integer MAX_PRECEDENCE
The maximum precedence.


MIN_RATE_LIMIT_ACCESS_LIST_INDEX

public static final java.lang.Integer MIN_RATE_LIMIT_ACCESS_LIST_INDEX
The minimum rate limit precedence access list index.


MAX_RATE_LIMIT_ACCESS_LIST_INDEX

public static final java.lang.Integer MAX_RATE_LIMIT_ACCESS_LIST_INDEX
The maximum rate limit precedence access list index.


MIN_ACCESS_LIST_INDEX

public static final java.lang.Integer MIN_ACCESS_LIST_INDEX
The minimum access list index.


MAX_ACCESS_LIST_INDEX

public static final java.lang.Integer MAX_ACCESS_LIST_INDEX
The maximum access list index.


MIN_BANDWIDTH_BPS

public static final java.lang.Long MIN_BANDWIDTH_BPS
The minimum bandwidth bits per second.


MAX_BANDWIDTH_BPS

public static final java.lang.Long MAX_BANDWIDTH_BPS
The maximum bandwidth bits per second.


MIN_NORMAL_BURST_BYTES

public static final java.lang.Long MIN_NORMAL_BURST_BYTES
The minimum normal burst bytes.


MAX_NORMAL_BURST_BYTES

public static final java.lang.Long MAX_NORMAL_BURST_BYTES
The maximum normal burst bytes.


MIN_MAXIMUM_BURST_BYTES

public static final java.lang.Long MIN_MAXIMUM_BURST_BYTES
The minimum "maximum burst bytes".


MAX_MAXIMUM_BURST_BYTES

public static final java.lang.Long MAX_MAXIMUM_BURST_BYTES
The maximum "maximum burst bytes".

Constructor Detail

RateLimitEntry

public RateLimitEntry()
Constructs an IP route entry.

Method Detail

getMode

public InputOutputEnum getMode()
Gets the rate limit mode.

Returns:
the rate limit mode.

setMode

public void setMode(InputOutputEnum mode)
Sets the rate limit mode. Rate limits can either be for input traffic or output traffic.

Parameters:
mode - the rate limit mode.

getAccessListIndex

public java.lang.Integer getAccessListIndex()
Gets the access list index.

Returns:
the access list index.

setAccessListIndex

public void setAccessListIndex(java.lang.Integer accessListIndex)
Sets the access list index. If set, an access list will be matched.

Parameters:
accessListIndex - the access list index.

getAccessListRateLimitFlag

public boolean getAccessListRateLimitFlag()
Gets the access list rate limit flag.

Returns:
the access list rate limit flag.

setAccessListRateLimitFlag

public void setAccessListRateLimitFlag(boolean accessListRateLimitFlag)
Sets the access list rate limit flag. If true, the access list index will be a rate limit precedence access list. Otherwise, the access list index will be a normal access list. The default is false.

Parameters:
accessListRateLimitFlag - the access list rate limit flag.

getDscpValue

public java.lang.Integer getDscpValue()
Gets the DSCP value.

Returns:
the DSCP value.

setDscpValue

public void setDscpValue(java.lang.Integer dscpValue)
Sets the DSCP value. If set, the DSCP value will be matched.

Parameters:
dscpValue - the DSCP value.

getQosGroupId

public java.lang.Integer getQosGroupId()
Gets the QOS group Id.

Returns:
the QOS group Id.

setQosGroupId

public void setQosGroupId(java.lang.Integer qosGroupId)
Sets the QOS group Id. If set, the QOS group Id will be matched.

Parameters:
qosGroupId - the QOS group Id.

getBandwidth

public java.lang.Long getBandwidth()
Gets the bandwidth in bits per second.

Returns:
the bandwidth.

setBandwidth

public void setBandwidth(java.lang.Long bandwidth)
Sets the bandwidth in bits per second.

Parameters:
bandwidth - the bandwidth.

getNormalBurst

public java.lang.Long getNormalBurst()
Gets the normal burst bytes.

Returns:
the normal burst bytes.

setNormalBurst

public void setNormalBurst(java.lang.Long normalBurst)
Sets the normal burst bytes.

Parameters:
normalBurst - the normal burst bytes.

getMaxBurst

public java.lang.Long getMaxBurst()
Gets the maximum burst bytes.

Returns:
the maximum burst bytes.

setMaxBurst

public void setMaxBurst(java.lang.Long maxBurst)
Sets the maximum burst bytes.

Parameters:
maxBurst - the maximum burst bytes.

getConformAction

public RateLimitAction getConformAction()
Gets the conform action.

Returns:
the conform action.

setConformAction

public void setConformAction(RateLimitAction conformAction)
Sets the conform action.

Parameters:
conformAction - the conform action.

getExceedAction

public RateLimitAction getExceedAction()
Gets the exceed action.

Returns:
the exceed action.

setExceedAction

public void setExceedAction(RateLimitAction exceedAction)
Sets the exceed action.

Parameters:
exceedAction - the exceed action.

buildFromIos

public void buildFromIos(java.lang.String line)
                  throws InvalidConfigurationException
Builds the IP route entry from the passed in IOS line.

Parameters:
line - the IOS line.
Throws:
InvalidConfigurationException - if the configuration is invalid.
See Also:
CiscoRouterConfigComponent.buildFromIos(java.util.List).

getRateLimitAction

protected RateLimitAction getRateLimitAction(java.lang.String line,
                                             java.util.List tokens)
                                      throws InvalidConfigurationException
Gets the rate limit action from the next token(s).

Parameters:
line - the IOS line.
tokens - the list of tokens.
Returns:
a newly created rate limit action.
Throws:
InvalidConfigurationException - if the configuration is invalid.

getRateLimitAction

protected RateLimitAction getRateLimitAction(java.lang.String token)
Gets the rate limit action associated with the passed in token.

Parameters:
token - the rate limit action keyword token.
Returns:
the rate limit action associated with the keyword token or null if one couldn't be found.

getRateLimitActionList

protected java.util.List getRateLimitActionList()
Returns a list of newly instantiated rate limit actions.

Returns:
the list of rate limit actions.

validate

public void validate()
              throws InvalidConfigurationException
Throws:
InvalidConfigurationException - if the route entry is not valid.
See Also:
CiscoRouterConfigComponent

generateIosString

public java.lang.String generateIosString()
                                   throws InvalidConfigurationException
Generates the IOS configuration for this rate limit entry. Validation will be performed.

Returns:
the generated IOS.
Throws:
InvalidConfigurationException - if the configuration is invalid.
See Also:
CiscoRouterConfigComponent

generateDeleteIosString

public java.lang.String generateDeleteIosString()
                                         throws InvalidConfigurationException
Generates the IOS configuration that will delete this rate limit entry.

Returns:
the generated IOS.
Throws:
InvalidConfigurationException - if the configuration is invalid.
See Also:
MultiLineComponent

equals

public boolean equals(java.lang.Object object)
Checks the passed in RateLimitEntry object for equality.

Overrides:
equals in class java.lang.Object
Parameters:
object - the RateLimitEntry object to compare.
Returns:
True if the objects are equal or false if not.
See Also:
Object.equals(Object)

compareTo

public int compareTo(java.lang.Object object)
Compares this object to the passed in RateLimitEntry object.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - the RateLimitEntry object to compare.
Returns:
the comparrison valid.
See Also:
Comparable.compareTo(Object)


Copyright © 2005-2008 Fox Smart, Inc. All Rights Reserved.