[one-users] Alternative java bindings

Carsten.Friedrich at csiro.au Carsten.Friedrich at csiro.au
Thu Oct 7 15:46:40 PDT 2010

Hi Tiago,

I did something similar some time ago (attached for your perusal, you need to add the JAXB libraries yourself). The binding of returned templates is a bit patchy, but it works well enough for me here. It supports most 2.0 features.


From: users-bounces at lists.opennebula.org [mailto:users-bounces at lists.opennebula.org] On Behalf Of Tiago Batista
Sent: Thursday, 7 October 2010 21:06
To: Users at lists.opennebula.org
Subject: [one-users] Alternative java bindings

I am in the process of creating alternative java bindings for OpenNebula. (Dont ask and I wont tell why!)

They are now at a very embrionary state, and I would like to expose them a little. There are some parts that are specific to my setup, and a lot of refactoring is required but most of the code is automatically generated.

I use JAXB to bind the xmlrpc responses to POJOs, and I use a catchall class to perform the required operations on the server. A usage example:

Client client = new Client("username", "password", "http://hostname:2633/RPC2");
VMOperations vmOps = new VMOperations(client);
VmType vm = vmOps.info(id);

This way, adding features is as simple as editing the apropriate xsd. By the way, extensions to the existing xsd, or new xsd files are welcome! With a little refactoring I think I can wrap the VmType that is read only on a class that allows some operations to be performed over it...

Also, this is better for environments where the data must be used across a network, as the classes (although not marked as such) should face no serialization problems. Even is none of the code seems useful, you should really consider replacing the standard Client class with a serializable one!

What do you think of this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20101008/0d064d60/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OneJaxbClient.zip
Type: application/x-zip-compressed
Size: 61680 bytes
Desc: OneJaxbClient.zip
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20101008/0d064d60/attachment-0003.bin>

More information about the Users mailing list