Filter null organization in VCloud API

This commit is contained in:
Anton Panasenko 2012-12-04 18:26:30 +02:00
parent 6563ba1ad9
commit e293e65538
1 changed files with 4 additions and 2 deletions

View File

@ -35,6 +35,8 @@ import org.jclouds.vcloud.VCloudAsyncClient;
import org.jclouds.vcloud.domain.Org;
import com.google.common.base.Function;
import com.google.common.base.Predicates;
import com.google.common.collect.Iterables;
/**
* @author Adrian Cole
@ -54,14 +56,14 @@ public class OrgsForNames implements Function<Iterable<String>, Iterable<Org>> {
@Override
public Iterable<Org> apply(Iterable<String> from) {
return Iterables2.concreteCopy(transformParallel(from, new Function<String, Future<? extends Org>>() {
return Iterables.filter(transformParallel(from, new Function<String, Future<? extends Org>>() {
@Override
public Future<Org> apply(String from) {
return aclient.getOrgClient().findOrgNamed(from);
}
}, executor, null, logger, "organizations for names"));
}, executor, null, logger, "organizations for names"), Predicates.notNull());
}
}