mirror of https://github.com/apache/jclouds.git
Merge pull request #1032 from dieu/org_names
Filter null organization in VCloud API
This commit is contained in:
commit
78e1524d6f
|
@ -35,6 +35,8 @@ import org.jclouds.vcloud.VCloudAsyncClient;
|
||||||
import org.jclouds.vcloud.domain.Org;
|
import org.jclouds.vcloud.domain.Org;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
|
import com.google.common.base.Predicates;
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
|
@ -54,14 +56,14 @@ public class OrgsForNames implements Function<Iterable<String>, Iterable<Org>> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterable<Org> apply(Iterable<String> from) {
|
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
|
@Override
|
||||||
public Future<Org> apply(String from) {
|
public Future<Org> apply(String from) {
|
||||||
return aclient.getOrgClient().findOrgNamed(from);
|
return aclient.getOrgClient().findOrgNamed(from);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, executor, null, logger, "organizations for names"));
|
}, executor, null, logger, "organizations for names"), Predicates.notNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue