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
8 package org.opendaylight.vpnservice.itm.cli;
10 import org.apache.karaf.shell.commands.Argument;
11 import org.apache.karaf.shell.commands.Command;
12 import org.apache.karaf.shell.console.OsgiCommandSupport;
13 import org.opendaylight.vpnservice.itm.api.IITMProvider;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
17 @Command(scope = "tep", name = "monitor-interval", description = "configuring tunnel monitoring time interval")
18 public class TepMonitor extends OsgiCommandSupport {
20 @Argument(index = 0, name = "interval", description = "monitoring interval", required = true,
22 private Integer interval;
24 private static final Logger logger = LoggerFactory.getLogger(TepMonitor.class);
25 private IITMProvider itmProvider;
27 public void setItmProvider(IITMProvider itmProvider) {
28 this.itmProvider = itmProvider;
32 protected Object doExecute() {
34 logger.debug("Executing TEP monitor command with interval: " + "\t" + interval);
35 if(!(interval >= 5 && interval <=30)){
36 System.out.println("Monitoring Interval must be in the range 5 - 30");
39 itmProvider.configureTunnelMonitorInterval(interval);
41 } catch (Exception e) {