Package org.onosproject.net.flow
Interface FlowRuleStore
-
- All Superinterfaces:
Store<FlowRuleBatchEvent,FlowRuleStoreDelegate>
public interface FlowRuleStore extends Store<FlowRuleBatchEvent,FlowRuleStoreDelegate>
Manages inventory of flow rules; not intended for direct use.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description FlowRuleEvent
addOrUpdateFlowRule(FlowEntry rule)
Stores a new flow rule, or updates an existing entry.void
batchOperationComplete(FlowRuleBatchEvent event)
Invoked on the completion of a storeBatch operation.void
deleteFlowRule(FlowRule rule)
Marks a flow rule for deletion.long
getActiveFlowRuleCount(DeviceId deviceId)
Deprecated.since 2.1java.lang.Iterable<FlowEntry>
getFlowEntries(DeviceId deviceId)
Returns the flow entries associated with a device.FlowEntry
getFlowEntry(FlowRule rule)
Returns the stored flow.int
getFlowRuleCount()
Returns the number of flow rules in the store.default int
getFlowRuleCount(DeviceId deviceId)
Returns the number of flow rules for the given device in the store.default int
getFlowRuleCount(DeviceId deviceId, FlowEntry.FlowEntryState state)
Returns the number of flow rules in the given state for the given device.java.lang.Iterable<TableStatisticsEntry>
getTableStatistics(DeviceId deviceId)
Returns the flow table statistics associated with a device.FlowRuleEvent
pendingFlowRule(FlowEntry rule)
Marks a flow rule as PENDING_ADD during retry.default void
purgeFlowRule(DeviceId deviceId)
Removes all flow entries of given device from store.void
purgeFlowRules()
Removes all flow entries from store.FlowRuleEvent
removeFlowRule(FlowEntry rule)
void
storeBatch(FlowRuleBatchOperation batchOperation)
Stores a batch of flow rules.void
storeFlowRule(FlowRule rule)
Deprecated.in Cardinal ReleaseFlowRuleEvent
updateTableStatistics(DeviceId deviceId, java.util.List<TableStatisticsEntry> tableStats)
Updates the flow table statistics of the specified device using the given statistics.-
Methods inherited from interface org.onosproject.store.Store
hasDelegate, setDelegate, unsetDelegate
-
-
-
-
Method Detail
-
getFlowRuleCount
int getFlowRuleCount()
Returns the number of flow rules in the store.- Returns:
- number of flow rules
-
getFlowRuleCount
default int getFlowRuleCount(DeviceId deviceId)
Returns the number of flow rules for the given device in the store.- Parameters:
deviceId
- device identifier- Returns:
- number of flow rules for the given device
-
getFlowRuleCount
default int getFlowRuleCount(DeviceId deviceId, FlowEntry.FlowEntryState state)
Returns the number of flow rules in the given state for the given device.- Parameters:
deviceId
- the device identifierstate
- the state for which to count flow rules- Returns:
- number of flow rules in the given state for the given device
-
getFlowEntry
FlowEntry getFlowEntry(FlowRule rule)
Returns the stored flow.- Parameters:
rule
- the rule to look for- Returns:
- a flow rule
-
getFlowEntries
java.lang.Iterable<FlowEntry> getFlowEntries(DeviceId deviceId)
Returns the flow entries associated with a device.- Parameters:
deviceId
- the device ID- Returns:
- the flow entries
-
storeFlowRule
@Deprecated void storeFlowRule(FlowRule rule)
Deprecated.in Cardinal Release// TODO: Better description of method behavior. Stores a new flow rule without generating events.- Parameters:
rule
- the flow rule to add
-
storeBatch
void storeBatch(FlowRuleBatchOperation batchOperation)
Stores a batch of flow rules.- Parameters:
batchOperation
- batch of flow rules. A batch can contain flow rules for a single device only.
-
batchOperationComplete
void batchOperationComplete(FlowRuleBatchEvent event)
Invoked on the completion of a storeBatch operation.- Parameters:
event
- flow rule batch event
-
deleteFlowRule
void deleteFlowRule(FlowRule rule)
Marks a flow rule for deletion. Actual deletion will occur when the provider indicates that the flow has been removed.- Parameters:
rule
- the flow rule to delete
-
addOrUpdateFlowRule
FlowRuleEvent addOrUpdateFlowRule(FlowEntry rule)
Stores a new flow rule, or updates an existing entry.- Parameters:
rule
- the flow rule to add or update- Returns:
- flow_added event, or null if just an update
-
removeFlowRule
FlowRuleEvent removeFlowRule(FlowEntry rule)
- Parameters:
rule
- the flow entry to remove- Returns:
- flow_removed event, or null if nothing removed
-
pendingFlowRule
FlowRuleEvent pendingFlowRule(FlowEntry rule)
Marks a flow rule as PENDING_ADD during retry. Emits flow_update event if the state is changed- Parameters:
rule
- the flow rule that is retrying- Returns:
- flow_updated event, or null if nothing updated
-
purgeFlowRule
default void purgeFlowRule(DeviceId deviceId)
Removes all flow entries of given device from store.- Parameters:
deviceId
- device id
-
purgeFlowRules
void purgeFlowRules()
Removes all flow entries from store.
-
updateTableStatistics
FlowRuleEvent updateTableStatistics(DeviceId deviceId, java.util.List<TableStatisticsEntry> tableStats)
Updates the flow table statistics of the specified device using the given statistics.- Parameters:
deviceId
- device identifiertableStats
- list of table statistics- Returns:
- ready to send event describing what occurred;
-
getTableStatistics
java.lang.Iterable<TableStatisticsEntry> getTableStatistics(DeviceId deviceId)
Returns the flow table statistics associated with a device.- Parameters:
deviceId
- the device ID- Returns:
- the flow table statistics
-
getActiveFlowRuleCount
@Deprecated long getActiveFlowRuleCount(DeviceId deviceId)
Deprecated.since 2.1Returns number of flow rules in ADDED state for specified device.- Parameters:
deviceId
- the device ID- Returns:
- number of flow rules in ADDED state
-
-