public class SwitchRoute extends Link<OVXPort,PhysicalSwitch> implements Persistable
| Modifier and Type | Field and Description |
|---|---|
static String |
DB_KEY
Database keyword for switch routes.
|
| Constructor and Description |
|---|
SwitchRoute(OVXSwitch sw,
OVXPort in,
OVXPort out,
int routeid,
byte priority)
Instantiates a new switch route for the given switch between
two ports, and assigns a route ID and priority value.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBackupRoute(Byte priority,
List<PhysicalLink> physicalLinks)
Adds a backup route with given priority value and path given as
list of physical links.
|
void |
generateRouteFMs(OVXFlowMod fm)
Generates and installs all flow mods needed to bring up switch route,
base an a given controller-generated flow mod.
|
Map<String,Object> |
getDBIndex() |
String |
getDBKey() |
String |
getDBName() |
Map<String,Object> |
getDBObject() |
PhysicalSwitch |
getDstSwitch()
Gets the destination switch of the link.
|
Set<PhysicalLink> |
getLinks()
Gets the set of physical links that make up both primary and backup paths for the switch route.
|
PhysicalPort |
getPathDstPort() |
PhysicalPort |
getPathSrcPort() |
byte |
getPriority()
Gets the priority value.
|
int |
getRouteId() |
PhysicalSwitch |
getSrcSwitch()
Gets the source switch of the link.
|
long |
getSwitchId() |
Integer |
getTenantId()
Returns unique the tenant ID of the switch route.
|
void |
register()
Registers switch route in persistent storage.
|
void |
replacePrimaryRoute(Byte priority,
List<PhysicalLink> physicalLinks)
Replaces the current primary route by the new route given as
a list of physical links and priority value.
|
void |
setPathDstPort(PhysicalPort end)
Sets the egress port of the switch route to the given
physical port.
|
void |
setPathSrcPort(PhysicalPort start)
Sets the ingress port of the switch route to the given
physical port.
|
void |
setPriority(byte priority)
Sets the priority value of the switch route.
|
void |
setRouteId(int routeid)
Sets the switch-unique identifier of this route.
|
void |
switchPath(List<PhysicalLink> physicalLinks,
byte priority)
Switches over to the next backup path given as a list of physical links
with the given priority.
|
String |
toString() |
boolean |
tryRecovery(PhysicalLink plink)
Tries to switch this route to a backup path, and updates mappings to
"correct" string of PhysicalLinks to use for this SwitchRoute.
|
boolean |
tryRevert(PhysicalLink plink)
Attempts to switch this route back to the original path.
|
void |
unregister()
Removes mappings and dependencies related to this link.
|
equals, getDstPort, getMetric, getSrcPort, hashCodepublic static final String DB_KEY
public SwitchRoute(OVXSwitch sw, OVXPort in, OVXPort out, int routeid, byte priority)
sw - the virtual switchin - the ingress portout - the egress portrouteid - the route IDpriority - the priority valuepublic void setRouteId(int routeid)
routeid - the route IDpublic int getRouteId()
public byte getPriority()
public void setPriority(byte priority)
priority - the priority valuepublic long getSwitchId()
public Integer getTenantId()
public void setPathSrcPort(PhysicalPort start)
start - the source physical portpublic PhysicalPort getPathSrcPort()
public void setPathDstPort(PhysicalPort end)
end - the destination physical portpublic PhysicalPort getPathDstPort()
public void addBackupRoute(Byte priority, List<PhysicalLink> physicalLinks)
priority - the priority valuephysicalLinks - the backup routepublic void replacePrimaryRoute(Byte priority, List<PhysicalLink> physicalLinks)
priority - the priority valuephysicalLinks - the new routepublic String toString()
toString in class Link<OVXPort,PhysicalSwitch>public PhysicalSwitch getSrcSwitch()
LinkgetSrcSwitch in class Link<OVXPort,PhysicalSwitch>public PhysicalSwitch getDstSwitch()
LinkgetDstSwitch in class Link<OVXPort,PhysicalSwitch>public void switchPath(List<PhysicalLink> physicalLinks, byte priority)
physicalLinks - the new pathpriority - the priority of the new pathpublic void generateRouteFMs(OVXFlowMod fm)
fm - the virtual flow modpublic void register()
public void unregister()
Linkunregister in class Link<OVXPort,PhysicalSwitch>public Map<String,Object> getDBIndex()
getDBIndex in interface PersistablegetDBIndex in class Link<OVXPort,PhysicalSwitch>public String getDBKey()
getDBKey in interface PersistablegetDBKey in class Link<OVXPort,PhysicalSwitch>public String getDBName()
getDBName in interface PersistablegetDBName in class Link<OVXPort,PhysicalSwitch>public Map<String,Object> getDBObject()
getDBObject in interface PersistablegetDBObject in class Link<OVXPort,PhysicalSwitch>public boolean tryRecovery(PhysicalLink plink)
plink - the failed PhysicalLinkpublic Set<PhysicalLink> getLinks()
public boolean tryRevert(PhysicalLink plink)
plink - physical link that was restoredCopyright © 2015. All rights reserved.