Eliminate blueprint for drop-test-karaf commands
[openflowplugin.git] / drop-test-karaf / src / main / java / org / opendaylight / openflowplugin / droptestkaraf / ClearDropStatsCommandProvider.java
index 6c785ba1e3001ecd9573ec5498b3078ffda3f975..91b68d2b340b2bff302a178448435738255706f0 100644 (file)
@@ -7,21 +7,26 @@
  */
 package org.opendaylight.openflowplugin.droptestkaraf;
 
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Command;
 import org.apache.karaf.shell.api.action.lifecycle.Reference;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.Session;
 import org.opendaylight.openflowplugin.testcommon.DropTestCommiter;
 import org.opendaylight.openflowplugin.testcommon.DropTestRpcSender;
 
 @Command(scope = "drop-test", name = "clearDropStats", description = "Clear drop statistics.")
-public class ClearDropStatsCommandProvider extends OsgiCommandSupport {
+@Service
+public class ClearDropStatsCommandProvider implements Action {
     @Reference
     DropTestRpcSender rpcProvider;
     @Reference
     DropTestCommiter dsProvider;
+    @Reference
+    Session session;
 
     @Override
-    protected Object doExecute() {
+    public Object execute() {
         final var out = session.getConsole();
         out.println("Clearing drop statistics... ");
         rpcProvider.clearStats();