Skip to main content

Presence and XCAP Client RA

28 replies [Last post]
ivelin
Offline
Joined: 2003-07-13

After several interesting discussions with Eduardo, I would like to open the topic to a wider audience.

What should an XCAP Client RA look like?

The purpose of the RA would be to allow presence aware applications to connect to a hosting XCAP server.

Would it be appropriate to create an RA type using the Java Presence API (JSR 186)?
http://jcp.org/en/jsr/detail?id=186

Would such approach allow portability of apps between XCAP, LDAP, XMPP, etc. or it will be too limiting? Do we need to focus on a XCAP specific Client RA and write protocol agnostic Presence enablers on top of that?

Anyone who has some experience with presence protocols and API, please share your thoughts.

Ivelin

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ivelin
Offline
Joined: 2003-07-13

> Yes, the URIs don't need to be bound with the RA
> interface, but they need to be easy to construct for
> service usage. The client API I have been developing,
> mostly this weekend, already has a XCAPClient
> interface that is a very good candidate for the RA
> Sbb Interface, and already has a very easy to work
> URI key object scheme. It will be published along
> with the server, so it's a little more days and
> should be available.
>
> By the way, I also already have a UML specification
> for the implementation of the RA, so what is left is
> mainly the activity specification, and then the
> implementation code, which it's the easy part :-)

Thats a mouthful. Can't wait to see it.

ivelin
Offline
Joined: 2003-07-13

Its good to see progress on this one. Comments:

> 5. get xml document element extension identified by URI

What is "xml document element extension"?

On the definition of valid XCAP URI. Can we not use a more rigorous and concise definition using a notation like regex or xpath?

Ivelin

eduardomartins
Offline
Joined: 2005-10-10

Lets break one URI example:

http://xcap.example.org/resource-lists/users/sip:ivelin@example.org/index/~~/resource-lists/list[@name="friends"]

becomes:

XCAP Root: http://xcap.example.org

Document Selector: resource-lists/users/sip:ivelin@example.org/index

The document selector identifies where in the xcap tree is the document. In this example it selects document named "index" from user "sip:ivelin@example.org", for the application usage with id (the auid) "resource-lists"

Node Selector: resource-lists/list[@name="friends"]

The node selector is used to select an element, attribute or namespace bindings, and the semantic is a xpath subset. In this example it selects the element "resource-lists/list" with attribute "name" with value "friends"

In my opinion we can support the 3 levels for URI and Resource detail, in the sbb ra interface.

Eduardo

ivelin
Offline
Joined: 2003-07-13

this breakdown helps.

Since we are discussing a client XCAP RA, what difference does it make what the URI is? Isn't the RA simply going to take an URI and ask an XCAP server to work with it.

The client RA would potentially care about the result - possibly mapping the XML response from the XCAP server to application specific POJOs.

What would the SBB Interface look like for the XCAP RA Type?

Ivelin

eduardomartins
Offline
Joined: 2005-10-10

Yes, the URIs don't need to be bound with the RA interface, but they need to be easy to construct for service usage. The client API I have been developing, mostly this weekend, already has a XCAPClient interface that is a very good candidate for the RA Sbb Interface, and already has a very easy to work URI key object scheme. It will be published along with the server, so it's a little more days and should be available.

By the way, I also already have a UML specification for the implementation of the RA, so what is left is mainly the activity specification, and then the implementation code, which it's the easy part :-)

eduardomartins
Offline
Joined: 2005-10-10

For a fast availability there is the possibility to consider the RA without events, that is, all requests have synchronous responses.

ivelin
Offline
Joined: 2003-07-13

probably not a good idea to block SBBs on remote calls.

eduardomartins
Offline
Joined: 2005-10-10

XCAP Client RA specification published at http://groups.google.com/group/mobicents-public/web/xcap-client-resource...

If this is something that is or may be, in the near future, interesting for you or your company, please take a look at it and provide feedback, now it's the time to close the specification since I will start developing it soon.

Eduardo

ivelin
Offline
Joined: 2003-07-13

Thanks, Eduardo. Without several more thorough examples for each of the key interface methods it is hard to understand how they are expected to behave.

eduardomartins
Offline
Joined: 2005-10-10

I added an example on the bottom, one playing with a user document key. The rest is straigthforward, it's a matter of adding an element selector, an attribute selector, etc, depending on what type of key you are building. See how the keys depend on the selectors in the class diagram.

You can also check the packages org.openxdm.xcap.client.test.* on openxdm.org for all key usages, since those contain junit tests for the whole xcap client use cases.

ivelin
Offline
Joined: 2003-07-13

After an offline discussion and another review of the wiki, I am starting to understand the design. It seems to make sense. Its a good idea giving developers the choice of sync vs async request. A few end-to-end examples that can be executed against any compliant XCAP server would be helpful.

