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.netvirt.elan.cli;
10 import java.util.List;
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.netvirt.elanmanager.api.IElanService;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
18 @Command(scope = "elanInterface", name = "update", description = "updating Elan Interface")
19 public class ElanInterfaceUpdate extends OsgiCommandSupport {
21 @Argument(index = 0, name = "elanName", description = "ELAN-NAME", required = true, multiValued = false)
22 private String elanName;
23 @Argument(index = 1, name = "interfaceName", description = "InterfaceName", required = true, multiValued = false)
24 private String interfaceName;
25 @Argument(index = 2, name = "staticMacAddresses", description = "StaticMacAddresses", required = false,
27 private List<String> staticMacAddresses;
28 @Argument(index = 3, name = "elanInterfaceDescr", description = "ELAN Interface-Description", required = false,
30 private String elanInterfaceDescr;
31 private static final Logger LOG = LoggerFactory.getLogger(ElanInterfaceUpdate.class);
32 private IElanService elanProvider;
34 public void setElanProvider(IElanService elanServiceProvider) {
35 this.elanProvider = elanServiceProvider;
39 protected Object doExecute() throws Exception {
40 LOG.debug("Executing updating ElanInterface command" + "\t" + elanName + "\t" + interfaceName + "\t"
41 + staticMacAddresses + "\t" + elanInterfaceDescr + "\t");
42 elanProvider.updateElanInterface(elanName, interfaceName, staticMacAddresses, elanInterfaceDescr);