Introduce cli commands for clustering-test-app 14/97414/7
authorDominik Vrbovsky <dominik.vrbovsky@pantheon.tech>
Tue, 7 Sep 2021 16:10:31 +0000 (18:10 +0200)
committerDominik Vrbovsky <dominik.vrbovsky@pantheon.tech>
Mon, 13 Sep 2021 17:02:20 +0000 (19:02 +0200)
Rework the rpcs needed by csit in clustering-test-app to Karaf CLI commands.
This is essentially a custom-coded invocation of MD-SAL services.

JIRA: CONTROLLER-1995
Change-Id: If406a4dff6d441e9d0932de05f844d66f1e5bc83
Signed-off-by: Dominik Vrbovsky <dominik.vrbovsky@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
41 files changed:
artifacts/pom.xml
features/odl-clustering-test-app/pom.xml
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/pom.xml [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/AbstractRpcAction.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/DefaultInstanceIdentifierSupport.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/InstanceIdentifierSupport.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/RegisterCommitCohortCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/RegisterLoggingDtclCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/RegisterOwnershipCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/StopStressTestCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/StressTestCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/UnregisterCommitCohortCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/UnregisterLoggingDtclsCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/UnregisterOwnershipCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/purchase/BuyCarCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/AddShardReplicaCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/CheckPublishNotificationsCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/IsClientAbortedCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RegisterBoundConstantCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RegisterConstantCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RegisterDefaultConstantCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RegisterFlappingSingletonCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RegisterSingletonConstantCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RemoveShardReplicaCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/ShutdownShardReplicaCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/StartPublishNotificationsCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/SubscribeDdtlCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/SubscribeDtclCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/SubscribeYnlCommand.java [new file with mode: 0644]
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 with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnregisterConstantCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnregisterDefaultConstantCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnregisterFlappingSingletonCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnregisterSingletonConstantCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnsubscribeDdtlCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnsubscribeDtclCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnsubscribeYnlCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/WriteTransactionsCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/people/AddPersonCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/rpc/test/BasicGlobalCommand.java [new file with mode: 0644]
opendaylight/md-sal/samples/clustering-test-app/pom.xml

index 5cead0bc16451b0a055e651e423fce6e325da10e..61e96f4120ad6b59dcc8916f2cf3f1ee8889635f 100644 (file)
                 <artifactId>clustering-it-provider</artifactId>
                 <version>${project.version}</version>
             </dependency>
                 <artifactId>clustering-it-provider</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.opendaylight.controller.samples</groupId>
+                <artifactId>clustering-it-karaf-cli</artifactId>
+                <version>${project.version}</version>
+            </dependency>
 
             <!-- Config files -->
             <dependency>
 
             <!-- Config files -->
             <dependency>
index d8f40d32ecae4e7958b9504030dd5914e46e33fc..c480eb8843767191d407d9247578361b9e3d4dd7 100644 (file)
@@ -39,5 +39,9 @@
             <groupId>org.opendaylight.controller.samples</groupId>
             <artifactId>clustering-it-provider</artifactId>
         </dependency>
             <groupId>org.opendaylight.controller.samples</groupId>
             <artifactId>clustering-it-provider</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller.samples</groupId>
+            <artifactId>clustering-it-karaf-cli</artifactId>
+        </dependency>
     </dependencies>
 </project>
     </dependencies>
 </project>
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/pom.xml b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/pom.xml
new file mode 100644 (file)
index 0000000..e76ce4a
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright © 2021 PANTHEON.tech, s.r.o. and others.
+
+ 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
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>mdsal-parent</artifactId>
+        <groupId>org.opendaylight.controller</groupId>
+        <version>4.0.3-SNAPSHOT</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.opendaylight.controller.samples</groupId>
+    <artifactId>clustering-it-karaf-cli</artifactId>
+    <packaging>bundle</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.karaf.shell</groupId>
+            <artifactId>org.apache.karaf.shell.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal</groupId>
+            <artifactId>mdsal-binding-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal</groupId>
+            <artifactId>mdsal-binding-dom-codec-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller.samples</groupId>
+            <artifactId>clustering-it-model</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-data-codec-gson</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.service.component.annotations</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.karaf.tooling</groupId>
+                <artifactId>karaf-services-maven-plugin</artifactId>
+                <version>${karaf.version}</version>
+                <executions>
+                    <execution>
+                        <id>service-metadata-generate</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>service-metadata-generate</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/AbstractRpcAction.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/AbstractRpcAction.java
new file mode 100644 (file)
index 0000000..d76dbb5
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import java.util.concurrent.ExecutionException;
+import org.apache.karaf.shell.api.action.Action;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+/**
+ * Common base class for all commands which end up invoking an RPC.
+ */
+public abstract class AbstractRpcAction implements Action {
+    @Override
+    @SuppressWarnings("checkstyle:RegexpSinglelineJava")
+    public final Object execute() throws InterruptedException, ExecutionException {
+        final RpcResult<?> result = invokeRpc().get();
+        if (!result.isSuccessful()) {
+            // FIXME: is there a better way to report errors?
+            System.out.println("Invocation failed: " + result.getErrors());
+        }
+        return null;
+    }
+
+    protected abstract ListenableFuture<? extends RpcResult<?>> invokeRpc();
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/DefaultInstanceIdentifierSupport.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/DefaultInstanceIdentifierSupport.java
new file mode 100644 (file)
index 0000000..7590c3c
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * 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;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Verify.verifyNotNull;
+
+import java.util.Optional;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTree;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingInstanceIdentifierCodec;
+import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
+import org.opendaylight.yangtools.yang.data.util.codec.TypeAwareCodec;
+import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.TypeAware;
+import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
+import org.opendaylight.yangtools.yang.model.api.type.InstanceIdentifierTypeDefinition;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.RequireServiceComponentRuntime;
+
+@Component
+@RequireServiceComponentRuntime
+public final class DefaultInstanceIdentifierSupport implements InstanceIdentifierSupport {
+    private final BindingInstanceIdentifierCodec bindingCodec;
+    private final TypeAwareCodec<?, ?, ?> jsonCodec;
+
+    @Activate
+    public DefaultInstanceIdentifierSupport(@Reference final BindingCodecTree bindingCodecTree,
+            @Reference final BindingRuntimeContext runtimeContext) {
+        bindingCodec = bindingCodecTree.getInstanceIdentifierCodec();
+        jsonCodec = JSONCodecFactorySupplier.RFC7951.createLazy(runtimeContext.getEffectiveModelContext())
+            .codecFor(new FakeLeafDefinition(), null);
+    }
+
+    @Override
+    public InstanceIdentifier<?> parseArgument(final String argument) {
+        final YangInstanceIdentifier path = verifyNotNull((YangInstanceIdentifier)jsonCodec.parseValue(null, argument));
+        final InstanceIdentifier<?> ret = bindingCodec.toBinding(path);
+        checkArgument(ret != null, "%s does not have a binding representation", path);
+        return ret;
+    }
+
+    // Mock wiring for JSON codec. Perhaps we should really bind to context-ref, or receive the class, or something.
+    private static final class FakeLeafDefinition implements InstanceIdentifierTypeDefinition, TypeAware {
+        @Override
+        public Optional<String> getReference() {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public Optional<String> getDescription() {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public Status getStatus() {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public QName getQName() {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public Optional<String> getUnits() {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public Optional<? extends Object> getDefaultValue() {
+            throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public InstanceIdentifierTypeDefinition getBaseType() {
+            return null;
+        }
+
+        @Override
+        public boolean requireInstance() {
+            return false;
+        }
+
+        @Override
+        public TypeDefinition<? extends TypeDefinition<?>> getType() {
+            return this;
+        }
+    }
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/InstanceIdentifierSupport.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/InstanceIdentifierSupport.java
new file mode 100644 (file)
index 0000000..e7724dc
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * 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;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * Codec providing translation between CLI representation and {@link InstanceIdentifier}. This is mostly useful for
+ * injecting invocation contexts for {@code routed RPC}s and actions.
+ */
+public interface InstanceIdentifierSupport {
+    /**
+     * Parse a CLI argument into its {@link InstanceIdentifier} representation.
+     *
+     * @param argument Argument to parse
+     * @return Parse InstanceIdentifier
+     * @throws NullPointerException if {@code argument} is null
+     */
+    @NonNull InstanceIdentifier<?> parseArgument(String argument);
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/RegisterCommitCohortCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/RegisterCommitCohortCommand.java
new file mode 100644 (file)
index 0000000..ed42936
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.car;
+
+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.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.CarService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.RegisterCommitCohortInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "register-commit-cohort", description = "Run a register-commit-cohort test")
+public class RegisterCommitCohortCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(CarService.class)
+            .registerCommitCohort(new RegisterCommitCohortInputBuilder().build());
+    }
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/RegisterLoggingDtclCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/RegisterLoggingDtclCommand.java
new file mode 100644 (file)
index 0000000..dba686f
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.car;
+
+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.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.CarService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.RegisterLoggingDtclInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "register-logging-dtcl", description = "Run a register-logging-dtcl test")
+public class RegisterLoggingDtclCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(CarService.class)
+            .registerLoggingDtcl(new RegisterLoggingDtclInputBuilder().build());
+    }
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/RegisterOwnershipCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/RegisterOwnershipCommand.java
new file mode 100644 (file)
index 0000000..60cc098
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * 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.car;
+
+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.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.CarService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.RegisterOwnershipInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "register-ownership", description = "Run a register-ownership test")
+public class RegisterOwnershipCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "car-id", required = true)
+    String carId;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(CarService.class)
+            .registerOwnership(new RegisterOwnershipInputBuilder().setCarId(carId).build());
+    }
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/StopStressTestCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/StopStressTestCommand.java
new file mode 100644 (file)
index 0000000..7a41268
--- /dev/null
@@ -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.car;
+
+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.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.CarService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.StopStressTestInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app" , name = "stop-stress-test", description = "Run a stop-stress-test")
+public class StopStressTestCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(CarService.class).stopStressTest(new StopStressTestInputBuilder().build());
+    }
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/StressTestCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/StressTestCommand.java
new file mode 100644 (file)
index 0000000..6b9e64a
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * 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.car;
+
+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.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.CarService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.StressTestInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+
+@Service
+@Command(scope = "test-app" , name = "stress-test", description = "Run a stress-test")
+public class StressTestCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "rate", required = true)
+    int rate;
+    @Argument(index = 1, name = "count", required = true)
+    long count;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(CarService.class).stressTest(new StressTestInputBuilder()
+            .setRate(Uint16.valueOf(rate))
+            .setCount(Uint32.valueOf(count))
+            .build());
+    }
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/UnregisterCommitCohortCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/UnregisterCommitCohortCommand.java
new file mode 100644 (file)
index 0000000..c0e0f4e
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.car;
+
+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.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.CarService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.UnregisterCommitCohortInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "unregister-commit-cohort", description = "Run a unregister-commit-cohort test")
+public class UnregisterCommitCohortCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(CarService.class)
+            .unregisterCommitCohort(new UnregisterCommitCohortInputBuilder().build());
+    }
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/UnregisterLoggingDtclsCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/UnregisterLoggingDtclsCommand.java
new file mode 100644 (file)
index 0000000..e3891fd
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.car;
+
+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.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.CarService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.UnregisterLoggingDtclsInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "unregister-logging-dtcls", description = "Run and unregister-logging-dtcls test")
+public class UnregisterLoggingDtclsCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(CarService.class)
+            .unregisterLoggingDtcls(new UnregisterLoggingDtclsInputBuilder().build());
+    }
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/UnregisterOwnershipCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/UnregisterOwnershipCommand.java
new file mode 100644 (file)
index 0000000..e699139
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * 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.car;
+
+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.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.CarService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.UnregisterOwnershipInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+
+@Service
+@Command(scope = "test-app", name = "unregister-ownership", description = "Run an unregister-ownership test")
+public class UnregisterOwnershipCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "car-id", required = true)
+    String carId;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(CarService.class)
+            .unregisterOwnership(new UnregisterOwnershipInputBuilder().setCarId(carId).build());
+    }
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/purchase/BuyCarCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/car/purchase/BuyCarCommand.java
new file mode 100644 (file)
index 0000000..f06d71f
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * 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.car.purchase;
+
+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.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.purchase.rev140818.BuyCarInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.purchase.rev140818.CarPurchaseService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.car.rev140818.CarId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.people.rev140818.PersonId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.people.rev140818.PersonRef;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "buy-car", description = "Run a buy-car test")
+public class BuyCarCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Reference
+    private InstanceIdentifierSupport iidSupport;
+    @Argument(index = 0, name = "person-ref", required = true)
+    String personRef;
+    @Argument(index = 1, name = "car-id", required = true)
+    CarId carId;
+    @Argument(index = 2, name = "person-id", required = true)
+    PersonId personId;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(CarPurchaseService.class).buyCar(new BuyCarInputBuilder()
+            .setPerson(new PersonRef(iidSupport.parseArgument(personRef)))
+            .setCarId(carId)
+            .setPersonId(personId)
+            .build());
+    }
+}
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/AddShardReplicaCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/AddShardReplicaCommand.java
new file mode 100644 (file)
index 0000000..3280a5c
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * 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.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.AddShardReplicaInputBuilder;
+import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.OdlMdsalLowlevelControlService;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "add-shard-replica", description = "Run an add-shard-replica test")
+public class AddShardReplicaCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "shard-name", required = true)
+    String shardName;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .addShardReplica(new AddShardReplicaInputBuilder().setShardName(shardName).build());
+    }
+}
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/CheckPublishNotificationsCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/CheckPublishNotificationsCommand.java
new file mode 100644 (file)
index 0000000..818a9f9
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * 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.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.CheckPublishNotificationsInputBuilder;
+import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.OdlMdsalLowlevelControlService;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "check-publish-notifications",
+         description = "Run a check-publish-notifications test")
+public class CheckPublishNotificationsCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "id", required = true)
+    String id;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .checkPublishNotifications(new CheckPublishNotificationsInputBuilder()
+                        .setId(id)
+                        .build());
+    }
+}
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/IsClientAbortedCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/IsClientAbortedCommand.java
new file mode 100644 (file)
index 0000000..0b238ee
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.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.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.IsClientAbortedInputBuilder;
+import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.OdlMdsalLowlevelControlService;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "is-client-aborted", description = "Run an is-client-aborted test")
+public class IsClientAbortedCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .isClientAborted(new IsClientAbortedInputBuilder().build());
+    }
+}
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/RegisterBoundConstantCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RegisterBoundConstantCommand.java
new file mode 100644 (file)
index 0000000..9fc92a3
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * 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.RegisterBoundConstantInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "register-bound-constant", description = "Run a register-bound-constant test")
+public class RegisterBoundConstantCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Reference
+    private InstanceIdentifierSupport iidSupport;
+    @Argument(index =  0, name = "context", required = true)
+    String context;
+    @Argument(index =  1, name = "constant", required = true)
+    String constant;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .registerBoundConstant(new RegisterBoundConstantInputBuilder()
+                        .setConstant(constant)
+                        .setContext(iidSupport.parseArgument(context))
+                        .build());
+    }
+}
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/RegisterConstantCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RegisterConstantCommand.java
new file mode 100644 (file)
index 0000000..e9a9ce9
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * 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.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.RegisterConstantInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "register-contact", description = "Run a register-contact test")
+public class RegisterConstantCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index =  0, name = "constant", required = true)
+    String constant;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .registerConstant(new RegisterConstantInputBuilder().setConstant(constant).build());
+    }
+}
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/RegisterDefaultConstantCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RegisterDefaultConstantCommand.java
new file mode 100644 (file)
index 0000000..8aac812
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * 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.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.RegisterDefaultConstantInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "register-default-constant", description = "Run a register-default-constant test")
+public class RegisterDefaultConstantCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index =  0, name = "constant", required = true)
+    String constant;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .registerDefaultConstant(new RegisterDefaultConstantInputBuilder()
+                        .setConstant(constant)
+                        .build());
+    }
+}
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/RegisterFlappingSingletonCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RegisterFlappingSingletonCommand.java
new file mode 100644 (file)
index 0000000..8bd75fb
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * 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.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.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.RegisterFlappingSingletonInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "register-flapping-singleton",
+         description = "Run a register-flapping-singleton test")
+public class RegisterFlappingSingletonCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .registerFlappingSingleton(new RegisterFlappingSingletonInputBuilder().build());
+    }
+}
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/RegisterSingletonConstantCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RegisterSingletonConstantCommand.java
new file mode 100644 (file)
index 0000000..d5054c0
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * 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.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.RegisterSingletonConstantInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "register-singleton-constant",
+         description = "Run a register-singleton-constant text")
+public class RegisterSingletonConstantCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "constant", required = true)
+    String constant;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .registerSingletonConstant(new RegisterSingletonConstantInputBuilder()
+                        .setConstant(constant)
+                        .build());
+
+    }
+}
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/RemoveShardReplicaCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/RemoveShardReplicaCommand.java
new file mode 100644 (file)
index 0000000..fad24dd
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * 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.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.RemoveShardReplicaInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "remove-shard-replica", description = "Run a remove-shard-replica test")
+public class RemoveShardReplicaCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "shard-name", required = true)
+    String shardName;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .removeShardReplica(new RemoveShardReplicaInputBuilder().setShardName(shardName).build());
+    }
+}
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/ShutdownShardReplicaCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/ShutdownShardReplicaCommand.java
new file mode 100644 (file)
index 0000000..1a75b5b
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * 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.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.ShutdownShardReplicaInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "shutdown-shard-replica", description = " Run a shutdown-shard-replica test")
+public class ShutdownShardReplicaCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "shard-name", required = true)
+    String shardName;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .shutdownShardReplica(new ShutdownShardReplicaInputBuilder()
+                        .setShardName(shardName)
+                        .build());
+    }
+}
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/StartPublishNotificationsCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/StartPublishNotificationsCommand.java
new file mode 100644 (file)
index 0000000..bf17708
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * 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.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.StartPublishNotificationsInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.Uint32;
+
+@Service
+@Command(scope = "test-app", name = "start-publish-notifications",
+         description = "Run a start-publish-notifications test")
+public class StartPublishNotificationsCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "id", required = true)
+    String id;
+    @Argument(index = 1, name = "seconds", required = true)
+    long seconds;
+    @Argument(index = 2, name = "notifications-per-second", required = true)
+    long notificationsPerSecond;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .startPublishNotifications(new StartPublishNotificationsInputBuilder()
+                        .setId(id)
+                        .setSeconds(Uint32.valueOf(seconds))
+                        .setNotificationsPerSecond(Uint32.valueOf(notificationsPerSecond))
+                        .build());
+    }
+}
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/SubscribeDdtlCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/SubscribeDdtlCommand.java
new file mode 100644 (file)
index 0000000..3a58f63
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.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.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.SubscribeDdtlInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "subscribe-ddtl", description = "Run a subscribe-ddtl test")
+public class SubscribeDdtlCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .subscribeDdtl(new SubscribeDdtlInputBuilder().build());
+    }
+}
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/SubscribeDtclCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/SubscribeDtclCommand.java
new file mode 100644 (file)
index 0000000..4c20e60
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.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.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.SubscribeDtclInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "subscribe-dtcl", description = "Run a subscribe-dtcl test")
+public class SubscribeDtclCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .subscribeDtcl(new SubscribeDtclInputBuilder().build());
+    }
+}
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/SubscribeYnlCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/SubscribeYnlCommand.java
new file mode 100644 (file)
index 0000000..523650e
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * 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.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.SubscribeYnlInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "subscribe-ynl", description = "Run a subscribe-ynl test")
+public class SubscribeYnlCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "id", required = true)
+    String id;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .subscribeYnl(new SubscribeYnlInputBuilder().setId(id).build());
+    }
+}
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 (file)
index 0000000..76dc4d5
--- /dev/null
@@ -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<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .unregisterBoundConstant(new UnregisterBoundConstantInputBuilder()
+                        .setContext(iidSupport.parseArgument(context))
+                        .build());
+    }
+}
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/UnregisterConstantCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnregisterConstantCommand.java
new file mode 100644 (file)
index 0000000..da761b3
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.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.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.UnregisterConstantInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "unregister-constant", description = "Run an unregister-constant test")
+public class UnregisterConstantCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .unregisterConstant(new UnregisterConstantInputBuilder().build());
+    }
+}
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/UnregisterDefaultConstantCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnregisterDefaultConstantCommand.java
new file mode 100644 (file)
index 0000000..565b72d
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * 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.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.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.UnregisterDefaultConstantInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "unregister-default-constant",
+         description = "Run an unregister-default-constant test")
+public class UnregisterDefaultConstantCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .unregisterDefaultConstant(new UnregisterDefaultConstantInputBuilder().build());
+    }
+}
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/UnregisterFlappingSingletonCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnregisterFlappingSingletonCommand.java
new file mode 100644 (file)
index 0000000..de7cc5b
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * 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.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.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.UnregisterFlappingSingletonInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "unregister-flapping-singleton",
+        description = "Run an unregister-flapping-singleton test")
+public class UnregisterFlappingSingletonCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .unregisterFlappingSingleton(new UnregisterFlappingSingletonInputBuilder().build());
+    }
+}
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/UnregisterSingletonConstantCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnregisterSingletonConstantCommand.java
new file mode 100644 (file)
index 0000000..7923430
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * 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.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.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.UnregisterSingletonConstantInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "unregister-singleton-constant",
+        description = "Run an unregister-singleton-constant test")
+public class UnregisterSingletonConstantCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .unregisterSingletonConstant(new UnregisterSingletonConstantInputBuilder().build());
+    }
+}
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/UnsubscribeDdtlCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnsubscribeDdtlCommand.java
new file mode 100644 (file)
index 0000000..b44639d
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.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.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.UnsubscribeDdtlInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "unsubscribe-ddtl", description = "Run an unsubscribe-ddtl test")
+public class UnsubscribeDdtlCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .unsubscribeDdtl(new UnsubscribeDdtlInputBuilder().build());
+    }
+}
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/UnsubscribeDtclCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnsubscribeDtclCommand.java
new file mode 100644 (file)
index 0000000..99ab3dc
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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.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.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.UnsubscribeDtclInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "unsubscribe-dtcl", description = "Run an unsubscribe-dtcl test")
+public class UnsubscribeDtclCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .unsubscribeDtcl(new UnsubscribeDtclInputBuilder().build());
+    }
+}
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/UnsubscribeYnlCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/UnsubscribeYnlCommand.java
new file mode 100644 (file)
index 0000000..e9d1104
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * 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.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.UnsubscribeYnlInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+@Service
+@Command(scope = "test-app", name = "unsubscribe-ynl", description = "Run an unsubscribe-ynl test")
+public class UnsubscribeYnlCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "id", required = true)
+    String id;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .unsubscribeYnl(new UnsubscribeYnlInputBuilder()
+                        .setId(id)
+                        .build());
+    }
+}
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/WriteTransactionsCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/odl/mdsal/lowlevel/control/WriteTransactionsCommand.java
new file mode 100644 (file)
index 0000000..60288cd
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * 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.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.WriteTransactionsInputBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.Uint32;
+
+@Service
+@Command(scope = "test-app", name = "write-transactions", description = "Run a write-transactions test")
+public class WriteTransactionsCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "id", required = true)
+    String id;
+    @Argument(index = 1, name = "seconds", required = true)
+    long seconds;
+    @Argument(index = 2, name = "trasactions-per-second", required = true)
+    long transactionsPerSecond;
+    @Argument(index = 3, name = "chained-transations", required = true)
+    boolean chainedTransactions;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(OdlMdsalLowlevelControlService.class)
+                .writeTransactions(new WriteTransactionsInputBuilder()
+                        .setId(id)
+                        .setSeconds(Uint32.valueOf(seconds))
+                        .setTransactionsPerSecond(Uint32.valueOf(transactionsPerSecond))
+                        .setChainedTransactions(chainedTransactions)
+                        .build());
+    }
+}
diff --git a/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/people/AddPersonCommand.java b/opendaylight/md-sal/samples/clustering-test-app/karaf-cli/src/main/java/org/opendaylight/clustering/it/karaf/cli/people/AddPersonCommand.java
new file mode 100644 (file)
index 0000000..037b122
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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.people;
+
+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.mdsal.binding.api.RpcConsumerRegistry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.people.rev140818.AddPersonInputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.people.rev140818.PeopleService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.sal.clustering.it.people.rev140818.PersonId;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.Uint32;
+
+@Service
+@Command(scope = "test-app", name = "add-person", description = " Run an add-person test")
+public class AddPersonCommand extends AbstractRpcAction {
+    @Reference
+    private RpcConsumerRegistry rpcService;
+    @Argument(index = 0, name = "id", required = true)
+    PersonId id;
+    @Argument(index = 1, name = "gender", required = true)
+    String gender;
+    @Argument(index = 2, name = "age", required = true)
+    long age;
+    @Argument(index = 3, name = "address", required = true)
+    String address;
+    @Argument(index = 4, name = "contactNo", required = true)
+    String contactNo;
+
+    @Override
+    protected ListenableFuture<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(PeopleService.class).addPerson(new AddPersonInputBuilder()
+                .setId(id)
+                .setGender(gender)
+                .setAge(Uint32.valueOf(age))
+                .setAddress(address)
+                .setContactNo(contactNo)
+                .build());
+    }
+}
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 (file)
index 0000000..fa88ed0
--- /dev/null
@@ -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<? extends RpcResult<?>> invokeRpc() {
+        return rpcService.getRpcService(BasicRpcTestService.class).basicGlobal(new BasicGlobalInputBuilder().build());
+    }
+}
index f57c119a7756cf3c3564b9462c9364bf8db112a7..2c26261607fd7f7b3aa17fadcc709c53c4438003 100644 (file)
@@ -20,6 +20,7 @@
 
     <modules>
         <module>configuration</module>
 
     <modules>
         <module>configuration</module>
+        <module>karaf-cli</module>
         <module>model</module>
         <module>provider</module>
     </modules>
         <module>model</module>
         <module>provider</module>
     </modules>