[jdev] XMPP-PubSub vs. remoteStorag

Tobias Kräntzer info at tobias-kraentzer.de
Mon Sep 1 19:12:21 UTC 2014


Hi all,

I not sure, which list fits more (jdev or juser). I’ll try it here.

I’m planning to build a module that combines XMPP-PubSub with remoteStorage [1]. The idea is to have HTTP-based clients which can store any files via the remoteStorage „Protocol“ (which is in the end just a few GET, PUT, DELETE request with a defined semantic of If-Match and If-Not-Match). On the other side it should be possible to access the collection via an XMPP-PubSub. The XMPP side should be used to get notifications about changes of various collections without monitoring each collection separately.

The question is, how should the items in the collections be mapped between the two APIs. remoteStorage is tree based and PubSub is somehow „list-based“.

service.example.com
├── folder A
│   ├── item 1
│   ├── item 2
│   ├── subfolder u
│   │   └── item x
│   └── subfolder v
│       └── item 7
├── folder B
│   ├── subfolder u
│   │   └── item x
│   └── item 1
├── folder C
│   └── item y
├── item 1
└── item 2

My first idea was to represent the folders as nodes and the files as items and use collection nodes to represent a folder hierarchy. Having this, „folder A“ would be a collection node with the sub nodes „subfolder u“ and subfolder v“ and the items „item 1“ and „item 2“.

But this does not conform to the specification as a collection can only contain other collections and nodes but no items. Also there would be a naming problem. If I understand the specification correctly, the node id must be unique in the scope of the service (service.example.com) and not in the scope of the parent node. Thus the id „subfolder u“ can not be used without the prefix of the parent folder in it’s name.  

I could build an service, that is not compliant to the specification, which I don’t like. Or I could define another node type (e.g., tree), which could have implications on the request to the service …

Any thoughts about this are appreciated.

Cheers,
Tobias

[1] <http://tools.ietf.org/html/draft-dejong-remotestorage-03>

--
Tobias Kräntzer
Grünberger Straße 40 | 10245 Berlin

+49-178-1353136
xmpp:info at tobias-kraentzer.de
https://tobias-kraentzer.de
Twitter: @anagrom_ataf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20140901/4fac6c8f/attachment.sig>


More information about the JDev mailing list