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.genius.itm.confighelpers;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.ArrayList;
12 import java.util.List;
13 import java.util.concurrent.Callable;
14 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
15 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
19 public class OvsdbTepRemoveWorker implements Callable<List<ListenableFuture<Void>>> {
21 private static final Logger LOG = LoggerFactory.getLogger(OvsdbTepRemoveWorker.class) ;
23 private final String tepIp;
24 private final String strDpid;
25 private final String tzName;
26 private final DataBroker dataBroker;
28 public OvsdbTepRemoveWorker(String tepIp, String strDpid, String tzName, DataBroker broker) {
30 this.strDpid = strDpid;
32 this.dataBroker = broker ;
36 public List<ListenableFuture<Void>> call() throws Exception {
37 List<ListenableFuture<Void>> futures = new ArrayList<>();
38 WriteTransaction wrTx = dataBroker.newWriteOnlyTransaction();
40 LOG.trace("Remove TEP task is picked from DataStoreJobCoordinator for execution.");
42 // remove TEP received from southbound OVSDB from ITM config DS.
43 OvsdbTepRemoveConfigHelper.removeTepReceivedFromOvsdb(tepIp, strDpid, tzName, dataBroker, wrTx);
45 futures.add(wrTx.submit());