Package org.jclouds.domain

Examples of org.jclouds.domain.Location


   @Override
   public Location apply(Network from) {
      Matcher matcher = netPattern.matcher(from.getHref().toASCIIString());
      if (matcher.find()) {
         Location provider = new LocationBuilder().scope(LocationScope.PROVIDER).id(providerName).description(
                  endpoint.get().toASCIIString()).iso3166Codes(isoCodes).build();

         Org org = api.getBrowsingApi().getOrg(matcher.group(1));

         Location orgLocation = new LocationBuilder().scope(LocationScope.REGION).id(org.getId()).description(
                  org.getDescription()).parent(provider).build();

         VDC vdc = api.getBrowsingApi().getVDCInOrg(org.getId(), matcher.group(2));

         Location vdcLocation = new LocationBuilder().scope(LocationScope.ZONE).id(vdc.getId()).description(
                  vdc.getDescription()).parent(orgLocation).build();

         return new LocationBuilder().scope(LocationScope.NETWORK).id(from.getId()).description(from.getName()).parent(
                  vdcLocation).build();
      } else {
View Full Code Here


      for (VSystem system : api.getVirtualDCApi().listVirtualSystems()) {

         VSystemWithDetails systemWithDetails = api.getVirtualSystemApi().getDetails(system.getId());

         Location systemLocation = new LocationBuilder().scope(LocationScope.SYSTEM)
               .parent(Iterables.getOnlyElement(regionProvider.get())).description(system.getName()).id(system.getId())
               .build();

         for (VNet net : systemWithDetails.getNetworks()) {
View Full Code Here

        }

        // Create Container
        mStore = mContext.getBlobStore();
        if (!mStore.containerExists(mContainerName)) {
            Location locToSet = null;
            for (Location loc : mStore.listAssignableLocations()) {
                if (loc.getId().equals("eu-west-1")) {
                    locToSet = loc;
                    break;
                }
View Full Code Here

      this.locationIndex = checkNotNull(locationIndex, "locationIndex");
   }

   @Override
   public Hardware apply(PackageInDatacenter pkgInDatacenter) {
      Location location = locationIndex.get().get(pkgInDatacenter.getDatacenter());
      checkState(location != null, "location %s not in locationIndex: %s", pkgInDatacenter.getDatacenter(),
            locationIndex.get());
      org.jclouds.joyent.cloudapi.v6_5.domain.Package pkg = pkgInDatacenter.get();
      return new HardwareBuilder().id(pkgInDatacenter.slashEncode()).providerId(pkg.getName()).name(pkg.getName())
            .ram(pkg.getMemorySizeMb())
View Full Code Here

      this.locationIndex = checkNotNull(locationIndex, "locationIndex");
   }

   @Override
   public Image apply(DatasetInDatacenter datasetInDatacenter) {
      Location location = locationIndex.get().get(datasetInDatacenter.getDatacenter());
      checkState(location != null, "location %s not in locationIndex: %s", datasetInDatacenter.getDatacenter(),
            locationIndex.get());
      Dataset dataset = datasetInDatacenter.get();
      return new ImageBuilder()
            .id(datasetInDatacenter.slashEncode())
View Full Code Here

      this.hardwares = checkNotNull(hardwares, "hardwares");
   }

   @Override
   public NodeMetadata apply(MachineInDatacenter machineInDatacenter) {
      Location zone = locationIndex.get().get(machineInDatacenter.getDatacenter());
      checkState(zone != null, "location %s not in locationIndex: %s", machineInDatacenter.getDatacenter(),
            locationIndex.get());
      Machine from = machineInDatacenter.get();

      NodeMetadataBuilder builder = new NodeMetadataBuilder();
View Full Code Here

   @Override
   protected Object doExecute() throws Exception {
      BlobStore blobStore = getBlobStore();

      Location location = null;
      if (!locationString.isEmpty()) {
         for (Location loc : blobStore.listAssignableLocations()) {
            if (loc.getId().equalsIgnoreCase(locationString)) {
               location = loc;
               break;
View Full Code Here

   private static void printContainerMetadata(StorageMetadata containerMetadata) {
      System.out.println(containerMetadata.getName());
      printMetadata("ETag", containerMetadata.getETag());
      printMetadata("Creation-Date", containerMetadata.getCreationDate());
      printMetadata("Last-Modified", containerMetadata.getLastModified());
      Location location = containerMetadata.getLocation();
      if (location != null) {
         printMetadata("Location", location.getId());
      }
      printMetadata("Provider-ID", containerMetadata.getProviderId());
      printMetadata("URI", containerMetadata.getUri());
      for (Map.Entry<String, String> entry : containerMetadata.getUserMetadata().entrySet()) {
         printMetadata(entry.getKey(), entry.getValue());
View Full Code Here

            blobStore = ctx.getBlobStore();
            asyncBlobStore = ctx.getAsyncBlobStore();
         }

         if (!blobStore.containerExists(containerName)) {
            Location chosenLoc = null;
            if (cfg.getCloudServiceLocation() != null && cfg.getCloudServiceLocation().trim().length() > 0) {
               Map<String, ? extends Location> idToLocation = Maps.uniqueIndex(blobStore.listAssignableLocations(), new Function<Location, String>() {
                  @Override
                  public String apply(Location input) {
                     return input.getId();
View Full Code Here

         return null;
      }
   }

   private Location getLocationForAvailabilityZoneOrRegion(final RunningInstance instance) {
      Location location = findLocationWithId(instance.getAvailabilityZone());
      if (location == null)
         location = findLocationWithId(instance.getRegion());
      return location;
   }
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.