2 * Copyright (c) 2017 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.netvirt.qosservice;
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.eclipse.jdt.annotation.Nullable;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
18 @Command(scope = "qos", name = "alert-poll-interval", description = "configure polling interval in minutes")
19 public class QosAlertPollIntervalCLI extends OsgiCommandSupport {
21 @Argument(index = 0, name = "<interval>", description = "polling interval in minutes",
22 required = true, multiValued = false)
23 private String interval;
25 private static final Logger LOG = LoggerFactory.getLogger(QosAlertPollIntervalCLI.class);
27 private QosAlertManager qosAlertManager;
29 public void setQosAlertManager(QosAlertManager qosAlertManager) {
30 this.qosAlertManager = qosAlertManager;
31 LOG.trace("Qos manager:{} set", qosAlertManager);
36 protected Object doExecute() {
37 LOG.debug("setting threshold in qos alert manager:{}", interval);
38 qosAlertManager.setPollInterval(Integer.parseInt(interval));