* 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.impl.karaf;
-import java.io.PrintStream;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
+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.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.Session;
import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter;
/**
* Created by Martin Bobak <mbobak@cisco.com> on 28.5.2015.
*/
@Command(scope = "ofp", name = "reset-time-counters", description = "Resets events time counters.")
-public class ResetEventTimesComandProvider extends OsgiCommandSupport {
+@Service
+public class ResetEventTimesComandProvider implements Action {
+ @Reference
+ Session session;
@Override
- protected Object doExecute() {
- PrintStream out = session.getConsole();
+ public Object execute() {
EventsTimeCounter.resetAllCounters();
- out.print("Events time counters reset.\n");
+ session.getConsole().println("Events time counters reset.");
return null;
}
}