Package org.jclouds.vcloud.domain.internal

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


                  ORG_REF.getName(), ImmutableMap.<String, org.jclouds.vcloud.domain.Catalog> of(
                        CATALOG_REF.getName(),
                        new CatalogImpl(CATALOG_REF.getName(), CATALOG_REF.getType(), CATALOG_REF.getHref(), null,
                              "description", ImmutableMap.<String, ReferenceType> of(
                                    "item",
                                    new ReferenceTypeImpl("item", "application/vnd.vmware.vcloud.catalogItem+xml", URI
                                          .create("https://vcenterprise.bluelock.com/api/v1.0/catalogItem/1")),
                                    "template",
                                    new ReferenceTypeImpl("template", "application/vnd.vmware.vcloud.vAppTemplate+xml",
                                          URI.create("https://vcenterprise.bluelock.com/api/v1.0/catalogItem/2"))),
                              ImmutableList.<Task> of(), true, false)));
         }
View Full Code Here


                        .<String, Map<String, CatalogItem>> of(CATALOG_REF
                              .getName(), ImmutableMap.<String, CatalogItem> of(
                              "template",
                              new CatalogItemImpl("template", URI
                                    .create("https://vcenterprise.bluelock.com/api/v1.0/catalogItem/2"), "description",
                                    new ReferenceTypeImpl("template", "application/vnd.vmware.vcloud.vAppTemplate+xml",
                                          URI.create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/2")),
                                    ImmutableMap.<String, String> of()))));

         }
View Full Code Here

      String uri = attributes.get("href");
      String type = attributes.get("type");
      String relationship = attributes.get("rel");
      // savvis org has null href
      URI href = (uri != null) ? URI.create(uri) : null;
      return new ReferenceTypeImpl(attributes.get("name"), type != null ? type : defaultType, href, relationship);
   }
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"),"edit"))
                        .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"),"edit"))
                        .build().toString());
View Full Code Here

                  ORG_REF.getName(), ImmutableMap.<String, org.jclouds.vcloud.domain.Catalog> of(
                        CATALOG_REF.getName(),
                        new CatalogImpl(CATALOG_REF.getName(), CATALOG_REF.getType(), CATALOG_REF.getHref(), null,
                              "description", ImmutableMap.<String, ReferenceType> of(
                                    "item",
                                    new ReferenceTypeImpl("item", "application/vnd.vmware.vcloud.catalogItem+xml", URI
                                          .create("https://vcenterprise.bluelock.com/api/v1.0/catalogItem/1")),
                                    "template",
                                    new ReferenceTypeImpl("template", "application/vnd.vmware.vcloud.vAppTemplate+xml",
                                          URI.create("https://vcenterprise.bluelock.com/api/v1.0/catalogItem/2"))),
                              ImmutableList.<Task> of(), true, false)));
         }
View Full Code Here

                        .<String, Map<String, CatalogItem>> of(CATALOG_REF
                              .getName(), ImmutableMap.<String, CatalogItem> of(
                              "template",
                              new CatalogItemImpl("template", URI
                                    .create("https://vcenterprise.bluelock.com/api/v1.0/catalogItem/2"), "description",
                                    new ReferenceTypeImpl("template", "application/vnd.vmware.vcloud.vAppTemplate+xml",
                                          URI.create("https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/2")),
                                    ImmutableMap.<String, String> of()))));

         }
View Full Code Here

   }

   @Test
   public void testReturnsResourceWithNameMatchingConfigurationKey() {
      ReferenceType reference1 = new ReferenceTypeImpl("travis tritt", null, null);
      ReferenceType reference2 = new ReferenceTypeImpl("hail mary", null, null);

      assertEquals(
            new OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefault(Guice.createInjector(
                  new AbstractModule() {
                     protected void configure() {
View Full Code Here

   }

   @Test(expectedExceptions = NoSuchElementException.class)
   public void testThrowsNoSuchElementWhenNoneMatchConfigurationKey() {
      ReferenceType reference1 = new ReferenceTypeImpl("travis tritt", null, null);
      ReferenceType reference2 = new ReferenceTypeImpl("hail mary", null, null);

      new OnlyReferenceTypeFirstWithNameMatchingConfigurationKeyOrDefault(Guice.createInjector(new AbstractModule() {
         protected void configure() {
            bindConstant().annotatedWith(Names.named("foo")).to(".*happy.*");
         }
View Full Code Here

      VDC result = factory.create(injector.getInstance(VDCHandler.class)).parse(is);
      assertEquals(result.getName(), "Jclouds-Commit-compG1xstorA01");
      assertEquals(result.getHref(), URI.create("https://vcenterprise.bluelock.com/api/v1.0/vdc/1014839439"));
      assertEquals(result.getType(), "application/vnd.vmware.vcloud.vdc+xml");
      assertEquals(result.getStatus(), VDCStatus.READY);
      assertEquals(result.getOrg(), new ReferenceTypeImpl(null, VCloudMediaType.ORG_XML, URI
               .create("https://vcenterprise.bluelock.com/api/v1.0/org/9566014")));
      assertEquals(result.getDescription(), null);
      assertEquals(result.getTasks(), ImmutableList.of());
      assertEquals(result.getAllocationModel(), AllocationModel.ALLOCATION_POOL);
      assertEquals(result.getStorageCapacity(), new Capacity("MB", 1024000, 1024000, 0, 0));
      assertEquals(result.getCpuCapacity(), new Capacity("MHz", 20000, 20000, 0, 0));
      assertEquals(result.getMemoryCapacity(), new Capacity("MB", 30720, 30720, 0, 0));
      assertEquals(result.getResourceEntities(), ImmutableMap.<String, ReferenceType> of());
      assertEquals(result.getAvailableNetworks(), ImmutableMap.of("isolation01", new ReferenceTypeImpl("isolation01",
               "application/vnd.vmware.vcloud.network+xml", URI
                        .create("https://vcenterprise.bluelock.com/api/v1.0/network/990419644")), "internet01",
               new ReferenceTypeImpl("internet01", "application/vnd.vmware.vcloud.network+xml", URI
                        .create("https://vcenterprise.bluelock.com/api/v1.0/network/758634723"))));
      assertEquals(result.getNicQuota(), 0);
      assertEquals(result.getNetworkQuota(), 100);
      assertEquals(result.getVmQuota(), 50);
      assert result.isEnabled();
View Full Code Here

      assertEquals(result.getStorageCapacity(), new Capacity("bytes * 10^9", 100, 0, 8, 0));
      assertEquals(result.getCpuCapacity(), new Capacity("hz * 10^6", 5000, 0, 0, 0));
      assertEquals(result.getMemoryCapacity(), new Capacity("bytes * 2^20", 10240, 0, 0, 0));
      assertEquals(result.getVmQuota(), 0);
      assertEquals(result.getResourceEntities(), ImmutableMap.<String, ReferenceType> of("adriantest",
               new ReferenceTypeImpl("adriantest", VCloudMediaType.VAPP_XML, URI
                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/15124")), "centos-53",
               new ReferenceTypeImpl("centos-53", VCloudMediaType.VAPP_XML, URI
                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/15120"))));
      assertEquals(result.getAvailableNetworks(), ImmutableMap.of("10.114.34.128/26", new ReferenceTypeImpl(
               "10.114.34.128/26", "application/vnd.vmware.vcloud.network+xml", URI
                        .create("https://services.vcloudexpress.terremark.com/api/v0.8/network/1708"))));
   }
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.