Merge "Drop the odlparent.netty property"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / karaf / ResetSessionStatsComandProvider.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowplugin.impl.karaf;
10
11 import java.io.PrintStream;
12 import org.apache.karaf.shell.commands.Command;
13 import org.apache.karaf.shell.console.OsgiCommandSupport;
14 import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.SessionStatistics;
15
16 /**
17  * Created by Martin Bobak <mbobak@cisco.com> on 28.5.2015.
18  */
19 @Command(scope = "ofp", name = "reset-session-stats", description = "Resets session statistics counters.")
20 public class ResetSessionStatsComandProvider extends OsgiCommandSupport {
21
22     @Override
23     protected Object doExecute() throws Exception {
24         PrintStream out = session.getConsole();
25         SessionStatistics.resetAllCounters();
26         out.print("Session statistics counters reset.\n");
27         return null;
28     }
29 }