Exemple #1
0
class NotifyingStorage(database.Storage):
    def __init__(self):
        super(NotifyingStorage, self).__init__()
        self._sip_notifier = SIPNotifier()
        self.notifier = Notifier(ServerConfig.root,
                                 self._sip_notifier.send_publish)

    def put_document(self, uri, document, check_etag):
        d = super(NotifyingStorage, self).put_document(uri, document,
                                                       check_etag)
        d.addCallback(lambda result: self._on_put(result, uri))
        return d

    def _on_put(self, result, uri):
        if result.succeed:
            self.notifier.on_change(uri, result.old_etag, result.etag)
        return result

    def delete_document(self, uri, check_etag):
        d = super(NotifyingStorage, self).delete_document(uri, check_etag)
        d.addCallback(lambda result: self._on_delete(result, uri))
        return d

    def _on_delete(self, result, uri):
        if result.succeed:
            self.notifier.on_change(uri, result.old_etag, None)
        return result
Exemple #2
0
class NotifyingStorage(database.Storage):
    def __init__(self):
        super(NotifyingStorage, self).__init__()
        self._sip_notifier = SIPNotifier()
        self.notifier = Notifier(ServerConfig.root, self._sip_notifier.send_publish)

    def put_document(self, uri, document, check_etag):
        d = super(NotifyingStorage, self).put_document(uri, document, check_etag)
        d.addCallback(lambda result: self._on_put(result, uri))
        return d

    def _on_put(self, result, uri):
        if result.succeed:
            self.notifier.on_change(uri, result.old_etag, result.etag)
        return result

    def delete_document(self, uri, check_etag):
        d = super(NotifyingStorage, self).delete_document(uri, check_etag)
        d.addCallback(lambda result: self._on_delete(result, uri))
        return d

    def _on_delete(self, result, uri):
        if result.succeed:
            self.notifier.on_change(uri, result.old_etag, None)
        return result
Exemple #3
0
 def __init__(self):
     super(NotifyingStorage, self).__init__()
     self._sip_notifier = SIPNotifier()
     self.notifier = Notifier(ServerConfig.root,
                              self._sip_notifier.send_publish)
Exemple #4
0
 def __init__(self):
     self._database = DatabaseConnection()
     self._provisioning = XCAPProvisioning()
     self._sip_notifier = SIPNotifier()
     self._notifier = Notifier(ServerConfig.root,
                               self._sip_notifier.send_publish)
Exemple #5
0
 def __init__(self):
     super(NotifyingStorage, self).__init__()
     self._sip_notifier = SIPNotifier()
     self.notifier = Notifier(ServerConfig.root, self._sip_notifier.send_publish)
Exemple #6
0
 def __init__(self):
     BaseStorage.__init__(self)
     self.notifier = Notifier(ServerConfig.root, self._mi.publish_xcapdiff)
Exemple #7
0
 def __init__(self):
     BaseStorage.__init__(self)
     self.notifier = Notifier(ServerConfig.root, self._mi.publish_xcapdiff)