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 SummaryNested Classes Modifier and Type Class Description static classDefaultFlowRule.BuilderDefault flow rule builder.- 
Nested classes/interfaces inherited from interface org.onosproject.net.flow.FlowRuleFlowRule.FlowRemoveReason
 
- 
 - 
Field Summary- 
Fields inherited from interface org.onosproject.net.flow.FlowRuleDEFAULT_TABLE, MAX_PRIORITY, MAX_TIMEOUT, MIN_PRIORITY
 
- 
 - 
Constructor SummaryConstructors Constructor Description DefaultFlowRule(FlowRule rule)Creates a new flow rule from an existing rule.
 - 
Method SummaryAll 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- 
DefaultFlowRulepublic DefaultFlowRule(FlowRule rule) Creates a new flow rule from an existing rule.- Parameters:
- rule- new flow rule
 
 
- 
 - 
Method Detail- 
appIdpublic short appId() Description copied from interface:FlowRuleReturns the application id of this flow.
 - 
groupIdpublic GroupId groupId() Description copied from interface:FlowRuleReturns the group id of this flow.
 - 
prioritypublic int priority() Description copied from interface:FlowRuleReturns the flow rule priority given in natural order; higher numbers mean higher priorities.
 - 
deviceIdpublic DeviceId deviceId() Description copied from interface:FlowRuleReturns the identity of the device where this rule applies.
 - 
selectorpublic TrafficSelector selector() Description copied from interface:FlowRuleReturns the traffic selector that identifies what traffic this rule should apply to.
 - 
treatmentpublic TrafficTreatment treatment() Description copied from interface:FlowRuleReturns the traffic treatment that applies to selected traffic.
 - 
equalspublic 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.
 - 
exactMatchpublic 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 interface- FlowRule
- Parameters:
- rule- other rule to match against
- Returns:
- true if the rules are an exact match, otherwise false
 
 - 
timeoutpublic int timeout() Description copied from interface:FlowRuleReturns the timeout for this flow requested by an application.
 - 
hardTimeoutpublic 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 interface- FlowRule
- Returns:
- integer value of the hard Timeout
 
 - 
reasonpublic FlowRule.FlowRemoveReason reason() Description copied from interface:FlowRuleReturns the reason for the flow received from switches.
 - 
isPermanentpublic boolean isPermanent() Description copied from interface:FlowRuleReturns whether the flow is permanent i.e. does not time out.- Specified by:
- isPermanentin interface- FlowRule
- Returns:
- true if the flow is permanent, otherwise false
 
 - 
tableIdpublic int tableId() Description copied from interface:FlowRuleReturns the table id for this rule.
 - 
tablepublic TableId table() Description copied from interface:FlowRuleReturns the table identifier for this rule.
 - 
createdpublic long created() Returns the wallclock time that the flow was created.- Returns:
- creation time in milliseconds since epoch
 
 - 
builderpublic static DefaultFlowRule.Builder builder() Returns a default flow rule builder.- Returns:
- builder
 
 
- 
 
-