Package org.jclouds.ec2.compute.loaders

Examples of org.jclouds.ec2.compute.loaders.RegionAndIdToImage


      ElasticIPAddressClient ipClient = createMock(ElasticIPAddressClient.class);
      InstanceClient instanceClient = createMock(InstanceClient.class);

      NodeMetadata node = createMock(NodeMetadata.class);

      expect(elasticIpCache.get(new RegionAndName("region", "i-blah"))).andThrow(new CacheLoader.InvalidCacheLoadException(null));

      expect(client.getInstanceServices()).andReturn(instanceClient).atLeastOnce();
      expect(instanceClient.terminateInstancesInRegion("region", "i-blah")).andReturn(null);
      expect(getNode.getNode("region/i-blah")).andReturn(node);
View Full Code Here


      ElasticIPAddressClient ipClient = createMock(ElasticIPAddressClient.class);
      InstanceClient instanceClient = createMock(InstanceClient.class);

      NodeMetadata node = createMock(NodeMetadata.class);

      expect(elasticIpCache.get(new RegionAndName("region", "i-blah"))).andThrow(new ExecutionException(null));

      expect(client.getInstanceServices()).andReturn(instanceClient).atLeastOnce();
      expect(instanceClient.terminateInstancesInRegion("region", "i-blah")).andReturn(null);
      expect(getNode.getNode("region/i-blah")).andReturn(node);
View Full Code Here

     
      if (client.getSecurityGroupServices().describeSecurityGroupsInRegion(region, groupName).size() > 0) {
         logger.debug(">> deleting securityGroup(%s)", groupName);
         client.getSecurityGroupServices().deleteSecurityGroupInRegion(region, groupName);
         // TODO: test this clear happens
         securityGroupMap.invalidate(new RegionNameAndIngressRules(region, groupName, null, false));
         logger.debug("<< deleted securityGroup(%s)", groupName);
      }
   }
View Full Code Here

            "securityGroupEventualConsistencyDelay");
   }

   @Override
   public String load(RegionAndName from) {
      RegionNameAndIngressRules realFrom = RegionNameAndIngressRules.class.cast(from);
      createSecurityGroupInRegion(from.getRegion(), from.getName(), realFrom.getPorts());
      return from.getName();
   }
View Full Code Here

      }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule())
               .getInstance(Json.class));

      // note this method is what mandates the location id as us-east-1
      Set<Image> result = DescribeImagesResponseHandlerTest.parseImages(resource);
      EC2ImageParser parser = new EC2ImageParser(EC2ComputeServiceDependenciesModule.toPortableImageStatus,
               new EC2PopulateDefaultLoginCredentialsForImageStrategy(), map, Suppliers
                        .<Set<? extends Location>> ofInstance(ImmutableSet.<Location> of(defaultLocation)), Suppliers
                        .ofInstance(defaultLocation), new GreenQloudComputeReviseParsedImage(map));
      return Sets.newLinkedHashSet(Iterables.filter(Iterables.transform(result, parser), Predicates.notNull()));
   }
View Full Code Here

      };
     
      RegionAndName regionAndName = new RegionAndName("myregion", "myname");
      AuthorizationException authException = new AuthorizationException();
     
      RegionAndIdToImage mockRegionAndIdToImage = createMock(RegionAndIdToImage.class);
      expect(mockRegionAndIdToImage.load(regionAndName)).andThrow(authException).once();
      replay(mockRegionAndIdToImage);
     
      CacheLoader<RegionAndName, Image> cacheLoader = module.provideRegionAndNameToImageSupplierCacheLoader(mockRegionAndIdToImage).get();

      for (int i = 0; i < 2; i++) {
View Full Code Here

      };
     
      RegionAndName regionAndName = new RegionAndName("myregion", "myname");
      AuthorizationException authException = new AuthorizationException();
     
      RegionAndIdToImage mockRegionAndIdToImage = createMock(RegionAndIdToImage.class);
      expect(mockRegionAndIdToImage.load(regionAndName)).andThrow(authException).once();
      replay(mockRegionAndIdToImage);
     
      CacheLoader<RegionAndName, Image> cacheLoader = module.provideRegionAndNameToImageSupplierCacheLoader(mockRegionAndIdToImage).get();

      for (int i = 0; i < 2; i++) {
View Full Code Here

      };
     
      RegionAndName regionAndName = new RegionAndName("myregion", "myname");
      AuthorizationException authException = new AuthorizationException();
     
      RegionAndIdToImage mockRegionAndIdToImage = createMock(RegionAndIdToImage.class);
      expect(mockRegionAndIdToImage.load(regionAndName)).andThrow(authException).once();
      replay(mockRegionAndIdToImage);
     
      CacheLoader<RegionAndName, Image> cacheLoader = module.provideRegionAndNameToImageSupplierCacheLoader(mockRegionAndIdToImage).get();

      for (int i = 0; i < 2; i++) {
View Full Code Here

      };
     
      RegionAndName regionAndName = new RegionAndName("myregion", "myname");
      AuthorizationException authException = new AuthorizationException();
     
      RegionAndIdToImage mockRegionAndIdToImage = createMock(RegionAndIdToImage.class);
      expect(mockRegionAndIdToImage.load(regionAndName)).andThrow(authException).once();
      replay(mockRegionAndIdToImage);
     
      CacheLoader<RegionAndName, Image> cacheLoader = module.provideRegionAndNameToImageSupplierCacheLoader(mockRegionAndIdToImage).get();

      for (int i = 0; i < 2; i++) {
View Full Code Here

      };
     
      RegionAndName regionAndName = new RegionAndName("myregion", "myname");
      AuthorizationException authException = new AuthorizationException();
     
      RegionAndIdToImage mockRegionAndIdToImage = createMock(RegionAndIdToImage.class);
      expect(mockRegionAndIdToImage.load(regionAndName)).andThrow(authException).once();
      replay(mockRegionAndIdToImage);
     
      CacheLoader<RegionAndName, Image> cacheLoader = module.provideRegionAndNameToImageSupplierCacheLoader(mockRegionAndIdToImage).get();

      for (int i = 0; i < 2; i++) {
View Full Code Here

TOP

Related Classes of org.jclouds.ec2.compute.loaders.RegionAndIdToImage

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.