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;
17 import com.google.common.util.concurrent.ListenableFuture;
19 public class ElanInterfaceRemoveWorker implements Callable<List<ListenableFuture<Void>>> {
21 private ElanInstance elanInfo;
22 private String interfaceName;
23 private InterfaceInfo interfaceInfo;
24 private ElanInterfaceManager dataChangeListener;
26 public ElanInterfaceRemoveWorker(String key, ElanInstance elanInfo, String interfaceName,
27 InterfaceInfo interfaceInfo, ElanInterfaceManager dataChangeListener) {
30 this.elanInfo = elanInfo;
31 this.interfaceName = interfaceName;
32 this.interfaceInfo = interfaceInfo;
33 this.dataChangeListener = dataChangeListener;
37 public String toString() {
38 return "ElanInterfaceRemoveWorker [key=" + key + ", elanInfo=" + elanInfo +
39 ", interfaceName=" + interfaceName
40 + ", interfaceInfo=" + interfaceInfo + "]";
44 public List<ListenableFuture<Void>> call() throws Exception {
45 List<ListenableFuture<Void>> futures = new ArrayList<>();
46 dataChangeListener.removeElanInterface(elanInfo, interfaceName, interfaceInfo);