5.7.7. vlcp.utils.flowupdater¶
Note
This document is generated from the source file.
Created on 2016/4/11
author: | hubo |
---|
-
class
vlcp.utils.flowupdater.
FlowUpdater
(connection, initialkeys=(), requestid=None, logger=None)¶ -
__init__
(connection, initialkeys=(), requestid=None, logger=None)¶ Retrieve data objects from ObjectDB and use them to generate flows
The module starts ObjectDB.walk from initial keys and walkers. After the walk completes, the retrieved data objects are used by updateflow() to generate flows and send them to the OpenFlow connection. When the retrieved objects are updated, FlowUpdater either restart the walk process (re-walk) or directly call another updateflow(), according to the objects that are updated.
A subclass should re-initialize self._initialkeys and self._walkerdict before main() coroutine starts to customize the process.
updateflow() is guaranteed for no re-entrance i.e. will not be called until the last call returns. Multiple changes may be merged into the same call.
Parameters: - connection – OpenFlow connection
- initialkeys – DEPRECATED The key list that triggers a re-walk
- requestid – request id to retrieve data objects from ObjectDB
- logger – inherit a logger from a module
-
main
()¶ Main coroutine
-
reset_initialkeys
(keys, values)¶ Callback after walk complete, can be used to update self._initialkeys.
-
restart_walk
()¶ Force a re-walk
-
shouldupdate
(newvalues, updatedvalues)¶ Callback when upate. Rewrite this method to ignore some updates.
If this callback returns False, the update is ignored.
-
updateflow
(connection, addvalues, removevalues, updatedvalues)¶ Update flow callback. When data objects are updated (either by a re-walk or by a direct update), this method is called with the modification, after the last updateflow() call ends.
-
updateobjects
(updatedvalues)¶ Force a update notification on specified objects, even if they are not actually updated in ObjectDB
-
walkcomplete
(keys, values)¶ Async callback after walk complete, before flow update
-
-
class
vlcp.utils.flowupdater.
FlowUpdaterNotification
(*args, **kwargs)¶ These notifications are edge triggered - they work with identifiers and set