Ivelin

eduardomartins
Offline
Joined: 2005-10-10

Ok, big update on the interface and activities. Now it has a huuuge sbb ra interface, some methods are for babies, others for old people, everyone gets something.

Kidding, the reason for this explosion of the put,get,delete methods is because not every key is allowed to do everything, so instead of implementing checks and exceptions, the ra presents an interface that do not allow the developer to make such a mistake. It's big but I think it's a better interface.

The activity now became 5 activities, one binded for each type of Uri Key, and each one provides the interface to send async requests that are allowed with the binded key.

Please check http://groups.google.com/group/mobicents-public/web/xcap-client-resource... for more details and a brief explanation on what it provides and how it works. Go easy.

The RA is now on the mobicents cvs, an example is on mobicents-examples cvs. You can use the xcap server on www.openxdm.org, the project and prototype is not yet public or well documented, but you can perhaps try it and let me now how it works. Have fun.

PS: For the service example you will probably need to provision the user. If you use openxdm you have a ant target on the main build that you can use.

jbemmel
Offline
Joined: 2005-03-01

Is it really needed to have both the "String" and the "byte[]" content versions of (almost) each method?

Why not use 'Object' and have the implementation detect whether a String or byte[] is used (and perhaps by convention use 'toString' on the object in case it's something else)

This would reduce the size a bit

Regards,
Jeroen

eduardomartins
Offline
Joined: 2005-10-10

Hi, as I said, it's such a big interface. And it didn't start it like that!!!!

First, it's not for almost everything, it's just for PUT requests without marshalling ;-)

Now seriously, the reason is simple, I'm using Apache Http Client to send request/receive responses, and the consider the content to be either String or byte array (in the form of entities).

When I'm working on a higher level API I usually prefer to provide the same options of the underlying lower level API, the same way I prefer to throw the same exceptions, instead of wrapping them in a higher level one, which then can be a good thing, or not, I've whitness both.

Another reason is that XCAP requires UTF-8 so I consider the String to be a higher level option for developers, because they don't need to convert the String (or anything else) to a UTF-8 byte array. As for the byte array, if a developer wishes to use it's own marshalling or perhaps some DOM API, usually a byte array is better for perfomance.

Do this convince you, or I am worrying to much? For sure I could just request a byte array but in a big api is it a big issue to have 3 more methods?

Thanks for looking at it, it's not an easy one.

Eduardo

parryfogat
Offline
Joined: 2007-08-22

Hi Eduardo,

Is the source code of XCAP server i.e. XDM available? If yes, then from where can I download the same?

Regards,
parry

abhayani
Offline
Joined: 2005-04-04

You can find everything about Open XDM here https://openxdm.dev.java.net/

Source -> https://openxdm.dev.java.net/source/browse/openxdm/

amit.bhayani

parryfogat
Offline
Joined: 2007-08-22

Hi,

Thanks a lot for the source code link. But sorry to mention that I tried getting the same through TortoiseSVN (CVS tool), but the server connect failed each time. Is it possible to get the zip file of the total latest source or any other way u suggest?

Thanks,
parry

eduardomartins
Offline
Joined: 2005-10-10

Try https://openxdm.dev.java.net/svn/openxdm/trunk on tortoise, then you need to authenticate with your java.net username (parryfogat) and password.

parryfogat
Offline
Joined: 2007-08-22

Hi,

Thanks a lot for the reference. I am able to install and run the XDM server with tomcat6. But I am stuck at the usage, as to what URI I should give in the browser to access the resource i.e. resource-lit etc.

Can you please provide me a sample URI for accessing any sample xml document? Also provide me the sample xml resource document and the location, where it has to be placed.

I have another query.. Do we have any stable version of JSLEE compatible xdm?

Thanks in anticipation.

Regards, Parry

eduardomartins
Offline
Joined: 2005-10-10

There is no sample data, but that's a good idea. Pls open a new enhance issue in https://openxdm.dev.java.net/issues/enter_bug.cgi

As for JAIN SLEE version, the current svn head is stable, we will add build and run instructions asap.

parryfogat
Offline
Joined: 2007-08-22

Hi,

I tried testing the PutNewDocumentTest, but getting the following errors. Can someone please provide me support in this regard.

Sep 1, 2007 1:28:41 PM org.openxdm.xcap.client.XCAPClientImpl put
INFO: put(key=/resource-lists/users/sip%3Abob%40example.com/index, mimetype=application/resource-lists+xml, content=
)
Sep 1, 2007 1:28:42 PM org.openxdm.xcap.client.XCAPClientImpl getResponse
INFO: Received:
--BEGIN--
Response {
Code: 409
Headers: Server=Apache-Coyote/1.1, Content-Length=175, Date=Sat, 01 Sep 2007 07:58:42 GMT
Content: http://localhost:8888/xcap
}
--END--
Sep 1, 2007 1:28:42 PM org.openxdm.xcap.client.XCAPClientImpl shutdown
INFO: shutdown()

