View Javadoc

1   /**
2    *
3    * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4    *
5    * ====================================================================
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   * http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   * ====================================================================
18   */
19  package org.jclouds.vcloud.binders;
20  
21  import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_XML_NAMESPACE;
22  import static org.jclouds.vcloud.reference.VCloudConstants.PROPERTY_VCLOUD_XML_SCHEMA;
23  
24  import javax.inject.Named;
25  import javax.inject.Singleton;
26  
27  import org.jclouds.rest.binders.BindToStringPayload;
28  import org.jclouds.vcloud.VCloudMediaType;
29  import org.jclouds.vcloud.options.CloneVAppTemplateOptions;
30  
31  import com.google.inject.Inject;
32  
33  /**
34   * 
35   * @author Adrian Cole
36   * 
37   */
38  @Singleton
39  public class BindCloneVAppTemplateParamsToXmlPayload extends BindCloneParamsToXmlPayload<CloneVAppTemplateOptions> {
40  
41     @Inject
42     public BindCloneVAppTemplateParamsToXmlPayload(BindToStringPayload stringBinder,
43              @Named(PROPERTY_VCLOUD_XML_NAMESPACE) String ns, @Named(PROPERTY_VCLOUD_XML_SCHEMA) String schema) {
44        super(stringBinder, schema, schema);
45     }
46  
47     @Override
48     protected Class<CloneVAppTemplateOptions> getOptionClass() {
49        return CloneVAppTemplateOptions.class;
50     }
51  
52     @Override
53     protected String getRootElement() {
54        return "CloneVAppTemplateParams";
55     }
56  
57     @Override
58     protected String getSourceMediaType() {
59        return VCloudMediaType.VAPPTEMPLATE_XML;
60     }
61  
62  }