public final class InventoryUtils extends Object
InventoryUtils class is a collection of utility class methods
for MD-SAL based inventory management.| Modifier and Type | Method and Description |
|---|---|
static void |
clearPortLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
SalPort sport,
VtnPort vport)
Remove all the VTN links configured in the given VTN port.
|
static org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId |
getLinkId(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path)
Return a MD-SAL inter-switch link ID in the given instance identifier.
|
static long |
getLinkSpeed(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures pf)
Determine the link speed from the current port feature.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId |
getNodeConnectorId(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path)
Return a MD-SAL node connector ID in the given instance identifier.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId |
getNodeId(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path)
Return a MD-SAL node ID in the given instance identifier.
|
static VtnOpenflowVersion |
getOpenflowVersion(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector fcnc)
Estimate the OpenFlow protocol version from the given
NodeConnector instance. |
static VtnOpenflowVersion |
getOpenflowVersion(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx,
SalNode snode)
Return the OpenFlow protocol version used by the specified switch.
|
static VnodeState |
getPortState(VtnPort vport)
Return the state of the given switch port.
|
static VtnOpenflowVersion |
getVtnPorts(List<VtnPort> list,
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node)
Return a list of VTN ports associated with the switch ports in the
given MD-SAL node.
|
static boolean |
hasEdgePort(VtnNode vnode)
Determine whether the given node has at least one edge port in up state
or not.
|
static boolean |
hasPortLink(VtnPort vport)
Determine whether the given VTN port has at least one inter-switch link
or not.
|
static boolean |
isEdge(VtnPort vport)
Determine whether the given VTN port is an edge port or not.
|
static boolean |
isEnabled(VtnPort vport)
Determine whether the given VTN port is enabled or not.
|
static boolean |
isEnabledEdge(VtnPort vport)
Determine whether the given VTN port is an enabled edge port or not.
|
static void |
removeIgnoredLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
SalNode snode)
Remove all VTN links in ignored-links affected by the removed VTN node.
|
static void |
removePortLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
SalPort sport,
org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid)
Remove the specified port link.
|
static void |
removeVtnLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
SalNode snode)
Remove all VTN links affected by the the removed VTN node.
|
static void |
removeVtnLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
VtnPort vport)
Remove all VTN links affected by the removed VTN port.
|
static void |
removeVtnTopologyLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
SalNode snode)
Remove all VTN links in vtn-topology affected by the removed VTN node.
|
static IgnoredLinkBuilder |
toIgnoredLinkBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid,
SalPort src,
SalPort dst)
Create an ignored link builder associated with the given inter-switch
link.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<IgnoredLink> |
toIgnoredLinkIdentifier(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid)
Convert a given topology link ID into an instance identifier of
ignored inter-switch link.
|
static PortLinkBuilder |
toPortLinkBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid,
SalPort peer)
Create a port link builder associated with the given inter-switch
link.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<StaticEdgePort> |
toStaticEdgePortIdentifier(SalPort sport)
Convert the given switch port ID into an instance identifier for a
static edge port.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<StaticSwitchLink> |
toStaticSwitchLinkIdentifier(SalPort sport)
Convert the given switch port ID into an instance identifier for a
static inter-switch link.
|
static String |
toString(VtnLink vlink)
Return a string representation of the given VTN link information.
|
static String |
toString(VtnPort vport)
Return a string representation of the given VTN port.
|
static String |
toString(VtnSwitchLink vslink)
Return a string representation of the given link information.
|
static VtnLinkBuilder |
toVtnLinkBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid,
SalPort src,
SalPort dst)
Create a VTN link builder associated with the given inter-switch link.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnLink> |
toVtnLinkIdentifier(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid)
Convert a given topology link ID into an instance identifier of
VTN topology link.
|
static VtnNodeBuilder |
toVtnNodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node)
Create a VTN node builder associated with the given MD-SAL node.
|
static VtnNodeBuilder |
toVtnNodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nid)
Create a VTN node builder associated with the given MD-SAL node ID.
|
static VtnPortBuilder |
toVtnPortBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId ncid,
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector fcnc)
Create a VTN port builder associated with the given MD-SAL node
connector ID.
|
public static boolean hasPortLink(VtnPort vport)
vport - A VtnPort instance.true only if the given port has at least one
inter-switch link.public static boolean isEdge(VtnPort vport)
vport - A VtnPort instance.true only if the given port is an edge port.public static boolean isEnabled(VtnPort vport)
vport - A VtnPort instance.true only if the given port is enabled.public static boolean isEnabledEdge(VtnPort vport)
vport - A VtnPort instance.true only if the given port is an enabled edge port.public static boolean hasEdgePort(VtnNode vnode)
vnode - A VtnNode instance.true is returned if the given node has at least one
edge port in up state. Otherwise false is returned.public static VnodeState getPortState(VtnPort vport)
vport - A VtnPort instance.VnodeState instance which represents the state of
the given switch port.public static String toString(VtnPort vport)
vport - A VtnPort instance.public static String toString(VtnSwitchLink vslink)
vslink - A VtnSwitchLink instance.public static String toString(VtnLink vlink)
vlink - A VtnLink instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnLink> toVtnLinkIdentifier(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid)
lid - A topology link ID.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<IgnoredLink> toIgnoredLinkIdentifier(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid)
lid - A topology link ID.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<StaticSwitchLink> toStaticSwitchLinkIdentifier(SalPort sport)
sport - A SalPort instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<StaticEdgePort> toStaticEdgePortIdentifier(SalPort sport)
sport - A SalPort instance.public static VtnNodeBuilder toVtnNodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node)
node - A MD-SAL node.public static VtnNodeBuilder toVtnNodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nid)
nid - A MD-SAL node ID.public static VtnPortBuilder toVtnPortBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId ncid, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector fcnc)
ncid - A MD-SAL node connector ID.fcnc - A FlowCapableNodeConnector instance.public static VtnLinkBuilder toVtnLinkBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid, SalPort src, SalPort dst)
public static IgnoredLinkBuilder toIgnoredLinkBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid, SalPort src, SalPort dst)
public static PortLinkBuilder toPortLinkBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid, SalPort peer)
lid - A LinkId instance which represents an inter-switch
link ID.peer - A SalPort instance which represents the peer of
the inter-switch link.public static VtnOpenflowVersion getVtnPorts(List<VtnPort> list, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node node)
list - A list of VtnPort to store results.node - A MD-SAL node.null is returned if no port is created.public static VtnOpenflowVersion getOpenflowVersion(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector fcnc)
NodeConnector instance.fcnc - A FlowCapableNodeConnector instance.public static VtnOpenflowVersion getOpenflowVersion(org.opendaylight.controller.md.sal.binding.api.ReadTransaction rtx, SalNode snode) throws VTNException
rtx - A read-only MD-SAL datastore transaction.snode - A SalNode instance that specifies the target
switch.VtnOpenflowVersion instance on success.
null if the specified switch is not present or
the protocol version is not yet determined.VTNException - An error occurred.public static long getLinkSpeed(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortFeatures pf)
pf - A PortFeatures instance.public static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId getNodeId(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path)
path - An InstanceIdentifier instance.null if not found.public static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId getNodeConnectorId(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path)
path - An InstanceIdentifier instance.null if not found.public static org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId getLinkId(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> path)
path - An InstanceIdentifier instance.null if not found.public static void removeVtnLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
SalNode snode)
throws VTNException
tx - A ReadWriteTransaction instance.snode - A SalNode instance corresponding to the removed
VTN node.VTNException - An error occurred.public static void removeVtnTopologyLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
SalNode snode)
throws VTNException
tx - A ReadWriteTransaction instance.snode - A SalNode instance corresponding to the removed
VTN node.VTNException - An error occurred.public static void removeIgnoredLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
SalNode snode)
throws VTNException
tx - A ReadWriteTransaction instance.snode - A SalNode instance corresponding to the removed
VTN node.VTNException - An error occurred.public static void removeVtnLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
VtnPort vport)
throws VTNException
Note that this method does not remove port links configured in the given VTN port.
tx - A ReadWriteTransaction instance.vport - A VtnPort instance corresponding to the removed
VTN port.VTNException - An error occurred.public static void removePortLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
SalPort sport,
org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.LinkId lid)
throws VTNException
tx - A ReadWriteTransaction instance.sport - A SalPort instance corresponding to a VTN port.lid - A LinkId that specifies inter-switch link to be
removed.VTNException - An error occurred.public static void clearPortLink(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
SalPort sport,
VtnPort vport)
throws VTNException
tx - A ReadWriteTransaction instance.sport - A SalPort instance which specifies the target
VTN port.vport - A VtnPort instance associated with sport.VTNException - An error occurred.Copyright © 2018 OpenDaylight. All rights reserved.