Mercurial > libervia-pubsub
annotate idavoll/backend.py @ 25:256dcda26752
Bugfix: use 'event' element instead of 'x' for notifications.
Changed adapter registration to reflect name change of backend.IService.
author | Ralph Meijer <ralphm@ik.nu> |
---|---|
date | Sun, 17 Oct 2004 13:53:01 +0000 |
parents | 4f3bbefc6fad |
children | d4fc29bb5381 |
rev | line source |
---|---|
24
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
1 from twisted.python import components |
1 | 2 |
24
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
3 class IService(components.Interface): |
1 | 4 """ Interface to a backend service of a pubsub service """ |
5 | |
2 | 6 def do_publish(self, node, publisher, item): |
7 """ Returns a deferred that returns """ | |
8 | |
24
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
9 class Error(Exception): |
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
10 msg = '' |
1 | 11 |
12 def __str__(self): | |
13 return self.msg | |
14 | |
24
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
15 class NodeNotFound(Error): |
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
16 msg = 'Node not found' |
1 | 17 |
24
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
18 class NotAuthorized(Error): |
20
eddea65d1032
Added two exceptions: NoInstantNodes and NodeExists.
Ralph Meijer <ralphm@ik.nu>
parents:
18
diff
changeset
|
19 pass |
eddea65d1032
Added two exceptions: NoInstantNodes and NodeExists.
Ralph Meijer <ralphm@ik.nu>
parents:
18
diff
changeset
|
20 |
24
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
21 class PayloadExpected(Error): |
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
22 msg = 'Payload expected' |
15 | 23 |
24
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
24 class NoPayloadAllowed(Error): |
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
25 msg = 'No payload allowed' |
2 | 26 |
24
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
27 class NoInstantNodes(Error): |
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
28 pass |
23
884268687229
Simplify call chain by mapping incoming requests directly to method
Ralph Meijer <ralphm@ik.nu>
parents:
20
diff
changeset
|
29 |
24
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
30 class NodeExists(Error): |
4f3bbefc6fad
Moved memory backend to its own file.
Ralph Meijer <ralphm@ik.nu>
parents:
23
diff
changeset
|
31 pass |