@Override public Image call() throws Exception { if (imageAvailablePredicate.apply(snapshotEvent.id())) { org.jclouds.digitalocean2.domain.Image snapshot = api.imageApi().list().concat() .firstMatch(new Predicate<org.jclouds.digitalocean2.domain.Image>() { @Override public boolean apply(org.jclouds.digitalocean2.domain.Image input) { return input.name().equals(cloneTemplate.getName()); } }).get(); return imageTransformer.apply(ImageInRegion.create(snapshot, droplet.region().slug())); } throw new UncheckedTimeoutException("Image was not created within the time limit: " + cloneTemplate.getName()); } });
@Override public Image call() throws Exception { if (imageAvailablePredicate.apply(snapshotEvent.id())) { org.jclouds.digitalocean2.domain.Image snapshot = api.imageApi().list().concat() .firstMatch(new Predicate<org.jclouds.digitalocean2.domain.Image>() { @Override public boolean apply(org.jclouds.digitalocean2.domain.Image input) { return input.name().equals(cloneTemplate.getName()); } }).get(); return imageTransformer.apply(ImageInRegion.create(snapshot, droplet.region().slug())); } throw new UncheckedTimeoutException("Image was not created within the time limit: " + cloneTemplate.getName()); } });
@Override public Image call() throws Exception { if (imageAvailablePredicate.apply(snapshotEvent.id())) { org.jclouds.digitalocean2.domain.Image snapshot = api.imageApi().list().concat() .firstMatch(new Predicate<org.jclouds.digitalocean2.domain.Image>() { @Override public boolean apply(org.jclouds.digitalocean2.domain.Image input) { return input.name().equals(cloneTemplate.getName()); } }).get(); return imageTransformer.apply(ImageInRegion.create(snapshot, droplet.region().slug())); } throw new UncheckedTimeoutException("Image was not created within the time limit: " + cloneTemplate.getName()); } });