org.jclouds.vcloud.binders
Class BindInstantiateVAppTemplateParamsToXmlPayload

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

@Singleton
public class BindInstantiateVAppTemplateParamsToXmlPayload
extends Object
implements MapBinder

Author:
Adrian Cole

Nested Class Summary
static class BindInstantiateVAppTemplateParamsToXmlPayload.DefaultNetworkNameInTemplate
           
protected static class BindInstantiateVAppTemplateParamsToXmlPayload.NetworkConfigDecorator
           
 
Field Summary
protected  VCloudClient client
           
protected  FenceMode defaultFenceMode
           
protected  ReferenceType defaultNetwork
           
protected  BindInstantiateVAppTemplateParamsToXmlPayload.DefaultNetworkNameInTemplate defaultNetworkNameInTemplate
           
protected  String ns
           
protected  String schema
           
protected  BindToStringPayload stringBinder
           
 
Constructor Summary
BindInstantiateVAppTemplateParamsToXmlPayload(BindInstantiateVAppTemplateParamsToXmlPayload.DefaultNetworkNameInTemplate defaultNetworkNameInTemplate, BindToStringPayload stringBinder, String ns, String schema, ReferenceType network, String fenceMode, VCloudClient client)
           
 
Method Summary
protected  void addCustomizationConfig(com.jamesmurty.utils.XMLBuilder instantiationParamsBuilder, Boolean customizeOnInstantiate)
           
protected  void addNetworkConfig(com.jamesmurty.utils.XMLBuilder instantiationParamsBuilder, Iterable<? extends NetworkConfig> networkConfig)
           
<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 description, boolean deploy, boolean powerOn, URI template, Iterable<? extends NetworkConfig> networkConfig, Boolean customizeOnInstantiate)
           
static
<T> T
ifNullDefaultTo(T value, T 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

stringBinder

protected final BindToStringPayload stringBinder

defaultNetwork

protected final ReferenceType defaultNetwork

defaultFenceMode

protected final FenceMode defaultFenceMode

defaultNetworkNameInTemplate

protected final BindInstantiateVAppTemplateParamsToXmlPayload.DefaultNetworkNameInTemplate defaultNetworkNameInTemplate

client

protected final VCloudClient client
Constructor Detail

BindInstantiateVAppTemplateParamsToXmlPayload

@Inject
public BindInstantiateVAppTemplateParamsToXmlPayload(BindInstantiateVAppTemplateParamsToXmlPayload.DefaultNetworkNameInTemplate defaultNetworkNameInTemplate,
                                                            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,
                                                            VCloudClient client)
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,
                             @Nullable
                             String description,
                             boolean deploy,
                             boolean powerOn,
                             URI template,
                             Iterable<? extends NetworkConfig> networkConfig,
                             @Nullable
                             Boolean customizeOnInstantiate)
                      throws ParserConfigurationException,
                             FactoryConfigurationError,
                             TransformerException
Throws:
ParserConfigurationException
FactoryConfigurationError
TransformerException

addCustomizationConfig

protected void addCustomizationConfig(com.jamesmurty.utils.XMLBuilder instantiationParamsBuilder,
                                      Boolean customizeOnInstantiate)

addNetworkConfig

protected void addNetworkConfig(com.jamesmurty.utils.XMLBuilder instantiationParamsBuilder,
                                Iterable<? extends NetworkConfig> networkConfig)

buildRoot

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

findOptionsInArgsOrNull

protected InstantiateVAppTemplateOptions findOptionsInArgsOrNull(GeneratedHttpRequest<?> gRequest)

bindToRequest

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

ifNullDefaultTo

public static <T> T ifNullDefaultTo(T value,
                                    T defaultValue)


Copyright © 2009-2011 jclouds. All Rights Reserved.