Package org.onosproject.net.flow
Class DefaultFlowEntry
- java.lang.Object
-
- org.onosproject.net.flow.DefaultFlowRule
-
- org.onosproject.net.flow.DefaultFlowEntry
-
- All Implemented Interfaces:
FlowEntry
,FlowRule
,StoredFlowEntry
,PiTranslatable
- Direct Known Subclasses:
DefaultTypedFlowEntry
public class DefaultFlowEntry extends DefaultFlowRule implements StoredFlowEntry
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.onosproject.net.flow.DefaultFlowRule
DefaultFlowRule.Builder
-
Nested classes/interfaces inherited from interface org.onosproject.net.flow.FlowEntry
FlowEntry.FlowEntryState, FlowEntry.FlowLiveType
-
Nested classes/interfaces inherited from interface org.onosproject.net.flow.FlowRule
FlowRule.Builder, 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 DefaultFlowEntry(FlowRule rule)
DefaultFlowEntry(FlowRule rule, int errType, int errCode)
Creates a flow entry of flow table specified with the flow rule, state, live type and statistic information.DefaultFlowEntry(FlowRule rule, FlowEntry.FlowEntryState state)
Creates a flow entry based on specified flow rule and state.DefaultFlowEntry(FlowRule rule, FlowEntry.FlowEntryState state, long lifeSecs, long packets, long bytes)
DefaultFlowEntry(FlowRule rule, FlowEntry.FlowEntryState state, long life, TimeUnit lifeTimeUnit, long packets, long bytes)
Creates a flow entry of flow table specified with the flow rule, state and statistic information.DefaultFlowEntry(FlowRule rule, FlowEntry.FlowEntryState state, long life, TimeUnit lifeTimeUnit, FlowEntry.FlowLiveType liveType, long packets, long bytes)
Creates a flow entry of flow table specified with the flow rule, state and statistic information.DefaultFlowEntry(FlowRule rule, FlowEntry.FlowEntryState state, long lifeSecs, FlowEntry.FlowLiveType liveType, long packets, long bytes)
Creates a flow entry of flow table specified with the flow rule, state, live type and statistic information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
bytes()
Returns the number of bytes this flow rule has matched.int
errCode()
Indicates the error code.int
errType()
Indicates the error type.long
lastSeen()
When this flow entry was last deemed active.long
life()
Returns the number of seconds this flow rule has been applied.long
life(TimeUnit timeUnit)
Returns the time this flow rule has been applied.FlowEntry.FlowLiveType
liveType()
Gets the flow live type for this entry.long
packets()
Returns the number of packets this flow rule has matched.void
setBytes(long bytes)
Number of bytes seen by this rule.void
setLastSeen()
Sets the last active epoch time.void
setLife(long life)
Sets how long this entry has been entered in the system.void
setLife(long life, TimeUnit timeUnit)
Sets how long this entry has been entered in the system.void
setLiveType(FlowEntry.FlowLiveType liveType)
Sets the flow live type, i.e., IMMEDIATE, SHORT, MID, LONG.void
setPackets(long packets)
Number of packets seen by this entry.void
setState(FlowEntry.FlowEntryState newState)
Sets the new state for this entry.FlowEntry.FlowEntryState
state()
Returns the flow entry state.String
toString()
-
Methods inherited from class org.onosproject.net.flow.DefaultFlowRule
appId, builder, created, deviceId, equals, exactMatch, groupId, hardTimeout, hashCode, id, isPermanent, priority, reason, selector, table, tableId, timeout, treatment
-
-
-
-
Constructor Detail
-
DefaultFlowEntry
public DefaultFlowEntry(FlowRule rule, FlowEntry.FlowEntryState state, long life, TimeUnit lifeTimeUnit, long packets, long bytes)
Creates a flow entry of flow table specified with the flow rule, state and statistic information.- Parameters:
rule
- the flow rulestate
- the flow statelife
- the duration second of flowlifeTimeUnit
- life time unitpackets
- the number of packets of this flowbytes
- the the number of bytes of this flow
-
DefaultFlowEntry
public DefaultFlowEntry(FlowRule rule, FlowEntry.FlowEntryState state, long life, TimeUnit lifeTimeUnit, FlowEntry.FlowLiveType liveType, long packets, long bytes)
Creates a flow entry of flow table specified with the flow rule, state and statistic information.- Parameters:
rule
- the flow rulestate
- the flow statelife
- the duration second of flowlifeTimeUnit
- life time unitliveType
- the flow live type, i.e., IMMEDIATE, SHORT, MID, LONGpackets
- the number of packets of this flowbytes
- the the number of bytes of this flow
-
DefaultFlowEntry
public DefaultFlowEntry(FlowRule rule, FlowEntry.FlowEntryState state, long lifeSecs, FlowEntry.FlowLiveType liveType, long packets, long bytes)
Creates a flow entry of flow table specified with the flow rule, state, live type and statistic information.- Parameters:
rule
- the flow rulestate
- the flow statelifeSecs
- the duration second of flowliveType
- the flow live type, i.e., IMMEDIATE, SHORT, MID, LONGpackets
- the number of packets of this flowbytes
- the the number of bytes of this flow
-
DefaultFlowEntry
public DefaultFlowEntry(FlowRule rule, FlowEntry.FlowEntryState state, long lifeSecs, long packets, long bytes)
-
DefaultFlowEntry
public DefaultFlowEntry(FlowRule rule)
-
DefaultFlowEntry
public DefaultFlowEntry(FlowRule rule, FlowEntry.FlowEntryState state)
Creates a flow entry based on specified flow rule and state.- Parameters:
rule
- to use as basestate
- of the flow entry
-
DefaultFlowEntry
public DefaultFlowEntry(FlowRule rule, int errType, int errCode)
Creates a flow entry of flow table specified with the flow rule, state, live type and statistic information.- Parameters:
rule
- the flow ruleerrType
- the error typeerrCode
- the error code
-
-
Method Detail
-
life
public long life()
Description copied from interface:FlowEntry
Returns the number of seconds this flow rule has been applied.
-
life
public long life(TimeUnit timeUnit)
Description copied from interface:FlowEntry
Returns the time this flow rule has been applied.
-
liveType
public FlowEntry.FlowLiveType liveType()
Description copied from interface:FlowEntry
Gets the flow live type for this entry.
-
packets
public long packets()
Description copied from interface:FlowEntry
Returns the number of packets this flow rule has matched.
-
bytes
public long bytes()
Description copied from interface:FlowEntry
Returns the number of bytes this flow rule has matched.
-
state
public FlowEntry.FlowEntryState state()
Description copied from interface:FlowEntry
Returns the flow entry state.
-
lastSeen
public long lastSeen()
Description copied from interface:FlowEntry
When this flow entry was last deemed active.
-
setLastSeen
public void setLastSeen()
Description copied from interface:StoredFlowEntry
Sets the last active epoch time.- Specified by:
setLastSeen
in interfaceStoredFlowEntry
-
setState
public void setState(FlowEntry.FlowEntryState newState)
Description copied from interface:StoredFlowEntry
Sets the new state for this entry.- Specified by:
setState
in interfaceStoredFlowEntry
- Parameters:
newState
- new flow entry state.
-
setLife
public void setLife(long life)
Description copied from interface:StoredFlowEntry
Sets how long this entry has been entered in the system.- Specified by:
setLife
in interfaceStoredFlowEntry
- Parameters:
life
- seconds
-
setLife
public void setLife(long life, TimeUnit timeUnit)
Description copied from interface:StoredFlowEntry
Sets how long this entry has been entered in the system.- Specified by:
setLife
in interfaceStoredFlowEntry
- Parameters:
life
- timetimeUnit
- unit of time
-
setLiveType
public void setLiveType(FlowEntry.FlowLiveType liveType)
Description copied from interface:StoredFlowEntry
Sets the flow live type, i.e., IMMEDIATE, SHORT, MID, LONG.- Specified by:
setLiveType
in interfaceStoredFlowEntry
- Parameters:
liveType
- flow live type
-
setPackets
public void setPackets(long packets)
Description copied from interface:StoredFlowEntry
Number of packets seen by this entry.- Specified by:
setPackets
in interfaceStoredFlowEntry
- Parameters:
packets
- a long value
-
setBytes
public void setBytes(long bytes)
Description copied from interface:StoredFlowEntry
Number of bytes seen by this rule.- Specified by:
setBytes
in interfaceStoredFlowEntry
- Parameters:
bytes
- a long value
-
errType
public int errType()
Description copied from interface:FlowEntry
Indicates the error type.
-
errCode
public int errCode()
Description copied from interface:FlowEntry
Indicates the error code.
-
toString
public String toString()
- Overrides:
toString
in classDefaultFlowRule
-
-