org.jclouds.trmk.vcloud_0_8.binders
Class BindInstantiateVAppTemplateParamsToXmlPayload

java.lang.Object
  extended by org.jclouds.trmk.vcloud_0_8.binders.BindInstantiateVAppTemplateParamsToXmlPayload
All Implemented Interfaces:
Binder, MapBinder

@Singleton
public class BindInstantiateVAppTemplateParamsToXmlPayload
extends Object
implements MapBinder

Author:
Adrian Cole

Field Summary
protected  String ns
           
protected  String schema
           
protected  Map<ResourceAllocationSettingData.ResourceType,String> virtualHardwareToInstanceId
           
 
Constructor Summary
BindInstantiateVAppTemplateParamsToXmlPayload(BindToStringPayload stringBinder, String ns, String schema, ReferenceType network, String fenceMode)
           
 
Method Summary
protected  void addNetworkConfig(com.jamesmurty.utils.XMLBuilder instantiationParamsBuilder, String name, String fenceMode, URI network)
           
protected  void addVirtualQuantityIfPresent(com.jamesmurty.utils.XMLBuilder instantiationParamsBuilder, SortedMap<ResourceAllocationSettingData.ResourceType,String> virtualHardwareQuantity)
           
<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 input)
           
protected  com.jamesmurty.utils.XMLBuilder buildRoot(String name)
           
protected  InstantiateVAppTemplateOptions findOptionsInArgsOrNull(GeneratedHttpRequest<?> gRequest)
           
protected  String generateXml(String name, String template, SortedMap<ResourceAllocationSettingData.ResourceType,String> virtualHardwareQuantity, String networkName, String fenceMode, URI network)
           
protected  String ifNullDefaultTo(Object value, String defaultValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ns

protected final String ns

schema

protected final String schema

virtualHardwareToInstanceId

protected final Map<ResourceAllocationSettingData.ResourceType,String> virtualHardwareToInstanceId
Constructor Detail

BindInstantiateVAppTemplateParamsToXmlPayload

@Inject
public BindInstantiateVAppTemplateParamsToXmlPayload(BindToStringPayload stringBinder,
                                                            @Named(value="jclouds.vcloud.xml.ns")
                                                            String ns,
                                                            @Named(value="jclouds.vcloud.xml.schema")
                                                            String schema,
                                                            ReferenceType network,
                                                            @Named(value="jclouds.vcloud.defaults.fencemode")
                                                            String fenceMode)
Method Detail

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

protected String generateXml(String name,
                             String template,
                             SortedMap<ResourceAllocationSettingData.ResourceType,String> virtualHardwareQuantity,
                             String networkName,
                             @Nullable
                             String fenceMode,
                             URI network)
                      throws ParserConfigurationException,
                             FactoryConfigurationError,
                             TransformerException
Throws:
ParserConfigurationException
FactoryConfigurationError
TransformerException

addNetworkConfig

protected void addNetworkConfig(com.jamesmurty.utils.XMLBuilder instantiationParamsBuilder,
                                String name,
                                @Nullable
                                String fenceMode,
                                URI network)

buildRoot

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

bindToRequest

public <R extends HttpRequest> R bindToRequest(R request,
                                               Object input)
Specified by:
bindToRequest in interface Binder

ifNullDefaultTo

protected String ifNullDefaultTo(Object value,
                                 String defaultValue)

findOptionsInArgsOrNull

protected InstantiateVAppTemplateOptions findOptionsInArgsOrNull(GeneratedHttpRequest<?> gRequest)

addVirtualQuantityIfPresent

protected void addVirtualQuantityIfPresent(com.jamesmurty.utils.XMLBuilder instantiationParamsBuilder,
                                           SortedMap<ResourceAllocationSettingData.ResourceType,String> virtualHardwareQuantity)


Copyright © 2009-2012 jclouds. All Rights Reserved.