use of org.folio.okapi.common.ModuleId in project okapi by folio-org.
the class ModuleManager method getModulesWithFilter.
public void getModulesWithFilter(ModuleId filter, boolean preRelease, Handler<ExtendedAsyncResult<List<ModuleDescriptor>>> fut) {
modules.getAll(kres -> {
if (kres.failed()) {
fut.handle(new Failure<>(kres.getType(), kres.cause()));
} else {
List<ModuleDescriptor> mdl = new LinkedList<>();
for (ModuleDescriptor md : kres.result().values()) {
String id = md.getId();
ModuleId idThis = new ModuleId(id);
if ((filter == null || idThis.hasPrefix(filter)) && (preRelease || !idThis.hasPreRelease())) {
mdl.add(md);
}
}
fut.handle(new Success<>(mdl));
}
});
}
Aggregations