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.List;
12 import java.util.concurrent.Callable;
13 import org.opendaylight.mdsal.binding.api.DataBroker;
14 import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner;
15 import org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
19 public class OvsdbTepAddWorker implements Callable<List<? extends ListenableFuture<?>>> {
21 private static final Logger LOG = LoggerFactory.getLogger(OvsdbTepAddWorker.class) ;
23 private final String tepIp;
24 private final String strDpid;
25 private final String tzName;
26 private final boolean ofTunnel;
27 private final DataBroker dataBroker;
28 private final ManagedNewTransactionRunner txRunner;
30 public OvsdbTepAddWorker(String tepIp, String strDpnId, String tzName, boolean ofTunnel, DataBroker broker) {
32 this.strDpid = strDpnId;
34 this.ofTunnel = ofTunnel;
35 this.dataBroker = broker;
36 this.txRunner = new ManagedNewTransactionRunnerImpl(dataBroker);
40 public List<? extends ListenableFuture<?>> call() throws Exception {
41 LOG.trace("Add TEP task is picked from DataStoreJobCoordinator for execution.");
42 // add TEP received from southbound OVSDB into ITM config DS.
43 return OvsdbTepAddConfigHelper.addTepReceivedFromOvsdb(tepIp, strDpid, tzName, ofTunnel, dataBroker, txRunner);