Freeze upstream versions
[genius.git] / itm / itm-impl / src / main / java / org / opendaylight / genius / itm / cli / TepShow.java
1 /*
2  * Copyright (c) 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.genius.itm.cli;
9
10 import org.apache.karaf.shell.commands.Command;
11 import org.apache.karaf.shell.console.OsgiCommandSupport;
12 import org.opendaylight.genius.itm.api.IITMProvider;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
15
16 @Command(scope = "tep", name = "show", description = "view the configured tunnel endpoints")
17 public class TepShow extends OsgiCommandSupport {
18     private static final Logger LOG = LoggerFactory.getLogger(TepShow.class);
19     private IITMProvider itmProvider;
20
21     public void setItmProvider(IITMProvider itmProvider) {
22         this.itmProvider = itmProvider;
23     }
24
25     @Override
26     @SuppressWarnings("checkstyle:RegexpSinglelineJava")
27     protected Object doExecute() {
28         LOG.debug("Executing show TEP command");
29         for (String line : itmProvider.showTeps()) {
30             System.out.println(line);
31         }
32         return null;
33     }
34
35 }