X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsamples%2Fclustering-test-app%2Fkaraf-cli%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fclustering%2Fit%2Fkaraf%2Fcli%2Frpc%2Ftest%2FBasicGlobalCommand.java;fp=opendaylight%2Fmd-sal%2Fsamples%2Fclustering-test-app%2Fkaraf-cli%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fclustering%2Fit%2Fkaraf%2Fcli%2Frpc%2Ftest%2FBasicGlobalCommand.java;h=fa88ed0c829794e1a433f085bf217fa22078ffab;hp=0000000000000000000000000000000000000000;hb=771f58ab713985d0c797c80079c603256876d8d4;hpb=5ac9fde46859115aa155009eae00ac0748f77be7;ds=sidebyside diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/rpc/test/BasicGlobalCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/rpc/test/BasicGlobalCommand.java new file mode 100644 index 0000000000..fa88ed0c82 --- /dev/null +++ b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/rpc/test/BasicGlobalCommand.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.clustering.it.karaf.cli.rpc.test; + +import com.google.common.util.concurrent.ListenableFuture; +import org.apache.karaf.shell.api.action.Command; +import org.apache.karaf.shell.api.action.lifecycle.Reference; +import org.apache.karaf.shell.api.action.lifecycle.Service; +import org.opendaylight.clustering.it.karaf.cli.AbstractRpcAction; +import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry; +import org.opendaylight.yang.gen.v1.urn.opendaylight.controller.basic.rpc.test.rev160120.BasicGlobalInputBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.controller.basic.rpc.test.rev160120.BasicRpcTestService; +import org.opendaylight.yangtools.yang.common.RpcResult; + +@Service +@Command(scope = "test-app", name = "global-basic", description = "Run a global-basic test") +public class BasicGlobalCommand extends AbstractRpcAction { + @Reference + private RpcConsumerRegistry rpcService; + + @Override + protected ListenableFuture> invokeRpc() { + return rpcService.getRpcService(BasicRpcTestService.class).basicGlobal(new BasicGlobalInputBuilder().build()); + } +}