Package org.jclouds.ovf

Examples of org.jclouds.ovf.Envelope


   @Override
   public Hardware apply(VAppTemplate from) {
      checkNotNull(from, "VAppTemplate");

      Envelope ovf = templateToEnvelope.apply(from);

      if (ovf.getVirtualSystem().getVirtualHardwareSections().size() > 1) {
         logger.warn("multiple hardware choices found. using first", ovf);
      }
      VirtualHardwareSection hardware = Iterables.get(ovf.getVirtualSystem().getVirtualHardwareSections(), 0);
      HardwareBuilder builder = rasdToHardwareBuilder.apply(hardware.getItems());
      if (from.getVDC() != null) {
         builder.location(findLocationForResource.apply(from.getVDC()));
      } else {
         // otherwise, it could be in a public catalog, which is not assigned to a VDC
View Full Code Here


   }

   @Override
   public Image apply(VAppTemplate from) {
      checkNotNull(from, "VAppTemplate");
      Envelope ovf = templateToEnvelope.apply(from);

      ImageBuilder builder = new ImageBuilder();
      builder.ids(from.getHref().toASCIIString());
      builder.uri(from.getHref());
      builder.name(from.getName());
View Full Code Here

      checkArgument(from.getNetworkSection().getNetworks().size() == 1,
               "multiple network connections are not supported: %s", from);

      checkArgument(from.isOvfDescriptorUploaded(), "ovf descriptor is not uploaded: %s", from);
      Envelope ovf = getOVFForVAppTemplateAndValidate(from);
      return ovf;
   }
View Full Code Here

      Envelope ovf = getOVFForVAppTemplateAndValidate(from);
      return ovf;
   }

   private Envelope getOVFForVAppTemplateAndValidate(VAppTemplate from) throws IllegalArgumentException {
      Envelope ovf;
      try {
         ovf = envelopes.get(from.getHref());
         checkArgument(!ovf.getVirtualSystem().getVirtualHardwareSections().isEmpty(),
                  "no hardware sections exist in ovf %s", ovf);
      } catch (ExecutionException e) {
         throw new IllegalArgumentException("no ovf envelope found for: " + from, e);
      }
      return ovf;
View Full Code Here

* Tests behavior of {@code EnvelopeHandler}
*/
@Test(groups = "unit")
public class EnvelopeHandlerTest {
   public void testVCloud1_0() {
      Envelope result = parseEnvelope();
      checkOvfEnvelope(result);
   }
View Full Code Here

   public static Envelope parseEnvelope() {
      InputStream is = EnvelopeHandlerTest.class.getResourceAsStream("/ovf.xml");
      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      Envelope result = factory.create(injector.getInstance(EnvelopeHandler.class)).parse(is);
      return result;
   }
View Full Code Here

TOP

Related Classes of org.jclouds.ovf.Envelope

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.