Search in sources :

Example 1 with RpcService

use of org.onosproject.yang.model.RpcService in project onos by opennetworkinglab.

the class DynamicConfigManager method invokeRpc.

@Override
public CompletableFuture<RpcOutput> invokeRpc(RpcInput input) {
    checkNotNull(input);
    checkNotNull(input.id());
    RpcContext context = contextProvider.getRpcContext(input.id());
    String srvcIntf = context.serviceIntf().getName();
    RpcService handler = handlerRegistry.get(srvcIntf);
    if (handler == null) {
        throw new FailedException("No registered handler found, cannot invoke");
    }
    return CompletableFuture.supplyAsync(new RpcExecutor(handler, getSvcId(handler, srvcIntf), context.rpcName(), RpcMessageId.generate(), input));
}
Also used : RpcContext(org.onosproject.yang.model.RpcContext) RpcExecutor(org.onosproject.config.RpcExecutor) FailedException(org.onosproject.config.FailedException) RpcService(org.onosproject.yang.model.RpcService)

Aggregations

FailedException (org.onosproject.config.FailedException)1 RpcExecutor (org.onosproject.config.RpcExecutor)1 RpcContext (org.onosproject.yang.model.RpcContext)1 RpcService (org.onosproject.yang.model.RpcService)1