2 * Copyright (c) 2013 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
8 package org.opendaylight.openflowplugin.droptestkaraf;
10 import java.io.PrintStream;
11 import org.apache.karaf.shell.commands.Command;
12 import org.apache.karaf.shell.console.OsgiCommandSupport;
13 import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
14 import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
16 @Command(scope = "drop-test", name = "clearDropStats", description = "Clear drop statistics.")
17 public class ClearDropStatsCommandProvider extends OsgiCommandSupport {
20 protected Object doExecute() {
21 PrintStream out = session.getConsole();
22 final DropTestRpcProvider rpcProvider = DropTestProviderImpl.getDropRpcProvider();
23 final DropTestDsProvider provider = DropTestProviderImpl.getDropDsProvider();
25 out.println("Clearing drop statistics... ");
26 rpcProvider.clearStats();
27 provider.clearStats();