Bump versions by 0.1.0 for next dev cycle
[vpnservice.git] / elanmanager / elanmanager-impl / src / main / java / org / opendaylight / vpnservice / elan / l2gw / jobs / HwvtepDeviceMcastMacUpdateJob.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.l2gw.jobs;
9
10 import java.util.List;
11 import java.util.concurrent.Callable;
12
13 import org.opendaylight.vpnservice.elan.l2gw.utils.ElanL2GatewayMulticastUtils;
14 import org.opendaylight.vpnservice.neutronvpn.api.l2gw.L2GatewayDevice;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
17
18 import com.google.common.collect.Lists;
19 import com.google.common.util.concurrent.ListenableFuture;
20
21 public class HwvtepDeviceMcastMacUpdateJob implements Callable<List<ListenableFuture<Void>>> {
22     private static final Logger LOG = LoggerFactory.getLogger(HwvtepDeviceMcastMacUpdateJob.class);
23
24     String elanName;
25     L2GatewayDevice l2GatewayDevice;
26
27     public HwvtepDeviceMcastMacUpdateJob(String elanName, L2GatewayDevice l2GatewayDevice) {
28         this.l2GatewayDevice = l2GatewayDevice;
29         this.elanName = elanName;
30     }
31
32     public String getJobKey() {
33         return elanName;
34     }
35     @Override
36     public List<ListenableFuture<Void>> call() throws Exception {
37         LOG.info("running update mcast mac entry job for {} {}",
38                 elanName, l2GatewayDevice.getHwvtepNodeId());
39         return Lists.newArrayList(
40                 ElanL2GatewayMulticastUtils.updateRemoteMcastMacOnElanL2GwDevice(elanName, l2GatewayDevice));
41     }
42
43 }