org.jclouds.vcloud.terremark.binders
Class BindVAppConfigurationToXmlPayload

java.lang.Object
  extended by org.jclouds.vcloud.terremark.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)
           
 void bindToRequest(HttpRequest request, Map<String,String> postParams)
           
 void bindToRequest(HttpRequest request, Object input)
           
protected  com.jamesmurty.utils.XMLBuilder buildRoot(VCloudExpressVApp vApp, String name)
           
protected  VAppConfiguration findConfigInArgsOrNull(GeneratedHttpRequest<?> gRequest)
           
protected  VCloudExpressVApp findVAppInArgsOrNull(GeneratedHttpRequest<?> gRequest)
           
protected  String generateXml(VCloudExpressVApp 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 void bindToRequest(HttpRequest request,
                          Map<String,String> postParams)
Specified by:
bindToRequest in interface MapBinder

generateXml

protected String generateXml(VCloudExpressVApp vApp,
                             VAppConfiguration configuration)
                      throws ParserConfigurationException,
                             FactoryConfigurationError,
                             TransformerException
Throws:
ParserConfigurationException
FactoryConfigurationError
TransformerException

buildRoot

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

findVAppInArgsOrNull

protected VCloudExpressVApp findVAppInArgsOrNull(GeneratedHttpRequest<?> gRequest)

findConfigInArgsOrNull

protected VAppConfiguration findConfigInArgsOrNull(GeneratedHttpRequest<?> gRequest)

bindToRequest

public void bindToRequest(HttpRequest 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-2010 jclouds. All Rights Reserved.