public class DefaultFlowRule extends Object implements FlowRule
Modifier and Type | Class and Description |
---|---|
static class |
DefaultFlowRule.Builder
Default flow rule builder.
|
FlowRule.FlowRemoveReason
DEFAULT_TABLE, MAX_PRIORITY, MAX_TIMEOUT, MIN_PRIORITY
Constructor and Description |
---|
DefaultFlowRule(FlowRule rule)
Creates a new flow rule from an existing rule.
|
Modifier and Type | Method and Description |
---|---|
short |
appId()
Returns the application id of this flow.
|
static DefaultFlowRule.Builder |
builder()
Returns a default flow rule builder.
|
long |
created()
Returns the wallclock time that the flow was created.
|
DeviceId |
deviceId()
Returns the identity of the device where this rule applies.
|
boolean |
equals(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.
|
int |
hashCode() |
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()
Returns the table id for this rule.
|
int |
timeout()
Returns the timeout for this flow requested by an application.
|
String |
toString() |
TrafficTreatment |
treatment()
Returns the traffic treatment that applies to selected traffic.
|
public DefaultFlowRule(FlowRule rule)
rule
- new flow rulepublic short appId()
FlowRule
public GroupId groupId()
FlowRule
public int priority()
FlowRule
public DeviceId deviceId()
FlowRule
public TrafficSelector selector()
FlowRule
public TrafficTreatment treatment()
FlowRule
public boolean equals(Object obj)
FlowRule
public boolean exactMatch(FlowRule rule)
FlowRule
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.
exactMatch
in interface FlowRule
rule
- other rule to match againstpublic int timeout()
FlowRule
public int hardTimeout()
FlowRule
hardTimeout
in interface FlowRule
public FlowRule.FlowRemoveReason reason()
FlowRule
public boolean isPermanent()
FlowRule
isPermanent
in interface FlowRule
public int tableId()
FlowRule
public TableId table()
FlowRule
public long created()
public static DefaultFlowRule.Builder builder()