org.jclouds.savvis.vpdc.binders
Class BaseBindVMSpecToXmlPayload<T>

java.lang.Object
  extended by org.jclouds.rest.binders.BindToStringPayload
      extended by org.jclouds.savvis.vpdc.binders.BaseBindVMSpecToXmlPayload<T>
All Implemented Interfaces:
Binder, MapBinder
Direct Known Subclasses:
BindVMSpecsToXmlPayload, BindVMSpecToXmlPayload

public abstract class BaseBindVMSpecToXmlPayload<T>
extends BindToStringPayload
implements MapBinder

Author:
Adrian Cole

Constructor Summary
BaseBindVMSpecToXmlPayload()
           
 
Method Summary
protected  void addOperatingSystemAndVirtualHardware(VMSpec spec, com.jamesmurty.utils.XMLBuilder vAppBuilder)
           
protected abstract  void bindSpec(T spec, com.jamesmurty.utils.XMLBuilder rootBuilder)
           
<R extends HttpRequest>
R
bindToRequest(R request, Map<String,String> postParams)
          creates and binds the POST payload to the request using parameters specified.
<R extends HttpRequest>
R
bindToRequest(R request, Object toBind)
           
protected  com.jamesmurty.utils.XMLBuilder buildChildren(com.jamesmurty.utils.XMLBuilder rootBuilder)
           
protected  com.jamesmurty.utils.XMLBuilder buildRoot()
           
protected  com.jamesmurty.utils.XMLBuilder buildRootForName(com.jamesmurty.utils.XMLBuilder rootBuilder, String name)
           
protected  void checkSpec(VMSpec spec)
           
protected abstract  T findSpecInArgsOrNull(GeneratedHttpRequest<?> gRequest)
           
 String generateXml(T spec)
           
protected  String ifNullDefaultTo(String value, String defaultValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseBindVMSpecToXmlPayload

public BaseBindVMSpecToXmlPayload()
Method Detail

bindToRequest

public <R extends HttpRequest> R bindToRequest(R request,
                                               Object toBind)
Specified by:
bindToRequest in interface Binder
Overrides:
bindToRequest in class BindToStringPayload

findSpecInArgsOrNull

protected abstract T findSpecInArgsOrNull(GeneratedHttpRequest<?> gRequest)

bindToRequest

public <R extends HttpRequest> R bindToRequest(R request,
                                               Map<String,String> postParams)
Description copied from interface: MapBinder
creates and binds the POST payload to the request using parameters specified.

Specified by:
bindToRequest in interface MapBinder
See Also:
PayloadParam

generateXml

public String generateXml(T spec)

bindSpec

protected abstract void bindSpec(T spec,
                                 com.jamesmurty.utils.XMLBuilder rootBuilder)
                          throws ParserConfigurationException,
                                 FactoryConfigurationError
Throws:
ParserConfigurationException
FactoryConfigurationError

checkSpec

protected void checkSpec(VMSpec spec)

addOperatingSystemAndVirtualHardware

protected void addOperatingSystemAndVirtualHardware(VMSpec spec,
                                                    com.jamesmurty.utils.XMLBuilder vAppBuilder)

buildRoot

protected com.jamesmurty.utils.XMLBuilder buildRoot()
                                             throws ParserConfigurationException,
                                                    FactoryConfigurationError
Throws:
ParserConfigurationException
FactoryConfigurationError

buildChildren

protected com.jamesmurty.utils.XMLBuilder buildChildren(com.jamesmurty.utils.XMLBuilder rootBuilder)
                                                 throws ParserConfigurationException,
                                                        FactoryConfigurationError
Throws:
ParserConfigurationException
FactoryConfigurationError

buildRootForName

protected com.jamesmurty.utils.XMLBuilder buildRootForName(com.jamesmurty.utils.XMLBuilder rootBuilder,
                                                           String name)
                                                    throws ParserConfigurationException,
                                                           FactoryConfigurationError
Throws:
ParserConfigurationException
FactoryConfigurationError

ifNullDefaultTo

protected String ifNullDefaultTo(String value,
                                 String defaultValue)


Copyright © 2009-2012 jclouds. All Rights Reserved.