Search in sources :

Example 6 with ModuleId

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));
        }
    });
}
Also used : ModuleDescriptor(org.folio.okapi.bean.ModuleDescriptor) TenantModuleDescriptor(org.folio.okapi.bean.TenantModuleDescriptor) ModuleId(org.folio.okapi.common.ModuleId) LinkedList(java.util.LinkedList)

Aggregations

ModuleId (org.folio.okapi.common.ModuleId)6 TenantModuleDescriptor (org.folio.okapi.bean.TenantModuleDescriptor)4 LinkedList (java.util.LinkedList)2 ModuleDescriptor (org.folio.okapi.bean.ModuleDescriptor)2 DecodeException (io.vertx.core.json.DecodeException)1 ArrayList (java.util.ArrayList)1 Failure (org.folio.okapi.common.Failure)1