Package org.jclouds.vcloud.domain.internal

Examples of org.jclouds.vcloud.domain.internal.ReferenceTypeImpl


      assertEquals(result.getCpuCapacity(), new Capacity("hz * 10^6", 0, 0, 2400, 0));
      assertEquals(result.getMemoryCapacity(), new Capacity("bytes * 10^9", 0, 0, 2, 0));
      assertEquals(result.getVmQuota(), 0);
      assertEquals(result.getResourceEntities(), new ImmutableMap.Builder<String, ReferenceType>().put(
               "Plesk (Linux) 64-bit Template",
               new ReferenceTypeImpl("Plesk (Linux) 64-bit Template", "application/vnd.vmware.vcloud.vAppTemplate+xml",
                        URI.create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/1"))).put(

               "Windows 2008 Datacenter 64 Bit Template",
               new ReferenceTypeImpl("Windows 2008 Datacenter 64 Bit Template",
                        "application/vnd.vmware.vcloud.vAppTemplate+xml", URI
                                 .create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/2"))).put(
               "Cent OS 64 Bit Template",
               new ReferenceTypeImpl("Cent OS 64 Bit Template", "application/vnd.vmware.vcloud.vAppTemplate+xml", URI
                        .create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/3"))).put(
               "cPanel (Linux) 64 Bit Template",
               new ReferenceTypeImpl("cPanel (Linux) 64 Bit Template",
                        "application/vnd.vmware.vcloud.vAppTemplate+xml", URI
                                 .create("https://vcloud.safesecureweb.com/api/v0.8/vAppTemplate/4"))).put(
               "188849-1",
               new ReferenceTypeImpl("188849-1", "application/vnd.vmware.vcloud.vApp+xml", URI
                        .create("https://vcloud.safesecureweb.com/api/v0.8/vApp/188849-1"))).put(
               "188849-2",
               new ReferenceTypeImpl("188849-2", "application/vnd.vmware.vcloud.vApp+xml", URI
                        .create("https://vcloud.safesecureweb.com/api/v0.8/vApp/188849-2"))).build());

      assertEquals(result.getAvailableNetworks(), ImmutableMap.<String, ReferenceType> of());
   }
View Full Code Here


   public void testApplyInputStream() {
      InputStream is = getClass().getResourceAsStream("/orglist.xml");

      Map<String, ReferenceType> result = factory.create(injector.getInstance(OrgListHandler.class)).parse(is);
      assertEquals(result, ImmutableMap.of("adrian@jclouds.org", new ReferenceTypeImpl("adrian@jclouds.org",
               "application/vnd.vmware.vcloud.org+xml", URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"))));
   }
View Full Code Here

   public void testSavvis() {
      InputStream is = getClass().getResourceAsStream("/orglist-savvis.xml");

      Map<String, ReferenceType> result = factory.create(injector.getInstance(OrgListHandler.class)).parse(is);
      assertEquals(result, ImmutableMap.of("SAVVISStation Integration Testing", new ReferenceTypeImpl("SAVVISStation Integration Testing",
               "application/vnd.vmware.vcloud.org+xml", URI.create("https://api.sandbox.symphonyvpdc.savvis.net/rest/api/v0.8/org/100000.0"))));
   }
View Full Code Here

      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
      assertEquals(result.getName(), "ExampleOrg");
      assertEquals(result.getFullName(), "ExampleOrg");
      assertEquals(result.getDescription(), "Example Corp's Primary Organization.");
      assertEquals(result.getHref(), URI.create("http://vcloud.example.com/api/v1.0/org/5"));
      assertEquals(result.getCatalogs(), ImmutableMap.of("Main Catalog", new ReferenceTypeImpl("Main Catalog",
               CATALOG_XML, URI.create("http://vcloud.example.com/api/v1.0/catalog/32")), "Shared Catalog",
               new ReferenceTypeImpl("Shared Catalog", CATALOG_XML, URI
                        .create("http://vcloud.example.com/api/v1.0/catalog/37"))));
      assertEquals(result.getVDCs(), ImmutableMap.of("ExampleVdc01", new ReferenceTypeImpl("ExampleVdc01",
               VCloudMediaType.VDC_XML, URI.create("http://vcloud.example.com/api/v1.0/vdc/5"))));
      assertEquals(result.getNetworks(), ImmutableMap.of("TestNetwork", new ReferenceTypeImpl("TestNetwork",
               VCloudMediaType.NETWORK_XML, URI.create("http://vcloud.example.com/api/v1.0/network/14")),
               "ProductionNetwork", new ReferenceTypeImpl("ProductionNetwork", VCloudMediaType.NETWORK_XML, URI
                        .create("http://vcloud.example.com/api/v1.0/network/54"))));
      assertEquals(result.getTasksList(), new ReferenceTypeImpl(null, TASKSLIST_XML, URI
               .create("http://vcloud.example.com/api/v1.0/tasksList/5")));
   }
View Full Code Here

      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
      assertEquals(result.getName(), "adrian@jclouds.org");
      assertEquals(result.getFullName(), "adrian@jclouds.org");
      assertEquals(result.getHref(), URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/org/48"));
      assertEquals(result.getCatalogs(), ImmutableMap.of("Miami Environment 1 Catalog", new ReferenceTypeImpl(
               "Miami Environment 1 Catalog", CATALOG_XML, URI
                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/vdc/32/catalog"))));
      assertEquals(result.getVDCs(), ImmutableMap.of("Miami Environment 1", new ReferenceTypeImpl(
               "Miami Environment 1", VCloudMediaType.VDC_XML, URI
                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/vdc/32"))));
      assertEquals(result.getTasksList(), new ReferenceTypeImpl("Miami Environment 1 Tasks List", TASKSLIST_XML, URI
               .create("https://services.vcloudexpress.terremark.com/api/v0.8/tasksList/32")));
   }
View Full Code Here

      Factory factory = injector.getInstance(ParseSax.Factory.class);
      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
      assertEquals(result.getName(), "Customer 188849");
      assertEquals(result.getFullName(), "Customer 188849");
      assertEquals(result.getHref(), URI.create("https://vcloud.safesecureweb.com/api/v0.8/org/188849"));
      assertEquals(result.getCatalogs(), ImmutableMap.of("HMS Shared Catalog", new ReferenceTypeImpl(
               "HMS Shared Catalog", CATALOG_XML, URI.create("https://vcloud.safesecureweb.com/api/v0.8/catalog/1"))));
      assertEquals(result.getVDCs(), ImmutableMap.of("188849 Virtual DataCenter", new ReferenceTypeImpl(
               "188849 Virtual DataCenter", VCloudMediaType.VDC_XML, URI
                        .create("https://vcloud.safesecureweb.com/api/v0.8/vdc/188849"))));
      assertEquals(result.getTasksList(), new ReferenceTypeImpl("188849 Task List", TASKSLIST_XML, URI
               .create("https://vcloud.safesecureweb.com/api/v0.8/tasksList/188849")));
   }
View Full Code Here

      Injector injector = Guice.createInjector(new SaxParserModule());
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      Org result = factory.create(injector.getInstance(OrgHandler.class)).parse(is);
      assertEquals(result, new OrgImpl("607968.0", null, null, "607968.0", "Gravitant Inc", ImmutableMap
               .<String, ReferenceType> of(), ImmutableMap.<String, ReferenceType> of("GravDataCenter1(Saved)",
               new ReferenceTypeImpl("GravDataCenter1(Saved)", "application/vnd.vmware.vcloud.vdc+xml", URI
                        .create("https://api.symphonyVPDC.savvis.net/rest/api/v0.8/org/607968.0/vdc/2826"))),
               ImmutableMap.<String, ReferenceType> of(), null, ImmutableSet.<Task> of()));

   }
View Full Code Here

   @Test(enabled = false)
   public static void checkOs(VCloudOperatingSystemSection result) {
      assertEquals(result.getHref(), URI
               .create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/operatingSystemSection/"));
      assertEquals(result.getDescription(), "Red Hat Enterprise Linux 5 (64-bit)");
      assertEquals(result.getEdit(), new ReferenceTypeImpl(null,
               "application/vnd.vmware.vcloud.operatingSystemSection+xml",
               URI.create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/operatingSystemSection/")));
      assertEquals(result.getId(), Integer.valueOf(80));
      assertEquals(result.getVmwOsType(), "rhel5_64Guest");
      assertEquals(result.getType(), "application/vnd.vmware.vcloud.operatingSystemSection+xml");
View Full Code Here

                        .virtualQuantity(1l)
                        .allocationUnits("hertz * 10^6")
                        .reservation(0l)
                        .weight(0)
                        .edit(
                                 new ReferenceTypeImpl(
                                          null,
                                          "application/vnd.vmware.vcloud.rasdItem+xml",
                                          URI
                                                   .create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/virtualHardwareSection/cpu")))
                        .build().toString());

      assertEquals(
               Iterables.get(result.getItems(), 7).toString(),
               EditableResourceAllocationSettingData
                        .builder()
                        .instanceID("5")
                        .elementName("384 MB of memory")
                        .description("Memory Size")
                        .resourceType(ResourceType.MEMORY)
                        .virtualQuantity(384l)
                        .allocationUnits("byte * 2^20")
                        .reservation(0l)
                        .weight(0)
                        .edit(
                                 new ReferenceTypeImpl(
                                          null,
                                          "application/vnd.vmware.vcloud.rasdItem+xml",
                                          URI
                                                   .create("https://vcenterprise.bluelock.com/api/v1.0/vApp/vm-2087535248/virtualHardwareSection/memory")))
                        .build().toString());
View Full Code Here

   public static ReferenceType newReferenceType(Map<String, String> attributes, String defaultType) {
      String uri = attributes.get("href");
      String type = attributes.get("type");
      // savvis org has null href
      URI href = (uri != null) ? URI.create(uri) : null;
      return new ReferenceTypeImpl(attributes.get("name"), type != null ? type : defaultType, href);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.domain.internal.ReferenceTypeImpl

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.