Package org.onosproject.net.flow
Class DefaultFlowRule
- java.lang.Object
-
- org.onosproject.net.flow.DefaultFlowRule
-
- All Implemented Interfaces:
FlowRule,PiTranslatable
- Direct Known Subclasses:
DefaultFlowEntry
public class DefaultFlowRule extends Object implements FlowRule
Default flow rule.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultFlowRule.BuilderDefault flow rule builder.-
Nested classes/interfaces inherited from interface org.onosproject.net.flow.FlowRule
FlowRule.FlowRemoveReason
-
-
Field Summary
-
Fields inherited from interface org.onosproject.net.flow.FlowRule
DEFAULT_TABLE, MAX_PRIORITY, MAX_TIMEOUT, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description DefaultFlowRule(FlowRule rule)Creates a new flow rule from an existing rule.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description shortappId()Returns the application id of this flow.static DefaultFlowRule.Builderbuilder()Returns a default flow rule builder.longcreated()Returns the wallclock time that the flow was created.DeviceIddeviceId()Returns the identity of the device where this rule applies.booleanequals(Object obj)Equality for flow rules only considers 'match equality'.booleanexactMatch(FlowRule rule)Returns whether this flow rule is an exact match to the flow rule given in the argument.GroupIdgroupId()Returns the group id of this flow.inthardTimeout()Returns the hard timeout for this flow requested by an application.inthashCode()FlowIdid()Returns the ID of this flow.booleanisPermanent()Returns whether the flow is permanent i.e.intpriority()Returns the flow rule priority given in natural order; higher numbers mean higher priorities.FlowRule.FlowRemoveReasonreason()Returns the reason for the flow received from switches.TrafficSelectorselector()Returns the traffic selector that identifies what traffic this rule should apply to.TableIdtable()Returns the table identifier for this rule.inttableId()Returns the table id for this rule.inttimeout()Returns the timeout for this flow requested by an application.StringtoString()TrafficTreatmenttreatment()Returns the traffic treatment that applies to selected traffic.
-
-
-
Constructor Detail
-
DefaultFlowRule
public DefaultFlowRule(FlowRule rule)
Creates a new flow rule from an existing rule.- Parameters:
rule- new flow rule
-
-
Method Detail
-
appId
public short appId()
Description copied from interface:FlowRuleReturns the application id of this flow.
-
groupId
public GroupId groupId()
Description copied from interface:FlowRuleReturns the group id of this flow.
-
priority
public int priority()
Description copied from interface:FlowRuleReturns the flow rule priority given in natural order; higher numbers mean higher priorities.
-
deviceId
public DeviceId deviceId()
Description copied from interface:FlowRuleReturns the identity of the device where this rule applies.
-
selector
public TrafficSelector selector()
Description copied from interface:FlowRuleReturns the traffic selector that identifies what traffic this rule should apply to.
-
treatment
public TrafficTreatment treatment()
Description copied from interface:FlowRuleReturns the traffic treatment that applies to selected traffic.
-
equals
public boolean equals(Object obj)
Description copied from interface:FlowRuleEquality 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.
-
exactMatch
public boolean exactMatch(FlowRule rule)
Description copied from interface:FlowRuleReturns 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.
- Specified by:
exactMatchin interfaceFlowRule- Parameters:
rule- other rule to match against- Returns:
- true if the rules are an exact match, otherwise false
-
timeout
public int timeout()
Description copied from interface:FlowRuleReturns the timeout for this flow requested by an application.
-
hardTimeout
public int hardTimeout()
Description copied from interface:FlowRuleReturns 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.- Specified by:
hardTimeoutin interfaceFlowRule- Returns:
- integer value of the hard Timeout
-
reason
public FlowRule.FlowRemoveReason reason()
Description copied from interface:FlowRuleReturns the reason for the flow received from switches.
-
isPermanent
public boolean isPermanent()
Description copied from interface:FlowRuleReturns whether the flow is permanent i.e. does not time out.- Specified by:
isPermanentin interfaceFlowRule- Returns:
- true if the flow is permanent, otherwise false
-
tableId
public int tableId()
Description copied from interface:FlowRuleReturns the table id for this rule.
-
table
public TableId table()
Description copied from interface:FlowRuleReturns the table identifier for this rule.
-
created
public long created()
Returns the wallclock time that the flow was created.- Returns:
- creation time in milliseconds since epoch
-
builder
public static DefaultFlowRule.Builder builder()
Returns a default flow rule builder.- Returns:
- builder
-
-