
VMware, Inc. 7
1
TheVMwarevCloudAPIprovidessupportfordeveloperswhoarebuildinginteractiveclientsofVMware
CloudDirectorusingaRESTfulapplicationdevelopmentstyle.vCloudAPIclientsandserverscommunicate
overHTTP,exchangingrepresentationsofvCloudobjects.TheserepresentationstaketheformofXML
elements.HTTPGETrequestsareusedtoretrievethecurrentrepresentationofanobject,HTTPPOSTand
PUTrequestsareusedtocreateormodifyanobject,andHTTPDELETErequestsaretypicallyusedtodelete
anobject.
ThevCloudSDKforJavaisaJavalanguagebindingforthevCloudAPI.ItusestheJAXBframeworktocreate
JavaclassesfortheresourcesdefinedinthevCloudAPIXMLschemas.ThevCloudSDKforJavaprovides
classesandmethodsthatencapsulatetheinterfaces,objects,andoperationssupportedbythevCloudAPI
whilepreservingitsRESTfulprogrammingstyleandcompatibilitywiththeHTTPprotocolfamily.
ThisvCloudSDKforJavaDeveloper’sGuideprovidesinformationaboutsettinguptheSDKinadevelopment
environment,andinformationaboutrunningthesampleapplicationsincludedintheSDK.
Thischapterincludesthesetopics:
“vCloudSDKforJavaDesign”onpage 7
“vCloudObjectTaxonomy”onpage 7
vCloud SDK for Java Design
ThevCloudSDKforJavaprovidesobject‐specificmethodsforcreating,updating,retrieving,anddeleting
objectsdefinedbythevCloudAPI.Italsoincludeswrapperclassesthatprovide:
HelpersforRESTcommunicationandJavaobjectrepresentationoftheXMLresourcesdefinedbythe
vCloudAPI.
Helpermethodsthatcanassistinclientdevelopment
EverywrapperclasshasmethodsthataccessvCloudAPIresourcesusingareference.Areferenceobject
containsthehref,resourcetype,andnameproperties.Staticmethodsgetresourcesdirectlybypassingthe
reference,andactasconstructorsorfactoriesforSDKwrapperobjects.
vCloud Object Taxonomy
ThevCloudSDKforJavadefinesasetofobjectscommontocloudcomputingenvironments.Figure 1‐1
illustratestheprincipalobjecttypes.
About the vCloud SDK for Java 1
NOTEThevCloudSDKforJavadoesnotprovideobjectlifecyclemanagement.Everywrapperobject
representstheresourceatthetimeoftheGEToperation.IfaclientmakesmultipleGETrequestsforthesame
resource,theclientreceivesmultiplerepresentationsoftheresourcewrappedinthehelperobject.Thereisno
automaticrefreshoftheclient‐siderepresentation.Itistheclient’sresponsibilitytomakenewrequeststoget
thelatestvalues.Toavoidmemoryleaks,theclientmustdisposeofobjectsthatarenotinuse.