public final class InventoryReader extends Object
Note that this class is not synchronized.
| Constructor and Description |
|---|
InventoryReader(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
collectUpEdgePorts(Set<SalPort> portSet)
Collect node connectors associated with edge switch ports in up state.
|
void |
collectUpEdgePorts(Set<SalPort> portSet,
PortFilter filter)
Collect node connectors associated with edge switch ports in up state.
|
boolean |
exists(SalNode snode)
Determine whether the given node is present or not.
|
SalPort |
findPort(SalNode snode,
VtnSwitchPort vswp)
Find a
SalPort instance that meets the specified condition. |
VtnNode |
get(SalNode snode)
Return the VTN node information specified by the given
SalNode
instance. |
VtnPort |
get(SalPort sport)
Return the VTN port information specified by the given
SalPort
instance. |
org.opendaylight.controller.md.sal.binding.api.ReadTransaction |
getReadTransaction()
Return read transaction.
|
Set<SalPort> |
getReverseStaticLinks(SalPort dst)
Search for static inter-switch link configurations by the destination
port of the link.
|
SalPort |
getStaticLink(SalPort src)
Search for a static inter-switch link configuration by the source port
of the link.
|
List<VtnNode> |
getVtnNodes()
Return all node information as a list.
|
boolean |
isEnabled(SalPort sport)
Determine whether the given port is enabled or not.
|
boolean |
isStaticEdgePort(SalPort sport)
Determine whether the given switch port is configured as an edge port
or not.
|
void |
prefetch(Collection<VtnPort> vports)
Put all VTN port information in the given collection into the VTN port
cache.
|
void |
prefetch(SalNode snode,
VtnNode vnode)
Put the given VTN node information into the cache.
|
void |
prefetch(SalPort sport,
VtnPort vport)
Put the given VTN port information into the VTN port cache.
|
void |
prefetch(VtnPort vport)
Put the given VTN port information into the VTN port cache.
|
void |
prefetch(VtnStaticTopology vstopo)
Put the given VTN static network topology information into the
static network topology cache.
|
void |
purge(SalPort sport)
Purge the cached information about the given VTN port.
|
public InventoryReader(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx)
rtx - A ReadTransaction instance.public org.opendaylight.controller.md.sal.binding.api.ReadTransaction getReadTransaction()
ReadTransaction instance.public VtnNode get(SalNode snode) throws VTNException
SalNode
instance.snode - A SalNode instance which specifies the VTN node
information.VtnNode instance if present.
null if not present.VTNException - Failed to read VTN node information.public VtnPort get(SalPort sport) throws VTNException
SalPort
instance.sport - A SalPort instance which specifies the VTN port
information.VtnPort instance if present.
null if not present.VTNException - Failed to read VTN port information.public void prefetch(SalNode snode, VtnNode vnode)
public void prefetch(Collection<VtnPort> vports)
vports - A collection of VtnPort instances.public void prefetch(VtnPort vport)
vport - A VtnPort instance.public void prefetch(SalPort sport, VtnPort vport)
public void prefetch(VtnStaticTopology vstopo)
vstopo - A VtnStaticTopology instance or null.public List<VtnNode> getVtnNodes() throws VTNException
VtnNode instances.VTNException - An error occurred.public boolean exists(SalNode snode) throws VTNException
snode - A SalNode instance.true if the given node is present.
Otherwise false.VTNException - An error occurred.public boolean isEnabled(SalPort sport) throws VTNException
sport - A SalPort instance.true if the given port is enabled.
Otherwise false.VTNException - An error occurred.public SalPort findPort(SalNode snode, VtnSwitchPort vswp) throws VTNException
SalPort instance that meets the specified condition.snode - A SalNode instance corresponding to a physical
switch.vswp - A VtnSwitchPort instance which specifies the
condition to select switch port.SalPort instance if found.
null is returned if not found.VTNException - An error occurred.public void collectUpEdgePorts(Set<SalPort> portSet) throws VTNException
portSet - A set of SalPort instances to store
results.VTNException - An error occurred.public void collectUpEdgePorts(Set<SalPort> portSet, PortFilter filter) throws VTNException
Switch ports to be collected can be selected by specifying
PortFilter instance to filter.
If a PortFilter instance is specified, this method collects
switch ports accepted by
PortFilter.accept(SalPort, VtnPort).
portSet - A set of SalPort instances to store results.filter - A PortFilter instance which filters switch port.
All switch ports are stored to portSet if
null is specified.VTNException - An error occurred.public SalPort getStaticLink(SalPort src) throws VTNException
Note that a static inter-switch link is ignored if source or destination port of that link is configured as a static edge port.
src - A SalPort instance which specifies the source port
of the link.SalPort which specifies the destination port of the
link if found. null if not found.VTNException - Failed to reead static inter-switch link configuration.public Set<SalPort> getReverseStaticLinks(SalPort dst) throws VTNException
dst - A SalPort instance which specifies the destination
port of the link.Set which contains source ports of the links.
Note that an empty set is returned if no static inter-switch
link configuration is present.VTNException - Failed to reead static inter-switch link configuration.public boolean isStaticEdgePort(SalPort sport) throws VTNException
sport - A SalPort instance which specifies the switch
port.true if the given port should be treated as an edge
port. Otherwise false.VTNException - Failed to reead static edge port configuration.Copyright © 2018 OpenDaylight. All rights reserved.