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 longbytes()Returns the number of bytes this flow rule has matched.interrCode()Indicates the error code.interrType()Indicates the error type.longlastSeen()When this flow entry was last deemed active.longlife()Returns the number of seconds this flow rule has been applied.longlife(TimeUnit timeUnit)Returns the time this flow rule has been applied.FlowEntry.FlowLiveTypeliveType()Gets the flow live type for this entry.longpackets()Returns the number of packets this flow rule has matched.voidsetBytes(long bytes)Number of bytes seen by this rule.voidsetLastSeen()Sets the last active epoch time.voidsetLife(long life)Sets how long this entry has been entered in the system.voidsetLife(long life, TimeUnit timeUnit)Sets how long this entry has been entered in the system.voidsetLiveType(FlowEntry.FlowLiveType liveType)Sets the flow live type, i.e., IMMEDIATE, SHORT, MID, LONG.voidsetPackets(long packets)Number of packets seen by this entry.voidsetState(FlowEntry.FlowEntryState newState)Sets the new state for this entry.FlowEntry.FlowEntryStatestate()Returns the flow entry state.StringtoString()-
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:FlowEntryReturns the number of seconds this flow rule has been applied.
-
life
public long life(TimeUnit timeUnit)
Description copied from interface:FlowEntryReturns the time this flow rule has been applied.
-
liveType
public FlowEntry.FlowLiveType liveType()
Description copied from interface:FlowEntryGets the flow live type for this entry.
-
packets
public long packets()
Description copied from interface:FlowEntryReturns the number of packets this flow rule has matched.
-
bytes
public long bytes()
Description copied from interface:FlowEntryReturns the number of bytes this flow rule has matched.
-
state
public FlowEntry.FlowEntryState state()
Description copied from interface:FlowEntryReturns the flow entry state.
-
lastSeen
public long lastSeen()
Description copied from interface:FlowEntryWhen this flow entry was last deemed active.
-
setLastSeen
public void setLastSeen()
Description copied from interface:StoredFlowEntrySets the last active epoch time.- Specified by:
setLastSeenin interfaceStoredFlowEntry
-
setState
public void setState(FlowEntry.FlowEntryState newState)
Description copied from interface:StoredFlowEntrySets the new state for this entry.- Specified by:
setStatein interfaceStoredFlowEntry- Parameters:
newState- new flow entry state.
-
setLife
public void setLife(long life)
Description copied from interface:StoredFlowEntrySets how long this entry has been entered in the system.- Specified by:
setLifein interfaceStoredFlowEntry- Parameters:
life- seconds
-
setLife
public void setLife(long life, TimeUnit timeUnit)Description copied from interface:StoredFlowEntrySets how long this entry has been entered in the system.- Specified by:
setLifein interfaceStoredFlowEntry- Parameters:
life- timetimeUnit- unit of time
-
setLiveType
public void setLiveType(FlowEntry.FlowLiveType liveType)
Description copied from interface:StoredFlowEntrySets the flow live type, i.e., IMMEDIATE, SHORT, MID, LONG.- Specified by:
setLiveTypein interfaceStoredFlowEntry- Parameters:
liveType- flow live type
-
setPackets
public void setPackets(long packets)
Description copied from interface:StoredFlowEntryNumber of packets seen by this entry.- Specified by:
setPacketsin interfaceStoredFlowEntry- Parameters:
packets- a long value
-
setBytes
public void setBytes(long bytes)
Description copied from interface:StoredFlowEntryNumber of bytes seen by this rule.- Specified by:
setBytesin interfaceStoredFlowEntry- Parameters:
bytes- a long value
-
errType
public int errType()
Description copied from interface:FlowEntryIndicates the error type.
-
errCode
public int errCode()
Description copied from interface:FlowEntryIndicates the error code.
-
toString
public String toString()
- Overrides:
toStringin classDefaultFlowRule
-
-