changeset 111:30c580286d27

Add documentation.
author Ralph Meijer <ralphm@ik.nu>
date Fri, 08 Apr 2005 16:30:26 +0000
parents 7043839982ba
children 72c8812fa1b5
files idavoll/storage.py
diffstat 1 files changed, 55 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/idavoll/storage.py	Fri Apr 08 10:17:10 2005 +0000
+++ b/idavoll/storage.py	Fri Apr 08 16:30:26 2005 +0000
@@ -1,4 +1,5 @@
 from zope.interface import Interface
+from twisted.words.protocols.jabber import jid
 
 class Error(Exception):
     msg = None
@@ -12,25 +13,72 @@
 
 
 class IStorage(Interface):
-    """ """
+    """ Storage interface """
 
     def get_node(self, node_id):
-        """ """
+        """ Get Node.
+
+        @param node_id: NodeID of the desired node.
+        @type node_id: L{str}
+        @return: deferred that returns a L{Node} object.
+        """
 
     def get_node_ids(self):
-        """ """
+        """ Return all NodeIDs.
+        
+        @return: deferred that returns a list of NodeIDs (L{str}).
+        """
 
     def create_node(self, node_id, owner, config = None, type='leaf'):
-        """ """
+        """ Create new node.
+
+        The implementation should make sure, the passed owner JID is stripped
+        of the resource (e.g. using C{owner.userhostJID()}).
+
+        @param node_id: NodeID of the new node.
+        @type node_id: L{str}
+        @param owner: JID of the new nodes's owner. 
+        @type owner: L{jid.JID}
+        @param config: Configuration
+        @param type: Node type. Can be either C{'leaf'} or C{'collection'}.
+        @return: deferred that fires on creation.
+        """
 
     def delete_node(self, node_id):
-        """ """
+        """ Delete a node.
+
+        @param node_id: NodeID of the new node.
+        @type node_id: L{str}
+        @return: deferred that fires on deletion.
+        """
 
     def get_affiliations(self, entity):
-        """ """
+        """ Get all affiliations for entity.
+        
+        The implementation should make sure, the passed owner JID is stripped
+        of the resource (e.g. using C{owner.userhostJID()}).
+        
+        @param entity: JID of the entity.
+        @type entity: L{jid.JID}
+        @return: deferred that returns a L{list} of tuples of the form
+                 C{(node_id, affiliation)}, where C{node_id} is of the type
+                 L{str} and C{affiliation} is one of C{'owner'}, C{'publisher'}
+                 and C{'outcast'}.
+        """
 
     def get_subscriptions(self, entity):
-        """ """
+        """ Get all subscriptions for an entity.
+        
+        The implementation should make sure, the passed owner JID is stripped
+        of the resource (e.g. using C{owner.userhostJID()}).
+
+        @param entity: JID of the entity.
+        @type entity: L{jid.JID}
+        @return: deferred that returns a L{list} of tuples of the form
+                 C{(node_id, subscriber, state)}, where C{node_id} is of the
+                 type L{str}, C{subscriber} of the type {jid.JID}, and
+                 C{state} is C{'subscribed'} or C{'pending'}.
+        """
 
 
 class INode(Interface):