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.vpnservice.elan.internal;
10 import java.util.ArrayList;
11 import java.util.List;
12 import java.util.concurrent.Callable;
14 import org.opendaylight.vpnservice.interfacemgr.globals.InterfaceInfo;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.elan.rev150602.elan.instances.ElanInstance;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.elan.rev150602.elan.interfaces.ElanInterface;
18 import com.google.common.util.concurrent.ListenableFuture;
20 public class ElanInterfaceAddWorker implements Callable<List<ListenableFuture<Void>>> {
22 private ElanInterface elanInterface;
23 private ElanInstance elanInstance;
24 private InterfaceInfo interfaceInfo;
25 private ElanInterfaceManager dataChangeListener;
27 public ElanInterfaceAddWorker(String key, ElanInterface elanInterface, InterfaceInfo interfaceInfo,
28 ElanInstance elanInstance, ElanInterfaceManager dataChangeListener) {
31 this.elanInterface = elanInterface;
32 this.interfaceInfo = interfaceInfo;
33 this.elanInstance = elanInstance;
34 this.dataChangeListener = dataChangeListener;
38 public String toString() {
39 return "ElanInterfaceAddWorker [key=" + key + ", elanInterface=" + elanInterface + ", elanInstance="
40 + elanInstance + ", interfaceInfo=" + interfaceInfo + "]";
45 public List<ListenableFuture<Void>> call() throws Exception {
46 List<ListenableFuture<Void>> futures = new ArrayList<>();
47 dataChangeListener.addElanInterface(elanInterface, interfaceInfo, elanInstance);