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%2Fodl%2Fmdsal%2Flowlevel%2Fcontrol%2FUnregisterBoundConstantCommand.java;fp=opendaylight%2Fmd-sal%2Fsamples%2Fclustering-test-app%2Fkaraf-cli%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fclustering%2Fit%2Fkaraf%2Fcli%2Fodl%2Fmdsal%2Flowlevel%2Fcontrol%2FUnregisterBoundConstantCommand.java;h=76dc4d50f4cd2cb8a54860d669f2d5831fc5daaf;hp=0000000000000000000000000000000000000000;hb=771f58ab713985d0c797c80079c603256876d8d4;hpb=5ac9fde46859115aa155009eae00ac0748f77be7 diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnregisterBoundConstantCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnregisterBoundConstantCommand.java new file mode 100644 index 0000000000..76dc4d50f4 --- /dev/null +++ b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnregisterBoundConstantCommand.java @@ -0,0 +1,39 @@ +/* + * 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.odl.mdsal.lowlevel.control; + +import com.google.common.util.concurrent.ListenableFuture; +import org.apache.karaf.shell.api.action.Argument; +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.clustering.it.karaf.cli.InstanceIdentifierSupport; +import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry; +import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.OdlMdsalLowlevelControlService; +import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.UnregisterBoundConstantInputBuilder; +import org.opendaylight.yangtools.yang.common.RpcResult; + +@Service +@Command(scope = "test-app", name = "unregister-bound-constant", description = "Run an unregister-bound-constant test") +public class UnregisterBoundConstantCommand extends AbstractRpcAction { + @Reference + private RpcConsumerRegistry rpcService; + @Reference + private InstanceIdentifierSupport iidSupport; + @Argument(index = 0, name = "context", required = true) + String context; + + @Override + protected ListenableFuture> invokeRpc() { + return rpcService.getRpcService(OdlMdsalLowlevelControlService.class) + .unregisterBoundConstant(new UnregisterBoundConstantInputBuilder() + .setContext(iidSupport.parseArgument(context)) + .build()); + } +}