Regards,
Parry

parryfogat
Offline
Joined: 2007-08-22

Hi Eduardo,
I am able to run the PutNewDocumentTest.
Moving on, I have another query i.e. In the XDM architecture, I could see a "Subscription Manager" (https://openxdm.dev.java.net/servlets/ProjectProcess?tab=2) , which I hope will do some of the processing of Presence stuff.

May I know what will be the role of Subscription Manager and how it can be used in making the presence service using XCAP.

Regards,
Parvinder

eduardomartins
Offline
Joined: 2005-10-10

The Subscription Manager handles the SIP subscriptions to updates on documents through XCAP, as an example, it's used by the Presence Service to know when the presence authorizaton rules of user X are updated, to allow or deny subscriptions.

So what was the issue with the junit test? And are you running the tomcat prototype or the jain slee server?

parryfogat
Offline
Joined: 2007-08-22

Thanks for the reply Eduardo.

Actually for the junit test case PutNewDocumentTest to run, I need to change something in the function:
public DocumentCollection getDocumentCollection(String collectionName) (XMLDBDataSource.java)

as there was a parse error, extra '/' was coming, due to which the collection was not found. I don't know whether it is machine specific or something else, but I need to change and then only the collection was found and test case was executed.

I was running the Tomcat prototype.
Now I need to run the JSLEE version of XDM, but I cannot build it.
Did you added the build procedure for JSLEE version of XCAP?

Also, Is the Subscription Manager being completed or under development.?

Thanks a lot for your help.

Regards,
Parvinder

eduardomartins
Offline
Joined: 2005-10-10

Sip notifier development just started, and still on specs because we want a modular and configurable component, to be later reused for a presence server, conference server or whatever IMS/OMA functional element makes usage of subscriptions.

I added a post in OpenXDM forum with instructions for building the JAIN SLEE version:

https://openxdm.dev.java.net/servlets/ProjectForumMessageView?forumID=26...

eduardomartins
Offline
Joined: 2005-10-10

Ok, lets try to push this further.

The RA has 3 use cases:

1. get resource identified by URI
2. put resource in URI
3. delete resource identified by URI

Developing what a resource is:

1. get xml document identified by URI
2. get xml document element identified by URI
3. get xml document attribute identified by URI
4. get xml document element namespace bindings identified by URI
5. get xml document element extension identified by URI

6. put xml document in URI
7. put xml document element in URI
8. put xml document attribute in URI

9. delete xml document identified by URI
10. delete xml document element identified by URI
11. delete xml document attribute identified by URI

Developing what a URI is:

1. get xml document identified by XCAP Root URI, Application Usage ID and Document Selector
2. get xml document element identified by XCAP Root URI, Application Usage ID, Document Selector and Element Selector
3. get xml document attribute identified by XCAP Root URI, Application Usage ID, Document Selector, Element Selector and Attribute Selector
4. get xml document element namespace bindings identified by XCAP Root URI, Application Usage ID, Document Selector, Element Selector and Namespace Selector
5. get xml document element extension identified by XCAP Root URI, Application Usage ID, Document Selector, Element Selector and Extension Selector

6. put xml document in XCAP Root URI, Application Usage ID and Document Selector
7. put xml document element in XCAP Root URI, Application Usage ID, Document Selector and Element Selector
8. put xml document attribute in XCAP Root URI, Application Usage ID, Document Selector, Element Selector and Attribute Selector

9. delete xml document identified by XCAP Root URI, Application Usage ID and Document Selector
10. delete xml document element identified by XCAP Root URI, Application Usage ID, Document Selector and Element Selector
11. delete xml document attribute identified by XCAP Root URI, Application Usage ID, Document Selector, Element Selector and Attribute Selector

Once I have time to finish the server, I can lead this one, since I already have a kind of client API.

If anyone is interested on XCAP please let me know, any help is appreciated :-)

PS: The XCAP Client RA can be used for much more than just presence.

eduardomartins
Offline
Joined: 2005-10-10

One bug above, app usage ID already belongs to document selector.

Those selectors on the XCAP URI must be developed too, probably not on a first version.

ivelin
Offline
Joined: 2003-07-13

I've had several offline conversations with folks more knowledgeable on the subject of presence. Its worth looking at implementing a basic service enabler for presence based on jsr 186. An issue has been open in bugzilla to track progress.

https://mobicents.dev.java.net/issues/show_bug.cgi?id=102