Package org.onosproject.net.flow
Interface FlowRule
-
- All Superinterfaces:
PiTranslatable
- All Known Subinterfaces:
FlowEntry
,StoredFlowEntry
,TypedStoredFlowEntry
- All Known Implementing Classes:
DefaultFlowEntry
,DefaultFlowRule
,DefaultTypedFlowEntry
public interface FlowRule extends PiTranslatable
Represents a generalized match & action pair to be applied to an infrastructure device.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
FlowRule.Builder
A flowrule builder.static class
FlowRule.FlowRemoveReason
Reason for flow parameter received from switches.
-
Field Summary
Fields Modifier and Type Field Description static IndexTableId
DEFAULT_TABLE
static int
MAX_PRIORITY
static int
MAX_TIMEOUT
static int
MIN_PRIORITY
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description short
appId()
Returns the application id of this flow.DeviceId
deviceId()
Returns the identity of the device where this rule applies.boolean
equals(java.lang.Object obj)
Equality for flow rules only considers 'match equality'.boolean
exactMatch(FlowRule rule)
Returns whether this flow rule is an exact match to the flow rule given in the argument.GroupId
groupId()
Returns the group id of this flow.int
hardTimeout()
Returns the hard timeout for this flow requested by an application.FlowId
id()
Returns the ID of this flow.boolean
isPermanent()
Returns whether the flow is permanent i.e.int
priority()
Returns the flow rule priority given in natural order; higher numbers mean higher priorities.FlowRule.FlowRemoveReason
reason()
Returns the reason for the flow received from switches.TrafficSelector
selector()
Returns the traffic selector that identifies what traffic this rule should apply to.TableId
table()
Returns the table identifier for this rule.int
tableId()
Deprecated.in Loon release (version 1.11.0).int
timeout()
Returns the timeout for this flow requested by an application.TrafficTreatment
treatment()
Returns the traffic treatment that applies to selected traffic.
-
-
-
Field Detail
-
DEFAULT_TABLE
static final IndexTableId DEFAULT_TABLE
-
MAX_TIMEOUT
static final int MAX_TIMEOUT
- See Also:
- Constant Field Values
-
MIN_PRIORITY
static final int MIN_PRIORITY
- See Also:
- Constant Field Values
-
MAX_PRIORITY
static final int MAX_PRIORITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
id
FlowId id()
Returns the ID of this flow.- Returns:
- the flow ID
-
appId
short appId()
Returns the application id of this flow.- Returns:
- an applicationId
-
groupId
GroupId groupId()
Returns the group id of this flow.- Returns:
- an groupId
-
priority
int priority()
Returns the flow rule priority given in natural order; higher numbers mean higher priorities.- Returns:
- flow rule priority
-
deviceId
DeviceId deviceId()
Returns the identity of the device where this rule applies.- Returns:
- device identifier
-
selector
TrafficSelector selector()
Returns the traffic selector that identifies what traffic this rule should apply to.- Returns:
- traffic selector
-
treatment
TrafficTreatment treatment()
Returns the traffic treatment that applies to selected traffic.- Returns:
- traffic treatment
-
timeout
int timeout()
Returns the timeout for this flow requested by an application.- Returns:
- integer value of the timeout
-
hardTimeout
int hardTimeout()
Returns the hard timeout for this flow requested by an application. This parameter configure switch's flow hard timeout. In case of controller-switch connection lost, this variable can be useful.- Returns:
- integer value of the hard Timeout
-
reason
FlowRule.FlowRemoveReason reason()
Returns the reason for the flow received from switches.- Returns:
- FlowRemoveReason value of reason
-
isPermanent
boolean isPermanent()
Returns whether the flow is permanent i.e. does not time out.- Returns:
- true if the flow is permanent, otherwise false
-
tableId
@Deprecated int tableId()
Deprecated.in Loon release (version 1.11.0). Usetable()
instead.Returns the table id for this rule.- Returns:
- an integer.
-
table
TableId table()
Returns the table identifier for this rule.- Returns:
- a table identifier.
-
equals
boolean equals(java.lang.Object obj)
Equality for flow rules only considers 'match equality'. This means that two flow rules with the same match conditions will be equal, regardless of the treatment or other characteristics of the flow.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
exactMatch
boolean exactMatch(FlowRule rule)
Returns whether this flow rule is an exact match to the flow rule given in the argument.Exact match means that deviceId, priority, selector, tableId, flowId and treatment are equal. Note that this differs from the notion of object equality for flow rules, which does not consider the flowId or treatment when testing equality.
- Parameters:
rule
- other rule to match against- Returns:
- true if the rules are an exact match, otherwise false
-
-