public final class FlowUtils extends Object
FlowUtils class is a collection of utility class methods for
flow entry management.| Modifier and Type | Field and Description |
|---|---|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie |
COOKIE_MASK_ALL
A flow cookie mask that specifies all bits in the cookie.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie |
COOKIE_MASK_VTN
A flow cookie mask that specifies the
COOKIE_MASKVAL_VTN bits. |
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie |
COOKIE_MISS
A fixed flow cookie for a table miss flow entry.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie |
COOKIE_VTN
A flow cookie that specifies cookie bits for VTN flows.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match |
EMPTY_MATCH
A MD-SAL flow match that matches every packets.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags |
FLOW_MOD_FLAGS
Flags for FLOW_MOD message that contains only SEND_FLOW_REM flag.
|
static long |
MAX_FLOW_ID
The maximum value of the VTN flow ID.
|
static long |
MIN_FLOW_ID
The minimum value of the VTN flow ID.
|
static short |
TABLE_ID
Flow Table ID to install flow entries.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
compare(org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.Duration d1,
org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.Duration d2)
Compare the given two
Duration instances. |
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput |
createAddFlowInput(VtnFlowId flowId,
VtnFlowEntry vfent)
Construct an RPC input to install the specified flow entry.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie |
createCookie(VtnFlowId fid)
Create a flow cookie from the given VTN flow ID.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId |
createMdFlowId(BigInteger id)
Create a MD-SAL flow ID to be associated with the ingress flow entry
in a VTN data flow.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId |
createMdFlowId(BigInteger id,
Integer index)
Create a MD-SAL flow ID to be associated with a flow entry in a
VTN data flow.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder |
createRemoveFlowInputBuilder(SalNode snode)
Construct an RPC input builder to uninstall all the VTN flow entries
from the given switch.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder |
createRemoveFlowInputBuilder(SalNode snode,
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow flow,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri uri)
Construct an RPC input builder to uninstall the specified MD-SAL flow
entry.
|
static List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder> |
createRemoveFlowInputBuilder(SalNode snode,
SalPort sport)
Construct an RPC input builder to uninstall flow entries related to the
given switch port.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder |
createRemoveFlowInputBuilder(SalNode snode,
VtnFlowEntry vfent)
Construct an RPC input builder to uninstall the specified flow entry.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder |
createRemoveFlowInputBuilder(SalNode snode,
VtnFlowEntry vfent,
InventoryReader reader)
Construct an RPC input builder to uninstall the specified flow entry.
|
static String |
createTableMissFlowId(SalNode snode)
Create a MD-SAL flow ID to be associated with a table miss flow entry.
|
static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput |
createTableMissInput(SalNode snode)
Construct an RPC input to install a table miss flow entry for the
specified switch.
|
static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri |
createTxUri(VtnFlowEntry vfent,
String prefix)
Create a MD-SAL transaction URI for the given flow entryu.
|
static boolean |
equalsFlowTimeoutConfig(VtnFlowTimeoutConfig vftc1,
VtnFlowTimeoutConfig vftc2)
Determine whether the given two
VtnFlowTimeoutConfig instances
contain the same configuration or not. |
static List<VtnFlowTable> |
getFlowTables(org.opendaylight.controller.md.sal.binding.api.ReadTransaction tx)
Return a list of all existing VTN flow tables.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnFlowTable> |
getIdentifier(String name)
Create the instance identifier for the VTN flow table.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<MatchFlows> |
getIdentifier(String name,
MatchFlowsKey cond)
Create the instance identifier for the flow index for the given
flow match condition.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<PortFlows> |
getIdentifier(String name,
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId portId)
Create the instance identifier for the flow index for the given switch
port.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<NodeFlows> |
getIdentifier(String name,
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId)
Create the instance identifier for the flow index for the given switch.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<SourceHostFlows> |
getIdentifier(String name,
SourceHostFlowsKey hostId)
Create the instance identifier for the flow index for the given source
L2 host.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnDataFlow> |
getIdentifier(String name,
VtnDataFlowKey flowKey)
Create the instance identifier for the specified data flow.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnDataFlow> |
getIdentifier(String name,
VtnFlowId flowId)
Create the instance identifier for the specified data flow.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnFlowTable> |
getIdentifier(VtnFlowTableKey key)
Create the instance identifier for the VTN flow table.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<NodeFlows> |
getIdentifier(VtnFlowTableKey key,
NodeFlowsKey nodeKey)
Create the instance identifier for the flow index for the given switch.
|
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<PortFlows> |
getIdentifier(VtnFlowTableKey key,
PortFlowsKey portKey)
Create the instance identifier for the flow index for the given switch
port.
|
static VtnFlowId |
getInitialFlowId()
Return the initial value of the VTN flow ID.
|
static short |
getTableId(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.GenericFlowAttributes flow)
Return the table ID configured in the given MD-SAL flow.
|
static VtnFlowId |
getVtnFlowId(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie cookie)
Return the VTN flow ID embedded in the given flow cookie.
|
static boolean |
removeDataFlow(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
String tname,
VTNDataFlow df)
Remove the given data flow from the MD-SAL datastore.
|
static void |
removedLog(org.slf4j.Logger logger,
String desc,
FlowCache fc)
Record a debug log message which indicates the specified data flow
has been removed.
|
static RemoveFlowRpcList |
removeFlowEntries(FlowRpcWatcher watcher,
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService sfs,
List<FlowCache> flows,
InventoryReader reader)
Remove all flow entries in the given VTN data flows.
|
static RemoveFlowRpcList |
removeFlowEntries(FlowRpcWatcher watcher,
org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService sfs,
List<FlowCache> flows,
SalPort sport,
InventoryReader reader)
Remove all flow entries in the given VTN data flows.
|
static <T extends FlowIdSet> |
removeFlowIdSet(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
Remove the given flow ID set if it is empty.
|
static void |
removeIndex(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnFlowTable> path,
VTNDataFlow df)
Remove the given data flow from all flow indices in the MD-SAL
datastore.
|
static void |
removeIndex(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnFlowTable> path,
VTNDataFlow df,
FlowIdListKey idKey)
Remove the given data flow from all flow indices in the MD-SAL
datastore.
|
static void |
setDescription(StringBuilder builder,
VtnFlowTimeoutConfig vftc,
String separator)
Append strings that describes the specified flow timeout configuration
into the specified string builder.
|
static void |
verifyFlowTimeout(Integer idle,
Integer hard)
Verify the given flow timeout values.
|
static void |
verifyFlowTimeout(Integer idle,
Integer hard,
boolean present)
Verify the given flow timeout values.
|
static void |
verifyFlowTimeout(VtnFlowTimeoutConfig vftc)
Verify timeout values in the given
VtnFlowTimeoutConfig
instance. |
public static final short TABLE_ID
public static final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie COOKIE_VTN
public static final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie COOKIE_MISS
public static final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie COOKIE_MASK_ALL
public static final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie COOKIE_MASK_VTN
COOKIE_MASKVAL_VTN bits.public static final long MIN_FLOW_ID
public static final long MAX_FLOW_ID
public static final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.Match EMPTY_MATCH
public static final org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags FLOW_MOD_FLAGS
public static void verifyFlowTimeout(Integer idle, Integer hard) throws RpcException
idle - The idle-timeout value.hard - The hard-timeout value.RpcException - The given flow timeout values are invalid.public static void verifyFlowTimeout(Integer idle, Integer hard, boolean present) throws RpcException
idle - The idle-timeout value.hard - The hard-timeout value.present - true means that the flow timeout configuration
must be present.RpcException - The given flow timeout values are invalid.public static void verifyFlowTimeout(VtnFlowTimeoutConfig vftc) throws RpcException
VtnFlowTimeoutConfig
instance.vftc - A VtnFlowTimeoutConfig instance.RpcException - The given instance contains invalid timeout values.public static boolean equalsFlowTimeoutConfig(VtnFlowTimeoutConfig vftc1, VtnFlowTimeoutConfig vftc2)
VtnFlowTimeoutConfig instances
contain the same configuration or not.vftc1 - The first instance to be compared.vftc2 - The second instance to be compared.true only if the given instances contains the same
configuration.public static void setDescription(StringBuilder builder, VtnFlowTimeoutConfig vftc, String separator)
builder - A string builder.vftc - The flow timeout configuration.separator - A string to be used for field separator.public static VtnFlowId getInitialFlowId()
public static int compare(org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.Duration d1,
org.opendaylight.yang.gen.v1.urn.opendaylight.model.statistics.types.rev130925.duration.Duration d2)
Duration instances.d1 - The first instance to be compared.d2 - The second instance to be compared.public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie createCookie(VtnFlowId fid)
fid - The identifier of the VTN data flow.FlowCookie instance.public static VtnFlowId getVtnFlowId(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowCookie cookie)
cookie - A FlowCookie instance.VtnFlowId instance on success.
null on failure.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnFlowTable> getIdentifier(String name)
name - The name of the VTN.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnFlowTable> getIdentifier(VtnFlowTableKey key)
key - A VtnFlowTableKey which contains the name of the
target VTN.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnDataFlow> getIdentifier(String name, VtnFlowId flowId)
name - The name of the VTN.flowId - The flow identifier.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnDataFlow> getIdentifier(String name, VtnDataFlowKey flowKey)
name - The name of the VTN.flowKey - A VtnDataFlowKey instance which contains the
target flow ID.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<NodeFlows> getIdentifier(String name, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId)
name - The name of the VTN.nodeId - A NodeId instance.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<NodeFlows> getIdentifier(VtnFlowTableKey key, NodeFlowsKey nodeKey)
key - A VtnFlowTableKey which contains the name of the
target VTN.nodeKey - A NodeFlowsKey instance which contains the
target node identifier.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<PortFlows> getIdentifier(String name, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId portId)
name - The name of the VTN.portId - A NodeConnectorId instance.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<PortFlows> getIdentifier(VtnFlowTableKey key, PortFlowsKey portKey)
key - A VtnFlowTableKey which contains the name of the
target VTN.portKey - A PortFlowsKey instance which contains the
target port identifier.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<SourceHostFlows> getIdentifier(String name, SourceHostFlowsKey hostId)
name - The name of the VTN.hostId - A SourceHostFlowsKey instance.InstanceIdentifier instance.public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<MatchFlows> getIdentifier(String name, MatchFlowsKey cond)
name - The name of the VTN.cond - A string which indicates the ingress flow match.InstanceIdentifier instance.public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri createTxUri(VtnFlowEntry vfent, String prefix)
vfent - A VtnFlowEntry instance.prefix - Prefix of the URI.Uri instance.public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput createAddFlowInput(VtnFlowId flowId, VtnFlowEntry vfent)
flowId - A VTN flow ID.vfent - A VtnFlowEntry instance.AddFlowInput instance.public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId createMdFlowId(BigInteger id)
id - A VTN flow ID.public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId createMdFlowId(BigInteger id, Integer index)
id - A VTN flow ID.index - An index value that specifies a flow entry in a VTN
data flow.public static String createTableMissFlowId(SalNode snode)
snode - A SalNode instance that specifies the target
switch.public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput createTableMissInput(SalNode snode)
snode - A SalNode instance which specifies the target
switch.AddFlowInput instance.@Nonnull public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder createRemoveFlowInputBuilder(SalNode snode)
Note that the caller must ensure that the specified switch is present and supports OF 1.3 protocol.
snode - A SalNode instance which specifies the target
switch.RemoveFlowInputBuilder instance.
Note that this method never sets barrier flag into the returned
input builder.@Nullable public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder createRemoveFlowInputBuilder(SalNode snode, VtnFlowEntry vfent, InventoryReader reader) throws VTNException
snode - A SalNode instance which specifies the target
switch.vfent - A VtnFlowEntry instance.reader - A InventoryReader instance.RemoveFlowInputBuilder instance on success.
null if the target node is not present.
Note that this method never sets barrier flag into the returned
input builder.VTNException - An error occurred.@Nonnull public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder createRemoveFlowInputBuilder(SalNode snode, VtnFlowEntry vfent)
Note that the caller must ensure that the specified switch is present.
snode - A SalNode instance which specifies the target
switch.vfent - A VtnFlowEntry instance.RemoveFlowInputBuilder instance.
Note that this method never sets barrier flag into the returned
input builder.@Nonnull public static org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder createRemoveFlowInputBuilder(SalNode snode, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow flow, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri uri)
Note that the caller must ensure that the specified switch is present.
snode - A SalNode instance which specifies the target
switch.flow - A Flow instance.uri - A Uri to be assigned to the input.RemoveFlowInputBuilder instance.
Note that this method never sets barrier flag into the returned
input builder.@Nonnull public static List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder> createRemoveFlowInputBuilder(SalNode snode, SalPort sport)
This method returns a bulk flow remove request to uninstall the following flow entries.
Note that the caller must ensure that the specified switch is present.
public static <T extends FlowIdSet> boolean removeFlowIdSet(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path) throws VTNException
T - The type of the flow ID set.tx - A ReadWriteTransaction instance.path - Path to the flow ID set.true if the specified flow ID set was removed.
Otherwise false.VTNException - An error occurred.public static void removeIndex(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnFlowTable> path,
VTNDataFlow df)
throws VTNException
tx - A ReadWriteTransaction instance.path - Path to the VTN flow table in the MD-SAL datastore.df - A VTNDataFlow instance.VTNException - An error occurred.public static void removeIndex(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
org.opendaylight.yangtools.yang.binding.InstanceIdentifier<VtnFlowTable> path,
VTNDataFlow df,
FlowIdListKey idKey)
throws VTNException
tx - A ReadWriteTransaction instance.path - Path to the VTN flow table in the MD-SAL datastore.df - A VTNDataFlow instance.idKey - A FlowIdListKey instance which contains the
data flow identifier.VTNException - An error occurred.public static boolean removeDataFlow(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx,
String tname,
VTNDataFlow df)
throws VTNException
tx - A ReadWriteTransaction instance.tname - The name of the VTN.df - A VTNDataFlow instance.true if the specified data flow was removed.
false if the specified data flow is not present.VTNException - An error occurred.public static RemoveFlowRpcList removeFlowEntries(FlowRpcWatcher watcher, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService sfs, List<FlowCache> flows, InventoryReader reader) throws VTNException
watcher - The flow RPC watcher.sfs - MD-SAL flow service.flows - A list of FlowCache instances.reader - A InventoryReader instance.RemoveFlowRpcList instance.VTNException - An error occurred.public static RemoveFlowRpcList removeFlowEntries(FlowRpcWatcher watcher, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService sfs, List<FlowCache> flows, SalPort sport, InventoryReader reader) throws VTNException
Flow entries related to the given switch port will be unsinstalled by a bulk flow remove request.
watcher - The node-routed RPC watcher.sfs - MD-SAL flow service.flows - A list of FlowCache instances.sport - A SalPort instance which specifies the switch
port.reader - A InventoryReader instance.RemoveFlowRpcList instance.VTNException - An error occurred.public static List<VtnFlowTable> getFlowTables(org.opendaylight.controller.md.sal.binding.api.ReadTransaction tx) throws VTNException
tx - A ReadTransaction instance.VTNException - An error occurred.public static void removedLog(org.slf4j.Logger logger,
String desc,
FlowCache fc)
logger - A logger instance.desc - A brief description about flow remover.fc - A FlowCache instance which contains the removed
data flow.public static short getTableId(@Nonnull org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.GenericFlowAttributes flow)
flow - The MD-SAL flow.Copyright © 2018 OpenDaylight. All rights reserved.