Package org.onosproject.net.flow
Class DefaultTrafficTreatment
- java.lang.Object
-
- org.onosproject.net.flow.DefaultTrafficTreatment
-
- All Implemented Interfaces:
TrafficTreatment
public final class DefaultTrafficTreatment extends java.lang.Object implements TrafficTreatment
Default traffic treatment implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultTrafficTreatment.Builder
Builds a list of treatments following the following order.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Instruction>
allInstructions()
Returns the list of all instructions in the treatment, both immediate and deferred.static TrafficTreatment.Builder
builder()
Returns a new traffic treatment builder.static TrafficTreatment.Builder
builder(TrafficTreatment treatment)
Returns a new traffic treatment builder primed to produce entities patterned after the supplied treatment.boolean
clearedDeferred()
Whether the deferred treatment instructions will be cleared by the device.java.util.List<Instruction>
deferred()
Returns the list of treatment instructions that will be applied further down the pipeline.static TrafficTreatment
emptyTreatment()
Returns an empty traffic treatment.boolean
equals(java.lang.Object obj)
int
hashCode()
java.util.List<Instruction>
immediate()
Returns the list of treatment instructions that will be applied immediately.Instructions.MeterInstruction
metered()
Returns the meter instruction if there is one.java.util.Set<Instructions.MeterInstruction>
meters()
Returns the meter instructions if there is any.Instructions.StatTriggerInstruction
statTrigger()
Returns the stat trigger instruction if there is one.Instructions.TableTypeTransition
tableTransition()
Returns the next table in the pipeline.java.lang.String
toString()
Instructions.MetadataInstruction
writeMetadata()
Returns the metadata instruction if there is one.
-
-
-
Method Detail
-
deferred
public java.util.List<Instruction> deferred()
Description copied from interface:TrafficTreatment
Returns the list of treatment instructions that will be applied further down the pipeline.- Specified by:
deferred
in interfaceTrafficTreatment
- Returns:
- list of treatment instructions
-
immediate
public java.util.List<Instruction> immediate()
Description copied from interface:TrafficTreatment
Returns the list of treatment instructions that will be applied immediately.- Specified by:
immediate
in interfaceTrafficTreatment
- Returns:
- list of treatment instructions
-
allInstructions
public java.util.List<Instruction> allInstructions()
Description copied from interface:TrafficTreatment
Returns the list of all instructions in the treatment, both immediate and deferred.- Specified by:
allInstructions
in interfaceTrafficTreatment
- Returns:
- list of treatment instructions
-
tableTransition
public Instructions.TableTypeTransition tableTransition()
Description copied from interface:TrafficTreatment
Returns the next table in the pipeline.- Specified by:
tableTransition
in interfaceTrafficTreatment
- Returns:
- a table transition; may be null.
-
clearedDeferred
public boolean clearedDeferred()
Description copied from interface:TrafficTreatment
Whether the deferred treatment instructions will be cleared by the device.- Specified by:
clearedDeferred
in interfaceTrafficTreatment
- Returns:
- a boolean
-
writeMetadata
public Instructions.MetadataInstruction writeMetadata()
Description copied from interface:TrafficTreatment
Returns the metadata instruction if there is one.- Specified by:
writeMetadata
in interfaceTrafficTreatment
- Returns:
- a metadata instruction that may be null
-
statTrigger
public Instructions.StatTriggerInstruction statTrigger()
Description copied from interface:TrafficTreatment
Returns the stat trigger instruction if there is one.- Specified by:
statTrigger
in interfaceTrafficTreatment
- Returns:
- a stat trigger instruction; may be null.
-
metered
public Instructions.MeterInstruction metered()
Description copied from interface:TrafficTreatment
Returns the meter instruction if there is one.- Specified by:
metered
in interfaceTrafficTreatment
- Returns:
- a meter instruction that may be a null.
-
meters
public java.util.Set<Instructions.MeterInstruction> meters()
Description copied from interface:TrafficTreatment
Returns the meter instructions if there is any.- Specified by:
meters
in interfaceTrafficTreatment
- Returns:
- meter instructions that may be an empty set.
-
builder
public static TrafficTreatment.Builder builder()
Returns a new traffic treatment builder.- Returns:
- traffic treatment builder
-
emptyTreatment
public static TrafficTreatment emptyTreatment()
Returns an empty traffic treatment.- Returns:
- empty traffic treatment
-
builder
public static TrafficTreatment.Builder builder(TrafficTreatment treatment)
Returns a new traffic treatment builder primed to produce entities patterned after the supplied treatment.- Parameters:
treatment
- base treatment- Returns:
- traffic treatment builder
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-