use of org.opendaylight.yangtools.yang.common.QNameModule in project controller by opendaylight.
the class RpcUtil method decomposeRpcService.
static Collection<SchemaPath> decomposeRpcService(final Class<RpcService> service, final SchemaContext schemaContext, final Predicate<RpcRoutingStrategy> filter) {
final QNameModule moduleName = BindingReflections.getQNameModule(service);
final Module module = schemaContext.findModule(moduleName).get();
LOG.debug("Resolved service {} to module {}", service, module);
final Collection<RpcDefinition> rpcs = module.getRpcs();
final Collection<SchemaPath> ret = new ArrayList<>(rpcs.size());
for (RpcDefinition rpc : rpcs) {
final RpcRoutingStrategy strategy = RpcRoutingStrategy.from(rpc);
if (filter.test(strategy)) {
ret.add(rpc.getPath());
}
}
return ret;
}
use of org.opendaylight.yangtools.yang.common.QNameModule in project controller by opendaylight.
the class BindingToNormalizedNodeCodec method getModuleBlocking.
private Module getModuleBlocking(final Class<?> modeledClass) {
final QNameModule moduleName = BindingReflections.getQNameModule(modeledClass);
Module module = runtimeContext().getSchemaContext().findModule(moduleName).orElse(null);
if (module == null && this.futureSchema.waitForSchema(moduleName)) {
module = runtimeContext().getSchemaContext().findModule(moduleName).orElse(null);
}
Preconditions.checkState(module != null, "Schema for %s is not available.", modeledClass);
return module;
}
Aggregations