xapi-project/xen-api-sdk — pull request #10 by xueyuan (2013-11-14 14:52:37+00:00)
Title: Client side connection timeout and a check for if an object is null.

Here's code to add client side timeout for the java stubs. This timeout is defaulted to be 10 minutes and is meant to isolate the caller and xenserver in case there are problems in xenserver's side in processing the request. This allows the client to timeout on the client side and return an error back to the caller instead of tying up the thread waiting for a response that may never come. It is not meant as a retry mechanism.

The second commit adds a method to check if an object is actually null. When a XenAPIObject is null, the marshalling code does not set the object as null. It actually returns an object that contains the words "Opaque:NULL" in them. This method allows the caller to check this condition without writing the hard coded string themselves.