def add_verbose_message(self, msg):
pass
+
+class SwarmWriter(object):
+ """
+ Wrapper class for swarm storage write actions. Multiple *Access
+ objects may be added to the clas resulting in multiple storage types.
+ For example, adding a swarm could result in
+ * adding a table entry in a MySQL database (MySQLDatabaseAccess)
+ * adding a table entry in an SQLite database (SQLiteDatabaseAccess)
+ * adding a new folder in a tree structure (TreeTextFileAccess)
+ """
+
+ def __init__(self):
+ handlers = []
+
+ def add_access_handle(self, handle):
+ handlers.append(handle)
+
+ def remove_access_handle(self, handle):
+ handlers.remove(handle)
+
+ def add_swarm(self, swarm):
+ for h in handlers:
+ h.add_swarm(swarm)
+
+ def add_client_session(self, session):
+ for h in handlers:
+ h.add_client_session(swarm)
+
+ def add_peer_status_message(self, msg):
+ for h in handlers:
+ h.add_peer_status_message(swarm)
+
+ def add_status_message(self, msg):
+ for h in handlers:
+ h.add_status_message(swarm)
+
+ def add_verbose_message(self, msg):
+ for h in handlers:
+ h.add_verbose_message(swarm)