public final class OVXMap extends Object implements Mappable
| Modifier and Type | Method and Description |
|---|---|
void |
addIP(PhysicalIPAddress physicalIP,
OVXIPAddress virtualIP)
This is the generic function which takes as arguments the
PhysicalIPAddress and the OVXIPAddress.
|
void |
addLinks(List<PhysicalLink> physicalLinks,
OVXLink virtualLink)
Creates the mapping between PhysicalLinks and a VirtualLink.
|
void |
addMAC(MACAddress mac,
Integer tenantId)
Creates the maping between the MAC address and tenant ID.
|
void |
addNetwork(OVXNetwork virtualNetwork)
Maintain a list of all the virtualNetworks in the system indexed by the
tenant id mapping to OVXNetworks.
|
void |
addRoute(SwitchRoute route,
List<PhysicalLink> physicalLinks)
Adds a mapping between a SwitchRoute and the PhysicalLinks making it up.
|
void |
addSwitches(List<PhysicalSwitch> physicalSwitches,
OVXSwitch virtualSwitch)
Creates the mapping between PhysicalSwithes and a VirtualSwitch.
|
Iterable<CharSequence> |
getAllKeys() |
static OVXMap |
getInstance()
Gets the instance of the class and if this already exists
then the existing object will be returned.
|
Integer |
getMAC(MACAddress mac)
Gets the tenant ID associated with the given MAC address.
|
PhysicalIPAddress |
getPhysicalIP(OVXIPAddress ip,
Integer tenantId) |
List<PhysicalLink> |
getPhysicalLinks(OVXLink virtualLink)
Gets the physicalLinks that all make up a specified OVXLink.
|
List<PhysicalSwitch> |
getPhysicalSwitches(OVXSwitch virtualSwitch)
Gets the physical switches that are contained in the OVXSwitch.
|
List<PhysicalLink> |
getRoute(SwitchRoute route)
Gets the current path as a list of physical links for the given route.
|
Set<SwitchRoute> |
getSwitchRoutes(PhysicalLink physicalLink,
Integer tenantId)
Gets the switch routes that use the given physical link in
the specified virtual network.
|
OVXIPAddress |
getVirtualIP(PhysicalIPAddress ip) |
List<OVXLink> |
getVirtualLinks(PhysicalLink physicalLink,
Integer tenantId)
Gets the list of OVXLinks that are part of virtual network identified by
tenantId and which include the specified physicalLink.
|
OVXNetwork |
getVirtualNetwork(Integer tenantId)
Gets the virtual network instance based on the tenant ID.
|
OVXSwitch |
getVirtualSwitch(PhysicalSwitch physicalSwitch,
Integer tenantId)
Gets the OVXSwitch which has been specified by the physicalSwitch and
tenantId.
|
boolean |
hasMAC(MACAddress mac)
Checks if the given MAC address is registered in the map.
|
boolean |
hasOVXLinks(PhysicalLink physicalLink,
Integer tenantId)
Checks if the given physical link is part of a virtual link in the
virtual network identified by the tenant ID.
|
boolean |
hasPhysicalIP(OVXIPAddress vip,
Integer tenantId)
Checks if the given virtual IP address is mapped to a physical IP
in the virtual network identified by the tenant ID.
|
boolean |
hasSwitchRoutes(PhysicalLink physicalLink,
Integer tenantId)
Checks if the given physical link is part of a virtual switch route
in the virtual network identified by the tenant ID.
|
boolean |
hasVirtualIP(PhysicalIPAddress ip) |
boolean |
hasVirtualSwitch(PhysicalSwitch physicalSwitch,
int tenantId) |
void |
knownLink(PhysicalLink that)
Sets the linkid back to the original linkid for a physical link that
previously existed and has gone away and come back.
|
Map<Integer,OVXNetwork> |
listVirtualNetworks()
Obtains an immutable copy of the list of virtual networks.
|
void |
removeMAC(MACAddress mac)
Removes MAC address from the map.
|
void |
removeNetwork(OVXNetwork network)
Removes the virtual network from the map.
|
void |
removePhysicalLink(PhysicalLink physicalLink)
Removes a PhysicalLink from a Mappable, including mappings to OVXLinks
and SwitchRoutes.
|
void |
removePhysicalSwitch(PhysicalSwitch physicalSwitch)
Removes a PhysicalSwitch from Mappable mappings.
|
void |
removeRoute(SwitchRoute route)
Removes a SwitchRoute from the map.
|
void |
removeVirtualIPs(int tenantId)
Delete all the IPs associated to a single virtual network.
|
void |
removeVirtualLink(OVXLink virtualLink)
Removes the virtual link from the map.
|
void |
removeVirtualSwitch(OVXSwitch virtualSwitch)
Delete the OVXSwitch object.
|
static void |
reset()
Resets the map instance.
|
public static OVXMap getInstance()
public static void reset()
public void addSwitches(List<PhysicalSwitch> physicalSwitches, OVXSwitch virtualSwitch)
addSwitches in interface MappablephysicalSwitches - the list of physical switchesvirtualSwitch - the virtual switchpublic void addLinks(List<PhysicalLink> physicalLinks, OVXLink virtualLink)
public Iterable<CharSequence> getAllKeys()
public void addIP(PhysicalIPAddress physicalIP, OVXIPAddress virtualIP)
public void addNetwork(OVXNetwork virtualNetwork)
addNetwork in interface MappablevirtualNetwork - An OVXNetwork object which keeps track of all the elements in
the Virtual networkpublic void addMAC(MACAddress mac, Integer tenantId)
Mappablepublic void addRoute(SwitchRoute route, List<PhysicalLink> physicalLinks)
Mappablepublic PhysicalIPAddress getPhysicalIP(OVXIPAddress ip, Integer tenantId) throws AddressMappingException
getPhysicalIP in interface MappableAddressMappingExceptionpublic OVXIPAddress getVirtualIP(PhysicalIPAddress ip) throws AddressMappingException
getVirtualIP in interface MappableAddressMappingExceptionpublic OVXSwitch getVirtualSwitch(PhysicalSwitch physicalSwitch, Integer tenantId) throws SwitchMappingException
getVirtualSwitch in interface MappablephysicalSwitch - A PhysicalSwitch object is a single switch in the
PhysicalNetworktenantId - the tenant IDSwitchMappingException - if the physical switch is invalidpublic List<OVXLink> getVirtualLinks(PhysicalLink physicalLink, Integer tenantId) throws LinkMappingException
getVirtualLinks in interface MappablephysicalLink - A PhysicalLink object which represent a single source and
destination PhysicalPort and PhysicalSwitchtenantId - the tenant IDLinkMappingException - if the physical link is invalidpublic List<PhysicalLink> getPhysicalLinks(OVXLink virtualLink) throws LinkMappingException
getPhysicalLinks in interface MappablevirtualLink - An OVXLink object which represents a single link in the
OVXNetworkLinkMappingException - if the virtual link is invalidpublic List<PhysicalSwitch> getPhysicalSwitches(OVXSwitch virtualSwitch) throws SwitchMappingException
getPhysicalSwitches in interface MappablevirtualSwitch - A OVXSwitch object representing a single switch in the virtual
networkSwitchMappingException - if the virtual switch is invalidpublic OVXNetwork getVirtualNetwork(Integer tenantId) throws NetworkMappingException
getVirtualNetwork in interface MappabletenantId - This is an Integer that represents a unique number for each
virtualNetworkNetworkMappingException - if the tenant ID is invalidpublic Integer getMAC(MACAddress mac) throws AddressMappingException
MappablegetMAC in interface Mappablemac - the MAC addressAddressMappingExceptionpublic Map<Integer,OVXNetwork> listVirtualNetworks()
MappablelistVirtualNetworks in interface Mappablepublic void removeNetwork(OVXNetwork network)
removeNetwork in interface Mappablenetwork - the virtual network instancepublic void removeVirtualLink(OVXLink virtualLink)
removeVirtualLink in interface MappablevirtualLink - the virtual linkpublic void removePhysicalLink(PhysicalLink physicalLink)
MappableremovePhysicalLink in interface MappablephysicalLink - the physical linkpublic void removeVirtualSwitch(OVXSwitch virtualSwitch)
MappableremoveVirtualSwitch in interface Mappablepublic void removeVirtualIPs(int tenantId)
MappableremoveVirtualIPs in interface MappabletenantId - This is an Integer that represents a unique number for each
virtualNetworkpublic void removeMAC(MACAddress mac)
public List<PhysicalLink> getRoute(SwitchRoute route) throws LinkMappingException
MappablegetRoute in interface Mappableroute - the switch routeLinkMappingExceptionpublic Set<SwitchRoute> getSwitchRoutes(PhysicalLink physicalLink, Integer tenantId) throws LinkMappingException
MappablegetSwitchRoutes in interface MappablephysicalLink - the physical linktenantId - the tenant IDLinkMappingExceptionpublic void removeRoute(SwitchRoute route)
MappableremoveRoute in interface Mappableroute - the switch routepublic void removePhysicalSwitch(PhysicalSwitch physicalSwitch)
MappableremovePhysicalSwitch in interface MappablephysicalSwitch - the physical switchpublic boolean hasPhysicalIP(OVXIPAddress vip, Integer tenantId)
hasPhysicalIP in interface Mappablevip - the virtual IP addresstenantId - the tenant IDpublic boolean hasVirtualIP(PhysicalIPAddress ip)
hasVirtualIP in interface Mappableip - The physical IP addresspublic boolean hasMAC(MACAddress mac)
public boolean hasSwitchRoutes(PhysicalLink physicalLink, Integer tenantId)
hasSwitchRoutes in interface MappablephysicalLink - the physical linktenantId - the tenant Idpublic boolean hasOVXLinks(PhysicalLink physicalLink, Integer tenantId)
hasOVXLinks in interface MappablephysicalLink - the physical linktenantId - the tenant IDpublic boolean hasVirtualSwitch(PhysicalSwitch physicalSwitch, int tenantId)
hasVirtualSwitch in interface MappablephysicalSwitch - the PhysicalSwitch mapped to the OVXSwitch we want to check
fortenantId - TenantID of OVXSwitchpublic void knownLink(PhysicalLink that)
MappableCopyright © 2015. All rights reserved.