org.jclouds.trmk.vcloud_0_8.binders
Class BindVAppConfigurationToXmlPayload

java.lang.Object
  extended by org.jclouds.trmk.vcloud_0_8.binders.BindVAppConfigurationToXmlPayload
All Implemented Interfaces:
com.google.common.base.Function<Object,URI>, Binder, MapBinder

@Singleton
public class BindVAppConfigurationToXmlPayload
extends Object
implements MapBinder, com.google.common.base.Function<Object,URI>

Author:
Adrian Cole

Field Summary
protected  String apiVersion
           
protected  String ns
           
protected  String schema
           
protected  BindToStringPayload stringBinder
           
 
Constructor Summary
BindVAppConfigurationToXmlPayload(String apiVersion, BindToStringPayload stringBinder, String ns, String schema)
           
 
Method Summary
 URI apply(Object from)
           
<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(VApp vApp, String name)
           
protected  VAppConfiguration findConfigInArgsOrNull(GeneratedHttpRequest<?> gRequest)
           
protected  VApp findVAppInArgsOrNull(GeneratedHttpRequest<?> gRequest)
           
protected  String generateXml(VApp vApp, VAppConfiguration configuration)
           
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
 
Methods inherited from interface com.google.common.base.Function
equals
 

Field Detail

ns

protected final String ns

schema

protected final String schema

stringBinder

protected final BindToStringPayload stringBinder

apiVersion

protected final String apiVersion
Constructor Detail

BindVAppConfigurationToXmlPayload

@Inject
public BindVAppConfigurationToXmlPayload(@Named(value="jclouds.api-version")
                                                String apiVersion,
                                                BindToStringPayload stringBinder,
                                                @Named(value="jclouds.vcloud.xml.ns")
                                                String ns,
                                                @Named(value="jclouds.vcloud.xml.schema")
                                                String schema)
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(VApp vApp,
                             VAppConfiguration configuration)
                      throws ParserConfigurationException,
                             FactoryConfigurationError,
                             TransformerException
Throws:
ParserConfigurationException
FactoryConfigurationError
TransformerException

buildRoot

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

findVAppInArgsOrNull

protected VApp findVAppInArgsOrNull(GeneratedHttpRequest<?> gRequest)

findConfigInArgsOrNull

protected VAppConfiguration findConfigInArgsOrNull(GeneratedHttpRequest<?> gRequest)

bindToRequest

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

ifNullDefaultTo

protected String ifNullDefaultTo(String value,
                                 String defaultValue)

apply

public URI apply(Object from)
Specified by:
apply in interface com.google.common.base.Function<Object,URI>


Copyright © 2009-2011 jclouds. All Rights Reserved.