kalagesa | 1a1867a | 2017-03-07 13:06:41 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
kalagesa | 1a1867a | 2017-03-07 13:06:41 +0530 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package org.onosproject.fwd; |
| 17 | import org.apache.karaf.shell.commands.Command; |
| 18 | import org.onosproject.cli.AbstractShellCommand; |
| 19 | import org.apache.karaf.shell.commands.Argument; |
| 20 | import org.onlab.packet.MacAddress; |
| 21 | |
| 22 | /** |
| 23 | * Sample reactive forwarding application. |
| 24 | */ |
| 25 | @Command(scope = "onos", name = "reactive-fwd-metrics", |
| 26 | description = "List all the metrics of reactive fwd app based on mac address") |
| 27 | public class ReactiveForwardingCommand extends AbstractShellCommand { |
| 28 | @Argument(index = 0, name = "mac", description = "One Mac Address", |
| 29 | required = false, multiValued = false) |
| 30 | String mac = null; |
| 31 | @Override |
| 32 | protected void execute() { |
| 33 | ReactiveForwarding reactiveForwardingService = AbstractShellCommand.get(ReactiveForwarding.class); |
| 34 | MacAddress macAddress = null; |
| 35 | if (mac != null) { |
| 36 | macAddress = MacAddress.valueOf(mac); |
| 37 | } |
| 38 | reactiveForwardingService.printMetric(macAddress); |
| 39 | } |
| 40 | } |