Package org.jclouds.domain

Examples of org.jclouds.domain.Location


   public NodeMetadata apply(ServerDetails from) {
      NodeMetadataBuilder builder = new NodeMetadataBuilder();
      builder.ids(from.getId() + "");
      builder.name(from.getHostname());
      builder.hostname(from.getHostname());
      Location location = FluentIterable.from(locations.get()).firstMatch(idEquals(from.getDatacenter())).orNull();
      checkState(location != null, "no location matched ServerDetails %s", from);
      builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getHostname()));
     
      // TODO: get glesys to stop stripping out equals and commas!
      if (!isNullOrEmpty(from.getDescription()) && from.getDescription().matches("^[0-9A-Fa-f]+$")) {
View Full Code Here


      return locs.get(0);
   }

   @Test(groups = "live", dependsOnMethods = "testPublicAccess")
   public void testPublicAccessInNonDefaultLocation() throws InterruptedException, MalformedURLException, IOException {
      Location nonDefault = findNonDefaultLocationOrSkip(view.getBlobStore(), defaultLocation);

      String payload = "my data";
      runCreateContainerInLocation(payload, nonDefault);
   }
View Full Code Here

   }

   @Test(groups = "live", dependsOnMethods = "testPublicAccess")
   public void testPublicAccessInNonDefaultLocationWithBigBlob() throws InterruptedException, MalformedURLException,
            IOException {
      Location nonDefault = findNonDefaultLocationOrSkip(view.getBlobStore(), defaultLocation);
      String payload = Strings.repeat("a", 1024 * 1024); // 1MB
      runCreateContainerInLocation(payload, nonDefault);
   }
View Full Code Here

         }
      }

      // Try to create the same bucket successfully created above in one of the non-US regions to ensure an error is
      // encountered as expected.
      Location location = null;

      for (Location pLocation : store.listAssignableLocations()) {
         if (!ImmutableSet.of(Region.US_STANDARD, Region.US_EAST_1, Region.US_WEST_1, Region.US_WEST_2)
            .contains(pLocation.getId())) {
            location = pLocation;
View Full Code Here

                  public boolean apply(@Nullable StorageMetadata input) {
                     return input.getName().equals(containerName);
                  }

               });
               Location actualLoc = container.getLocation();

               assert loc.equals(actualLoc) : String.format("blob %s, in location %s instead of %s", containerName,
                        actualLoc, loc);
            } catch (Exception e) {
               Throwables.propagate(e);
View Full Code Here

   protected void assertConsistencyAwareBlobInLocation(final String containerName, final String blobName, final Location loc)
            throws InterruptedException {
      assertConsistencyAware(new Runnable() {
         public void run() {
            try {
               Location actualLoc = view.getBlobStore().getBlob(containerName, blobName).getMetadata().getLocation();
              
               assert loc.equals(actualLoc) : String.format(
                     "blob %s in %s, in location %s instead of %s", blobName, containerName, actualLoc, loc);
            } catch (Exception e) {
               Throwables.propagate(e);
View Full Code Here

               assert location.getIso3166Codes().size() == 0
                        || location.getParent().getIso3166Codes().containsAll(location.getIso3166Codes()) : location
                        + " ||" + location.getParent();
               break;
            case ZONE:
               Location provider = location.getParent().getParent();
               // zone can be a direct descendant of provider
               if (provider == null)
                  provider = location.getParent();
               assertProvider(provider);
               assert location.getIso3166Codes().size() == 0
                        || location.getParent().getIso3166Codes().containsAll(location.getIso3166Codes()) : location
                        + " ||" + location.getParent();
               break;
            case HOST:
               Location provider2 = location.getParent().getParent().getParent();
               // zone can be a direct descendant of provider
               if (provider2 == null)
                  provider2 = location.getParent().getParent();
               assertProvider(provider2);
               break;
View Full Code Here

      // notice if we've already parsed this properly here, we can rely on it.
      VirtualGuest guest = new ParseVirtualGuestWithNoPasswordTest().expected();

      // setup so that we have an expected Location to be parsed from the guest.
      Location expectedLocation = DatacenterToLocationTest.function.apply(guest.getDatacenter());
      Supplier<Set<? extends Location>> locationSupplier = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
            .<Location> of(expectedLocation));

      VirtualGuestToNodeMetadata parser = new VirtualGuestToNodeMetadata(
            locationSupplier, new GetHardwareForVirtualGuestMock(), new GetImageForVirtualGuestMock(), namingConvention);
View Full Code Here

      // notice if we've already parsed this properly here, we can rely on it.
      VirtualGuest guest = new ParseVirtualGuestHaltedTest().expected();

      // setup so that we have an expected Location to be parsed from the guest.
      Location expectedLocation = DatacenterToLocationTest.function.apply(guest.getDatacenter());
      Supplier<Set<? extends Location>> locationSupplier = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
            .<Location> of(expectedLocation));

      VirtualGuestToNodeMetadata parser = new VirtualGuestToNodeMetadata(locationSupplier,
            new GetHardwareForVirtualGuestMock(), new GetImageForVirtualGuestMock(), namingConvention);
View Full Code Here

      // notice if we've already parsed this properly here, we can rely on it.
      VirtualGuest guest = new ParseVirtualGuestPausedTest().expected();

      // setup so that we have an expected Location to be parsed from the guest.
      Location expectedLocation = DatacenterToLocationTest.function.apply(guest.getDatacenter());
      Supplier<Set<? extends Location>> locationSupplier = Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet
            .<Location> of(expectedLocation));

      VirtualGuestToNodeMetadata parser = new VirtualGuestToNodeMetadata(locationSupplier,
            new GetHardwareForVirtualGuestMock(), new GetImageForVirtualGuestMock(), namingConvention);
View Full Code Here

TOP

Related Classes of org.jclouds.domain.Location

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.