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 javax.annotation.Nullable;
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 = "staticMac", name = "delete", description = "deleting Static Mac Address")
19 public class StaticMacDelete 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 = "staticMacAddress", description = "StaticMacAddress", required = true,
27 private String staticMacAddress;
28 private static final Logger LOG = LoggerFactory.getLogger(StaticMacDelete.class);
29 private IElanService elanProvider;
31 public void setElanProvider(IElanService elanServiceProvider) {
32 this.elanProvider = elanServiceProvider;
37 protected Object doExecute() {
38 LOG.debug("Executing static mac delete command for elanName:{}, interfaceName:{}, staticMacAddress:{}",
39 elanName, interfaceName, staticMacAddress);
40 elanProvider.deleteStaticMacAddress(interfaceName, staticMacAddress);