ELAN FT Support for BE
[vpnservice.git] / elanmanager / elanmanager-impl / src / main / java / org / opendaylight / vpnservice / elan / cli / StaticMacDelete.java
1 /*
2  * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.vpnservice.elan.cli;
9
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.elanmanager.api.IElanService;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16
17 @Command(scope = "staticMac", name = "delete", description = "deleting Static Mac Address")
18 public class StaticMacDelete  extends OsgiCommandSupport {
19
20     @Argument(index = 0, name = "elanName", description = "ELAN-NAME", required = true, multiValued = false)
21     private String elanName;
22     @Argument(index = 1, name = "interfaceName", description = "InterfaceName", required = true, multiValued = false)
23     private String interfaceName;
24     @Argument(index = 2, name = "staticMacAddress", description = "StaticMacAddress", required = true, multiValued = false)
25     private String staticMacAddress;
26     private static final Logger logger = LoggerFactory.getLogger(StaticMacDelete.class);
27     private IElanService elanProvider;
28
29     public void setElanProvider(IElanService elanServiceProvider) {
30         this.elanProvider = elanServiceProvider;
31     }
32
33     @Override
34     protected Object doExecute() {
35         try {
36             logger.debug("Executing create ElanInterface command" + "\t" + elanName + "\t" + interfaceName + "\t" + staticMacAddress + "\t");
37             elanProvider.deleteStaticMacAddress(elanName, interfaceName, staticMacAddress);
38         } catch (Exception e) {
39
40             e.printStackTrace();
41         }
42         return null;
43     }
44 }