public class FlowBucket
extends java.lang.Object
The bucket is mutable. When changes are made to the bucket, the term and timestamp in which the change occurred is recorded for ordering changes.
| Modifier and Type | Method and Description |
|---|---|
void |
add(org.onosproject.net.flow.FlowEntry rule,
long term,
LogicalClock clock)
Adds the given flow rule to the bucket.
|
BucketId |
bucketId()
Returns the flow bucket identifier.
|
void |
clear()
Clears the bucket.
|
int |
count()
Counts the flows in the bucket.
|
FlowBucketDigest |
getDigest()
Returns the digest for the bucket.
|
java.util.Map<org.onosproject.net.flow.FlowId,java.util.Map<org.onosproject.net.flow.StoredFlowEntry,org.onosproject.net.flow.StoredFlowEntry>> |
getFlowBucket()
Returns the flow entries in the bucket.
|
java.util.Map<org.onosproject.net.flow.StoredFlowEntry,org.onosproject.net.flow.StoredFlowEntry> |
getFlowEntries(org.onosproject.net.flow.FlowId flowId)
Returns the flow entries for the given flow.
|
org.onosproject.net.flow.FlowEntry |
remove(org.onosproject.net.flow.FlowEntry rule,
long term,
LogicalClock clock)
Removes the given flow rule from the bucket.
|
long |
term()
Returns the flow bucket term.
|
org.onosproject.store.LogicalTimestamp |
timestamp()
Returns the flow bucket timestamp.
|
void |
update(org.onosproject.net.flow.FlowEntry rule,
long term,
LogicalClock clock)
Updates the given flow rule in the bucket.
|
<T> T |
update(org.onosproject.net.flow.FlowRule rule,
java.util.function.Function<org.onosproject.net.flow.StoredFlowEntry,T> function,
long term,
LogicalClock clock)
Applies the given update function to the rule.
|
public BucketId bucketId()
public long term()
public org.onosproject.store.LogicalTimestamp timestamp()
public FlowBucketDigest getDigest()
public java.util.Map<org.onosproject.net.flow.FlowId,java.util.Map<org.onosproject.net.flow.StoredFlowEntry,org.onosproject.net.flow.StoredFlowEntry>> getFlowBucket()
public java.util.Map<org.onosproject.net.flow.StoredFlowEntry,org.onosproject.net.flow.StoredFlowEntry> getFlowEntries(org.onosproject.net.flow.FlowId flowId)
flowId - the flow identifierpublic int count()
public void add(org.onosproject.net.flow.FlowEntry rule,
long term,
LogicalClock clock)
rule - the rule to addterm - the term in which the change occurredclock - the logical clockpublic void update(org.onosproject.net.flow.FlowEntry rule,
long term,
LogicalClock clock)
rule - the rule to updateterm - the term in which the change occurredclock - the logical clockpublic <T> T update(org.onosproject.net.flow.FlowRule rule,
java.util.function.Function<org.onosproject.net.flow.StoredFlowEntry,T> function,
long term,
LogicalClock clock)
T - the result typerule - the rule to updatefunction - the update function to applyterm - the term in which the change occurredclock - the logical clocknull if the rule was not updatedpublic org.onosproject.net.flow.FlowEntry remove(org.onosproject.net.flow.FlowEntry rule,
long term,
LogicalClock clock)
rule - the rule to removeterm - the term in which the change occurredclock - the logical clockpublic void clear()