public static final class DefaultFlowRule.Builder extends Object implements FlowRule.Builder
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
FlowRule |
build()
Builds a flow rule object.
|
FlowRule.Builder |
forDevice(DeviceId deviceId)
Sets the deviceId for this flow rule.
|
FlowRule.Builder |
forTable(int tableId)
Sets the table id for this flow rule, when the identifier is of type
TableId.Type.INDEX . |
FlowRule.Builder |
forTable(TableId tableId)
Sets the table identifier for this flow rule.
|
FlowRule.Builder |
fromApp(ApplicationId appId)
Assigns the application that built this flow rule to this object.
|
FlowRule.Builder |
makePermanent()
Makes this rule permanent on the dataplane.
|
FlowRule.Builder |
makeTemporary(int timeout)
Makes this rule temporary and timeout after the specified amount
of time.
|
FlowRule.Builder |
withCookie(long cookie)
Assigns a cookie value to this flowrule.
|
FlowRule.Builder |
withHardTimeout(int timeout)
Sets hard timeout parameter in flow table.
|
FlowRule.Builder |
withPriority(int priority)
Sets the priority for this flow rule.
|
FlowRule.Builder |
withReason(FlowRule.FlowRemoveReason reason)
Sets reason parameter received from switches .
|
FlowRule.Builder |
withSelector(TrafficSelector selector)
Sets the selector (or match field) for this flow rule.
|
FlowRule.Builder |
withTreatment(TrafficTreatment treatment)
Sets the traffic treatment for this flow rule.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
withIdleTimeout
public FlowRule.Builder withCookie(long cookie)
FlowRule.Builder
withCookie
in interface FlowRule.Builder
cookie
- a long valuepublic FlowRule.Builder fromApp(ApplicationId appId)
FlowRule.Builder
fromApp
in interface FlowRule.Builder
appId
- an application idpublic FlowRule.Builder withPriority(int priority)
FlowRule.Builder
withPriority
in interface FlowRule.Builder
priority
- an integerpublic FlowRule.Builder forDevice(DeviceId deviceId)
FlowRule.Builder
forDevice
in interface FlowRule.Builder
deviceId
- a device idpublic FlowRule.Builder forTable(int tableId)
FlowRule.Builder
TableId.Type.INDEX
. Default
value is 0.
Important: This method is left here for backward compatibility with applications that specifies
table identifiers using integers, e.g. as in OpenFlow. Currently there is no plan to deprecate this method,
however, new applications should favor using FlowRule.Builder.forTable(TableId)
.
forTable
in interface FlowRule.Builder
tableId
- an integerpublic FlowRule.Builder forTable(TableId tableId)
FlowRule.Builder
TableId.Type.INDEX
and value 0.forTable
in interface FlowRule.Builder
tableId
- table identifierpublic FlowRule.Builder withSelector(TrafficSelector selector)
FlowRule.Builder
withSelector
in interface FlowRule.Builder
selector
- a traffic selectorpublic FlowRule.Builder withTreatment(TrafficTreatment treatment)
FlowRule.Builder
withTreatment
in interface FlowRule.Builder
treatment
- a traffic treatmentpublic FlowRule.Builder makePermanent()
FlowRule.Builder
makePermanent
in interface FlowRule.Builder
public FlowRule.Builder makeTemporary(int timeout)
FlowRule.Builder
makeTemporary
in interface FlowRule.Builder
timeout
- an integerpublic FlowRule.Builder withHardTimeout(int timeout)
FlowRule.Builder
withHardTimeout
in interface FlowRule.Builder
timeout
- an integerpublic FlowRule.Builder withReason(FlowRule.FlowRemoveReason reason)
FlowRule.Builder
withReason
in interface FlowRule.Builder
reason
- a shortpublic FlowRule build()
FlowRule.Builder
build
in interface FlowRule.Builder