Fixes/improvements containing the following six listed changes
[netvirt.git] / fibmanager / fibmanager-shell / src / main / java / org / opendaylight / vpnservice / fibmanager / shell / ShowFibCommand.java
1 /*
2  * Copyright (c) 2015 - 2016 Ericsson India Global Services Pvt Ltd. 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
9 package org.opendaylight.vpnservice.fibmanager.shell;
10
11 import org.apache.karaf.shell.commands.Command;
12 import org.apache.karaf.shell.console.OsgiCommandSupport;
13 import org.opendaylight.fibmanager.api.IFibManager;
14
15 @Command(scope = "vpnservice", name = "fib-show", description = "Displays fib entries")
16 public class ShowFibCommand extends OsgiCommandSupport {
17     private IFibManager fibManager;
18
19     public void setFibManager(IFibManager fibManager) {
20         this.fibManager = fibManager;
21     }
22
23     @Override
24     protected Object doExecute() throws Exception {
25         for (String p : fibManager.printFibEntries()) {
26             System.out.println(p);
27         }
28         return null;
29     }
30 }