Package org.jclouds.domain

Examples of org.jclouds.domain.LocationBuilder


      assertEquals(node.getPublicAddresses(), ImmutableSet.of());
   }

   @Test(expectedExceptions = NoSuchElementException.class)
   public void testGracefulWhenVDCIsNotLocation() {
      Location location = new LocationBuilder().id("https://1.1.1.1/api/v1.0/vdc/11111").description("description")
            .scope(LocationScope.PROVIDER).build();
      Injector injector = createInjectorWithLocation(location);
      InputStream is = getClass().getResourceAsStream("/vapp-pool.xml");
      Factory factory = injector.getInstance(ParseSax.Factory.class);
      VApp result = factory.create(injector.getInstance(VAppHandler.class)).parse(is);
View Full Code Here


   public ListenableFuture<Boolean> putBucketInRegion(@Nullable String region, String name,
            PutBucketOptions... optionsList) {
      region = region == null ? Region.US_STANDARD : region;
      final PutBucketOptions options = (optionsList.length == 0) ? new PutBucketOptions() : optionsList[0];
      keyToAcl.put(name, options.getAcl());
      return blobStore.createContainerInLocation(new LocationBuilder().scope(LocationScope.REGION).id(region)
               .description(region).build(), name);
   }
View Full Code Here

      Location provider = Iterables.getOnlyElement(super.get());
      if (orgNameToResource.get().size() == 0)
         return locations.add(provider);
      Map<String, Supplier<Set<String>>> isoCodesById = isoCodesByIdSupplier.get();
      for (ReferenceType org : orgNameToResource.get().values()) {
         LocationBuilder builder = new LocationBuilder().scope(LocationScope.REGION).id(org.getHref().toASCIIString())
                  .description(org.getName()).parent(provider);
         if (isoCodesById.containsKey(org.getHref().toASCIIString()))
            builder.iso3166Codes(isoCodesById.get(org.getHref().toASCIIString()).get());
         Location orgL = builder.build();
         for (ReferenceType vdc : orgNameToVDCResource.get().get(org.getName()).getVDCs().values()) {
            builder = new LocationBuilder().scope(LocationScope.ZONE).id(vdc.getHref().toASCIIString()).description(
                     vdc.getName()).parent(orgL);
            if (isoCodesById.containsKey(vdc.getHref().toASCIIString()))
               builder.iso3166Codes(isoCodesById.get(vdc.getHref().toASCIIString()).get());
            locations.add(builder.build());
         }
      }
      return locations;
   }
View Full Code Here

               .put(version1_0GetOVFForVAppTemplateRequest, successfulVersion1_0GetOVFForVAppTemplateResponseFromVCD1_5WithSingleVM)
               .build());

      Location provider = Iterables.getOnlyElement(compute.getContext().utils().injector().getInstance(JustProvider.class).get());

      Location orgLocation = new LocationBuilder().id(ENDPOINT + "/v1.0/org/" + orgId).scope(LocationScope.REGION)
               .description("jclouds").parent(provider).build();

      Location vdcLocation = new LocationBuilder().id(ENDPOINT + "/v1.0/vdc/" + vdcId).scope(LocationScope.ZONE)
               .description("orgVDC-jclouds-Tier1-PAYG").parent(orgLocation).build();

      Set<? extends Image> currentImages = compute.listImages();
      assertEquals(compute.listImages().size(), 1);
      Image onlyImage = Iterables.get(currentImages, 0);
View Full Code Here

* @author Adrian Cole
*/
@Test(groups = "unit")
public class FindLocationForResourceTest {
   public void testMatchWhenIdIsHref() {
      Location location = new LocationBuilder().id("http://foo").description("description")
            .scope(LocationScope.PROVIDER).build();
      FindLocationForResource converter = new FindLocationForResource(
            Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet.<Location> of(location)));
      assertEquals(converter.apply(new ReferenceTypeImpl("name", "type", URI.create("http://foo"))), location);
   }
View Full Code Here

   }

   @Test(expectedExceptions = NoSuchElementException.class)
   public void testGracefulWhenHrefIsntLocationId() {
      FindLocationForResource converter = new FindLocationForResource(
            Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet.<Location> of(new LocationBuilder()
                  .id("http://bar").description("description").scope(LocationScope.PROVIDER).build())));
      converter.apply(new ReferenceTypeImpl("name", "type", URI.create("http://foo")));
   }
View Full Code Here

   }

   @Test(expectedExceptions = NoSuchElementException.class)
   public void testGracefulWhenLocationIdIsntURI() {
      FindLocationForResource converter = new FindLocationForResource(
            Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet.<Location> of(new LocationBuilder().id("1")
                  .description("description").scope(LocationScope.PROVIDER).build())));
      converter.apply(new ReferenceTypeImpl("name", "type", URI.create("http://foo")));
   }
View Full Code Here

                  .providerId("1234")
                  .name("sample-server")
                  .group("sample")
                  .hostname("sample-server")
                  .location(
                        new LocationBuilder().scope(LocationScope.HOST).id("e4d909c290d0fb1ca068ffaddf22cbd0")
                              .description("e4d909c290d0fb1ca068ffaddf22cbd0").parent(provider).build())
                  .userMetadata(ImmutableMap.of("Server Label", "Web Head 1", "Image Version", "2.1")).build());

   }
View Full Code Here

                  .providerId("1234")
                  .name("sample-server")
                  .hostname("sample-server")
                  .group("sample")
                  .location(
                        new LocationBuilder().scope(LocationScope.HOST).id("e4d909c290d0fb1ca068ffaddf22cbd0")
                              .description("e4d909c290d0fb1ca068ffaddf22cbd0").parent(provider).build())
                  .userMetadata(ImmutableMap.of("Server Label", "Web Head 1", "Image Version", "2.1")).build());

   }
View Full Code Here

                  .providerId("1234")
                  .name("sample-server")
                  .group("sample")
                  .hostname("sample-server")
                  .location(
                        new LocationBuilder().scope(LocationScope.HOST).id("e4d909c290d0fb1ca068ffaddf22cbd0")
                              .description("e4d909c290d0fb1ca068ffaddf22cbd0").parent(provider).build())
                  .userMetadata(ImmutableMap.of("Server Label", "Web Head 1", "Image Version", "2.1")).build());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.domain.LocationBuilder

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.