Ignore:
Timestamp:
Oct 27, 2008, 2:21:23 PM (13 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Convert:
svn:b33ecbfc-034c-dc11-8662-000475d9059e/trunk@127
Message:

Add support for sending and receiving node delete notifications with redirect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/pubsub.py

    r33 r43  
    246246    """
    247247
     248    redirectURI = None
     249
    248250
    249251
     
    303305        nodeIdentifier = action["node"]
    304306        event = DeleteEvent(sender, recipient, nodeIdentifier, headers)
     307        if action.redirect:
     308            event.redirectURI = action.redirect.getAttribute('uri')
    305309        self.deleteReceived(event)
    306310
     
    966970
    967971
    968     def notifyDelete(self, service, nodeIdentifier, subscriptions):
    969         for subscription in subscriptions:
     972    def notifyDelete(self, service, nodeIdentifier, subscribers,
     973                           redirectURI=None):
     974        for subscriber in subscribers:
    970975            message = self._createNotification('delete', service,
    971976                                               nodeIdentifier,
    972                                                subscription.subscriber)
     977                                               subscriber)
     978            if redirectURI:
     979                redirect = message.event.delete.addElement('redirect')
     980                redirect['uri'] = redirectURI
    973981            self.send(message)
    974982
     
    10101018
    10111019
    1012     def getDefaultConfiguration(self, requestor, service):
     1020    def getDefaultConfiguration(self, requestor, service, nodeType):
    10131021        raise Unsupported('retrieve-default')
    10141022
Note: See TracChangeset for help on using the changeset viewer.