2 * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
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
9 package org.opendaylight.vpnservice.itm.cli;
11 import org.apache.karaf.shell.commands.Argument;
12 import org.apache.karaf.shell.commands.Command;
13 import org.apache.karaf.shell.console.OsgiCommandSupport;
14 import org.opendaylight.vpnservice.itm.api.IITMProvider;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
19 @Command(scope = "tep", name = "configure-tunnelType",
20 description = "configuring the tunnel type for a transport zone")
21 public class TepConfigureTunnelType extends OsgiCommandSupport {
23 @Argument(index = 0, name = "TransportZoneName", description = "TransportZoneName", required = true, multiValued = false)
24 private String tZoneName;
25 @Argument(index = 1, name = "TunnelType", description = "Tunnel-Type", required = true, multiValued = false)
26 private String tunnelType;
29 private static final Logger LOG = LoggerFactory.getLogger(TepConfigureTunnelType.class);
31 private IITMProvider itmProvider;
33 public void setItmProvider(IITMProvider itmProvider) {
34 this.itmProvider = itmProvider;
38 protected Object doExecute() {
40 LOG.debug("TepConfigureTunnelType: configureTunnelType {} for transportZone {}", tunnelType, tZoneName);
41 itmProvider.configureTunnelType(tZoneName, tunnelType);
42 } catch (IllegalArgumentException e) {
43 System.out.println(e.getMessage());
44 } catch (Exception e) {
45 System.out.println(e.getMessage());
46 LOG.error("Exception occurred during execution of command \"tep:configure-tunnelType\": ", e);