public static Map<RegionAndName, ? extends Image> imagesToMap(Iterable<? extends Image> input) { return new ImagesToRegionAndIdMap().apply(input); }
private EC2SecurityGroupToSecurityGroup createGroupParser(final ImmutableSet<Location> locations) { Supplier<Set<? extends Location>> locationSupplier = new Supplier<Set<? extends Location>>() { @Override public Set<? extends Location> get() { return locations; } }; EC2SecurityGroupToSecurityGroup parser = new EC2SecurityGroupToSecurityGroup(locationSupplier); return parser; }
private Location getLocationForAvailabilityZoneOrRegion(final RunningInstance instance) { Location location = findLocationWithId(instance.getAvailabilityZone()); if (location == null) location = findLocationWithId(instance.getRegion()); return location; }
@Override public KeyPair apply(RegionAndName from) { return createNewKeyPairInRegion(from.getRegion(), from.getName()); }
private void checkGroupName(RunningInstance instance) { assertEquals("groupname", createNodeParser(ImmutableSet.<Hardware> of(), ImmutableSet .<Location> of(), ImmutableSet.<Image> of(), ImmutableMap.<String, Credentials> of()) .apply(instance).getGroup()); }
protected RunningInstanceToNodeMetadata createNodeParser(final ImmutableSet<Hardware> hardware, final ImmutableSet<Location> locations, final Set<org.jclouds.compute.domain.Image> images, Map<String, Credentials> credentialStore) { Map<InstanceState, Status> instanceToNodeStatus = EC2ComputeServiceDependenciesModule.toPortableNodeStatus; CacheLoader<RegionAndName, Image> getRealImage = new CacheLoader<RegionAndName, Image>() { @Override public Image load(@Nullable RegionAndName from) { return ImagesToRegionAndIdMap.imagesToMap(images).get(from); } }; LoadingCache<RegionAndName, Image> instanceToImage = CacheBuilder.newBuilder().build(getRealImage); return createNodeParser(hardware, locations, credentialStore, instanceToNodeStatus, instanceToImage); }
public static Map<RegionAndName, ? extends Image> imagesToMap(Iterable<? extends Image> input) { return new ImagesToRegionAndIdMap().apply(input); }
@Override public KeyPair apply(RegionAndName from) { return createNewKeyPairInRegion(from.getRegion(), from.getName()); }
private Location getLocationForAvailabilityZoneOrRegion(final RunningInstance instance) { Location location = findLocationWithId(instance.getAvailabilityZone()); if (location == null) location = findLocationWithId(instance.getRegion()); return location; }
private void checkGroupName(RunningInstance instance) { assertEquals("groupname", createNodeParser(ImmutableSet.<Hardware> of(), ImmutableSet .<Location> of(), ImmutableSet.<Image> of(), ImmutableMap.<String, Credentials> of()) .apply(instance).getGroup()); }
protected RunningInstanceToNodeMetadata createNodeParser(final ImmutableSet<Hardware> hardware, final ImmutableSet<Location> locations, final Set<org.jclouds.compute.domain.Image> images, Map<String, Credentials> credentialStore) { Map<InstanceState, Status> instanceToNodeStatus = EC2ComputeServiceDependenciesModule.toPortableNodeStatus; CacheLoader<RegionAndName, Image> getRealImage = new CacheLoader<RegionAndName, Image>() { @Override public Image load(@Nullable RegionAndName from) { return ImagesToRegionAndIdMap.imagesToMap(images).get(from); } }; LoadingCache<RegionAndName, Image> instanceToImage = CacheBuilder.newBuilder().build(getRealImage); return createNodeParser(hardware, locations, credentialStore, instanceToNodeStatus, instanceToImage); }
public static Map<RegionAndName, ? extends Image> imagesToMap(Iterable<? extends Image> input) { return new ImagesToRegionAndIdMap().apply(input); }
@Override public KeyPair apply(RegionAndName from) { return createNewKeyPairInRegion(from.getRegion(), from.getName()); }
private Location getLocationForAvailabilityZoneOrRegion(final RunningInstance instance) { Location location = findLocationWithId(instance.getAvailabilityZone()); if (location == null) location = findLocationWithId(instance.getRegion()); return location; }
public static Map<RegionAndName, ? extends Image> imagesToMap(Iterable<? extends Image> input) { return new ImagesToRegionAndIdMap().apply(input); }
@Override public KeyPair apply(RegionAndName from) { return createNewKeyPairInRegion(from.getRegion(), from.getName()); }
private Location getLocationForAvailabilityZoneOrRegion(final RunningInstance instance) { Location location = findLocationWithId(instance.getAvailabilityZone()); if (location == null) location = findLocationWithId(instance.getRegion()); return location; }
public static Map<RegionAndName, ? extends Image> imagesToMap(Iterable<? extends Image> input) { return new ImagesToRegionAndIdMap().apply(input); }
@Override public KeyPair apply(RegionAndName from) { return createNewKeyPairInRegion(from.getRegion(), from.getName()); }
private Location getLocationForAvailabilityZoneOrRegion(final RunningInstance instance) { Location location = findLocationWithId(instance.getAvailabilityZone()); if (location == null) location = findLocationWithId(instance.getRegion()); return location; }