1400de1a46ca1d3b25d1a04d422da19f075e88be
[netvirt.git] / vpnservice / fibmanager / fibmanager-shell / src / main / java / org / opendaylight / netvirt / fibmanager / shell / ShowTransportTypeCommand.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 package org.opendaylight.netvirt.fibmanager.shell;
9
10 import org.apache.karaf.shell.console.OsgiCommandSupport;
11 import org.apache.karaf.shell.commands.*;
12 import org.opendaylight.netvirt.fibmanager.api.IFibManager;
13
14 @Command(scope = "vpnservice", name = "showTransportType", description = "Displays transport type in use for services")
15 public class ShowTransportTypeCommand extends OsgiCommandSupport {
16     private IFibManager fibManager;
17
18     public void setFibManager(IFibManager fibManager) {
19         this.fibManager = fibManager;
20     }
21
22     @Override
23     protected Object doExecute() throws Exception {
24         String displayFormat = "%-16s %-16s";
25         String cacheVal = fibManager.getReqTransType();
26         System.out.println(String.format(displayFormat, "Service Name", "Transport Type"));
27         System.out.println("----------------------------------------------");
28         System.out.println(String.format(displayFormat, "ELAN" , "VXLAN"));
29         System.out.println(String.format(displayFormat, "L3VPN", cacheVal));
30
31         System.out.println("----------------------------------------------------------------------------------------------------------------------");
32
33         return null;
34     }
35 }