annotate doc/examples/idavoll.tac @ 222:698af5d720ad

Reshape Idavoll as a PubSubResource. PubSubResource is Wokkel's newer interface for building (parts of) XMPP publish-subscribe services and replaces the old interface of PubSubService. It is more flexible for adding new protocol, allows for node-as-code (providing a specific backend per node), and permits accepting requests for different entities (virtual hosts or PEP-like settings). This moves over the current backend to use the new interface, so new code for previously unsupported protocol can be added down the line.
author Ralph Meijer <ralphm@ik.nu>
date Sat, 16 Oct 2010 21:03:38 +0200
parents 5974e718f395
children 51af2ed8bd50
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
194
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
1 # Copyright (c) 2003-2008 Ralph Meijer
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
2 # See LICENSE for details.
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
3
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
4 """
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
5 Example TAC for Idavoll.
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
6 """
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
7
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
8 from twisted.application import service
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
9 from twisted.words.protocols.jabber.jid import JID
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
10
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
11 from idavoll import tap
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
12
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
13 application = service.Application("Idavoll")
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
14
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
15 config = {
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
16 'jid': JID('pubsub.example.org'),
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
17 'secret': 'secret',
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
18 'rhost': '127.0.0.1',
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
19 'rport': 5347,
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
20 'backend': 'memory',
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
21 'verbose': True,
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
22 'hide-nodes': False,
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
23 }
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
24
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
25 idavollService = tap.makeService(config)
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
26 idavollService.setServiceParent(application)
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
27
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
28 # Set the maximum delay until trying to reconnect.
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
29 componentService = idavollService.getServiceNamed('component')
5974e718f395 Check in missing file, also part of Idavoll 0.7.3.
Ralph Meijer <ralphm@ik.nu>
parents:
diff changeset
30 componentService.factory.maxdelay = 300