comparison idavoll/tap_http.py @ 185:9038908dc2f5

Add gateway support for retrieving items from a node. Reorder gateway module.
author Ralph Meijer <ralphm@ik.nu>
date Tue, 15 Apr 2008 17:32:56 +0000
parents c21b986cff30
children b4bf0a5ce50d
comparison
equal deleted inserted replaced
184:bd88658dbca3 185:9038908dc2f5
38 38
39 ss = RemoteSubscriptionService(config['jid']) 39 ss = RemoteSubscriptionService(config['jid'])
40 ss.setHandlerParent(cs) 40 ss.setHandlerParent(cs)
41 ss.startService() 41 ss.startService()
42 42
43 # Set up web service that exposes the backend using REST 43 # Set up web service
44 44
45 root = resource.Resource() 45 root = resource.Resource()
46
47 # Set up resources that exposes the backend
46 root.child_create = gateway.CreateResource(bs, config['jid'], 48 root.child_create = gateway.CreateResource(bs, config['jid'],
47 config['jid']) 49 config['jid'])
48 root.child_delete = gateway.DeleteResource(bs, config['jid'], 50 root.child_delete = gateway.DeleteResource(bs, config['jid'],
49 config['jid']) 51 config['jid'])
50 root.child_publish = gateway.PublishResource(bs, config['jid'], 52 root.child_publish = gateway.PublishResource(bs, config['jid'],
51 config['jid']) 53 config['jid'])
52 root.child_list = gateway.ListResource(bs) 54 root.child_list = gateway.ListResource(bs)
53 root.child_subscribe = gateway.SubscribeResource(ss) 55
54 root.child_unsubscribe = gateway.UnsubscribeResource(ss) 56 # Set up resources for accessing remote pubsub nodes.
57 root.child_subscribe = gateway.RemoteSubscribeResource(ss)
58 root.child_unsubscribe = gateway.RemoteUnsubscribeResource(ss)
59 root.child_items = gateway.RemoteItemsResource(ss)
55 60
56 site = server.Site(root) 61 site = server.Site(root)
57 w = internet.TCPServer(int(config['webport']), channel.HTTPFactory(site)) 62 w = internet.TCPServer(int(config['webport']), channel.HTTPFactory(site))
58 w.setServiceParent(s) 63 w.setServiceParent(s)
59 64