Eliminate blueprint for openflowplugins-impl karaf commands
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / karaf / ResetEventTimesCommand.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 package org.opendaylight.openflowplugin.impl.karaf;
9
10 import org.apache.karaf.shell.api.action.Action;
11 import org.apache.karaf.shell.api.action.Command;
12 import org.apache.karaf.shell.api.action.lifecycle.Reference;
13 import org.apache.karaf.shell.api.action.lifecycle.Service;
14 import org.apache.karaf.shell.api.console.Session;
15 import org.opendaylight.openflowplugin.impl.statistics.ofpspecific.EventsTimeCounter;
16
17 /**
18  * Created by Martin Bobak <mbobak@cisco.com> on 28.5.2015.
19  */
20 @Command(scope = "ofp", name = "reset-time-counters", description = "Resets events time counters.")
21 @Service
22 public class ResetEventTimesCommand implements Action {
23     @Reference
24     Session session;
25
26     @Override
27     public Object execute() {
28         EventsTimeCounter.resetAllCounters();
29         session.getConsole().println("Events time counters reset.");
30         return null;
31     }
32 }