2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.openflowplugin.impl.karaf;
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.api.openflow.statistics.ofpspecific.MessageIntelligenceAgency;
15 import org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderImpl;
18 * Created by Martin Bobak <mbobak@cisco.com> on 21.5.2015.
20 @Command(scope = "ofp", name = "clearStats", description = "Clear openflow statistics.")
21 public class ClearStatsCommandProvider extends OsgiCommandSupport {
24 protected Object doExecute() throws Exception {
25 final MessageIntelligenceAgency messageIntelligenceAgency = OpenFlowPluginProviderImpl.getMessageIntelligenceAgency();
26 messageIntelligenceAgency.resetStatistics();
27 PrintStream out = session.getConsole();
28 out.print("Openflow plugin statistics cleaned.\n");