blob: 3f4e0c02472590620dff0dd838fe792e1b47d556 [file] [log] [blame]
kalagesa1a1867a2017-03-07 13:06:41 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
kalagesa1a1867a2017-03-07 13:06:41 +05303 *
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 */
16package org.onosproject.fwd;
17import org.apache.karaf.shell.commands.Command;
18import org.onosproject.cli.AbstractShellCommand;
19import org.apache.karaf.shell.commands.Argument;
20import 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")
27public 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}