Ditch blueprint from drop-test-karaf
[openflowplugin.git] / drop-test-karaf / src / main / java / org / opendaylight / openflowplugin / droptestkaraf / ClearDropStatsCommandProvider.java
index c0cb1cbcd1804a38aa6f147d327f71c99c94131d..6c785ba1e3001ecd9573ec5498b3078ffda3f975 100644 (file)
@@ -1,34 +1,32 @@
-/**
+/*
  * Copyright (c) 2013 Cisco Systems, Inc. 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.openflowplugin.droptestkaraf;
 
-import java.io.PrintStream;
+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.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
-import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
+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 {
+    @Reference
+    DropTestRpcSender rpcProvider;
+    @Reference
+    DropTestCommiter dsProvider;
 
     @Override
     protected Object doExecute() {
-        PrintStream out = session.getConsole();
-        final DropTestRpcProvider rpcProvider = DropTestProviderImpl.getDropRpcProvider();
-        final DropTestDsProvider provider = DropTestProviderImpl.getDropDsProvider();
-
+        final var out = session.getConsole();
         out.println("Clearing drop statistics... ");
         rpcProvider.clearStats();
-        provider.clearStats();
+        dsProvider.clearStats();
         out.println("Done.");
-
         return null;
     }
-
 }