Switch to JDT annotations for Nullable and NonNull
[netvirt.git] / elanmanager / impl / src / main / java / org / opendaylight / netvirt / elan / cli / ElanMacTableFlush.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.netvirt.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.eclipse.jdt.annotation.Nullable;
14 import org.opendaylight.netvirt.elanmanager.api.IElanService;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
17
18 @Command(scope = "elanmactable", name = "flush", description = "Flush the Mac Entries for Elan Instance")
19 public class ElanMacTableFlush extends OsgiCommandSupport {
20
21     @Argument(index = 0, name = "elanName", description = "ELAN-NAME", required = true, multiValued = false)
22     private String elanName;
23
24     private static final Logger LOG = LoggerFactory.getLogger(ElanMacTableFlush.class);
25     private IElanService elanProvider;
26
27     public void setElanProvider(IElanService elanServiceProvider) {
28         this.elanProvider = elanServiceProvider;
29     }
30
31     @Override
32     @Nullable
33     protected Object doExecute() {
34         LOG.debug("Executing mac table flush command for {}", elanName);
35         elanProvider.flushMACTable(elanName);
36         return null;
37     }
38 }