<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-AU link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi Tiago,<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>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.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Carsten<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> users-bounces@lists.opennebula.org
[mailto:users-bounces@lists.opennebula.org] <b>On Behalf Of </b>Tiago Batista<br>
<b>Sent:</b> Thursday, 7 October 2010 21:06<br>
<b>To:</b> Users@lists.opennebula.org<br>
<b>Subject:</b> [one-users] Alternative java bindings<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I am in the process of creating alternative java bindings
for OpenNebula. (Dont ask and I wont tell why!)<br>
<br>
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.<br>
<br>
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:<br>
<br>
Client client = new Client("username", "password", "<a
href="http://hostname:2633/RPC2">http://hostname:2633/RPC2</a>");<br>
VMOperations vmOps = new VMOperations(client);<br>
VmType vm = vmOps.info(id);<br>
<br>
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...<br>
<br>
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!<br>
<br>
What do you think of this?<o:p></o:p></p>
</div>
</body>
</html>