|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.foxsmart.csu.config.CiscoRouterConfigParser
com.foxsmart.csu.config.CiscoRouterConfigComponent
com.foxsmart.csu.config.global.IpRouteComponent
public class IpRouteComponent
The IpRouteComponent class represents all the ip routes defined on the router.
| Field Summary | |
|---|---|
static java.lang.String |
IP
|
static java.lang.String |
PROFILE
|
static java.lang.String |
ROUTE
|
| 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 | |
|---|---|
IpRouteComponent()
Constructs an IP route component object. |
|
| Method Summary | |
|---|---|
void |
addRoute(IpRouteEntry ipRouteEntry)
Adds a route. |
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. |
void |
clearAllRoutes()
Clears all of the routes. |
void |
clearRoutes(IpAddress destinationPrefix,
IpAddress destinationPrefixMask)
Clears the list of IpRouteEntry objects for the specified destination prefix and destination prefix mask. |
Commands |
generateDeleteIos(CiscoRouterConfig updatedCiscoRouterConfig)
Generates the IOS configuration commands to delete this component. |
Commands |
generateIos()
Returns the IOS configuration commands for this component. |
protected Commands |
generateMultiLineUpdateConfiglet(CiscoRouterConfigComponent origComponent)
Generates the IOS commands that will handle the updating of a multi-line component. |
protected boolean |
getAreRoutesSame(java.util.List routeList,
java.util.List origRouteList)
Determines whether the routes from both lists are the same |
protected java.lang.String |
getDestinationKey(IpAddress destinationPrefix,
IpAddress destinationPrefixMask)
Returns a string that is used as the key into the route map. |
protected java.lang.String |
getDestinationKey(IpRouteEntry ipRouteEntry)
Returns a string that is used as the key into the route map. |
java.util.List |
getInterfaceTypesAndNames(CiscoRouterConfig ciscoRouterConfig)
Gets a list of interface type and names list (e.g. |
boolean |
getProfileFlag()
Gets whether the IP routing table profile is enabled or not. |
IpRouteEntry |
getRoute(IpAddress destinationPrefix,
IpAddress destinationPrefixMask)
Returns the first IpRouteEntry object based on the specified destination prefix and destination prefix mask. |
java.util.List |
getRoutes()
Returns a list of all IpRouteEntry objects that have been added. |
java.util.List |
getRoutes(IpAddress destinationPrefix,
IpAddress destinationPrefixMask)
Returns a list of IpRouteEntry objects that have been added based on the specified destination prefix and destination prefix mask. |
protected java.util.List |
getRoutesToDelete(java.util.List routeList,
java.util.List interfaceTypeAndNamesList)
Gets the routes to delete by filtering the route list to only contain routes that are associated with a valid interface that is still defined (i.e. |
java.util.List |
getSortedRoutes()
Returns a sorted list of all the IpRouteEntry objects that have been added. |
boolean |
removeRoute(IpRouteEntry ipRouteEntry)
Removes a previously added route. |
void |
setProfileFlag(boolean profileFlag)
Sets whether the IP routing table profile is enabled or not. |
void |
validate()
Validates this object to ensure it contains a valid IOS configuration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String IP
public static final java.lang.String ROUTE
public static final java.lang.String PROFILE
| Constructor Detail |
|---|
public IpRouteComponent()
| Method Detail |
|---|
public void addRoute(IpRouteEntry ipRouteEntry)
throws InvalidConfigurationException
ipRouteEntry - The route to add.
InvalidConfigurationException - if the IP route entry doesn't have a valid
destination set.public java.util.List getRoutes()
public java.util.List getSortedRoutes()
public java.util.List getRoutes(IpAddress destinationPrefix,
IpAddress destinationPrefixMask)
destinationPrefix - the destination prefix.destinationPrefixMask - the destination prefix mask.
public IpRouteEntry getRoute(IpAddress destinationPrefix,
IpAddress destinationPrefixMask)
destinationPrefix - the destination prefix.destinationPrefixMask - the destination prefix mask.
public void clearRoutes(IpAddress destinationPrefix,
IpAddress destinationPrefixMask)
destinationPrefix - the destination prefix.destinationPrefixMask - the destination prefix mask.public void clearAllRoutes()
public boolean removeRoute(IpRouteEntry ipRouteEntry)
throws InvalidConfigurationException
ipRouteEntry - The route to remove.
InvalidConfigurationException - if the IP route entry doesn't have a valid
destination set.List.remove(Object).protected java.lang.String getDestinationKey(IpRouteEntry ipRouteEntry)
ipRouteEntry - the IP route entry.
getDestinationKey(com.foxsmart.ic.net.IpAddress,com.foxsmart.ic.net.IpAddress).
protected java.lang.String getDestinationKey(IpAddress destinationPrefix,
IpAddress destinationPrefixMask)
destinationPrefix - the destination prefix.destinationPrefixMask - the destination prefix mask.
public boolean getProfileFlag()
public void setProfileFlag(boolean profileFlag)
profileFlag - If true, the profile is enabled. If false, the profile is not enabled.
public java.util.List buildFromIos(java.util.List configLines)
throws InvalidConfigurationException
CiscoRouterConfigComponent
buildFromIos in class CiscoRouterConfigComponentconfigLines - The list of IOS configuration lines.
InvalidConfigurationException - if the IOS configuration can not be parsed for any reason.CiscoRouterConfigComponent
public void validate()
throws InvalidConfigurationException
CiscoRouterConfigComponent
validate in class CiscoRouterConfigComponentInvalidConfigurationException - if the configuration is invalid.CiscoRouterConfigComponent
public Commands generateIos()
throws InvalidConfigurationException
CiscoRouterConfigComponent
generateIos in class CiscoRouterConfigComponentInvalidConfigurationException - 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.CiscoRouterConfigComponent
public Commands generateDeleteIos(CiscoRouterConfig updatedCiscoRouterConfig)
throws InvalidConfigurationException
CiscoRouterConfigComponent
generateDeleteIos in interface MultiLineComponentgenerateDeleteIos in class CiscoRouterConfigComponentupdatedCiscoRouterConfig - the updated Cisco router configuration.
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.MultiLineComponent
protected Commands generateMultiLineUpdateConfiglet(CiscoRouterConfigComponent origComponent)
throws InvalidConfigurationException
CiscoRouterConfigComponent
generateMultiLineUpdateConfiglet in class CiscoRouterConfigComponentorigComponent - The original component.
InvalidConfigurationException - if either this or the passed in configuration are invalid.CiscoRouterConfigComponent
protected java.util.List getRoutesToDelete(java.util.List routeList,
java.util.List interfaceTypeAndNamesList)
routeList - The route list to filterinterfaceTypeAndNamesList - the list of interface type and names.
public java.util.List getInterfaceTypesAndNames(CiscoRouterConfig ciscoRouterConfig)
ciscoRouterConfig - the router configuration to get the interface types and names from.
protected boolean getAreRoutesSame(java.util.List routeList,
java.util.List origRouteList)
routeList - the route list.origRouteList - the original route list.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||