2 * Copyright (c) 2020 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.itmdirecttunnels.workers;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.List;
12 import java.util.concurrent.Callable;
13 import java.util.concurrent.ConcurrentHashMap;
14 import java.util.concurrent.ConcurrentMap;
15 import org.opendaylight.genius.itm.utils.NodeConnectorInfo;
17 public class OfPortStateAddWorkerForNodeConnector implements Callable<List<? extends ListenableFuture<?>>> {
18 private final OfPortStateAddWorker ofPortStateAddWorker;
19 private final NodeConnectorInfo nodeConnectorInfo;
20 private final ConcurrentMap<String, NodeConnectorInfo> ofPortStateInfo = new ConcurrentHashMap<>();
22 public OfPortStateAddWorkerForNodeConnector(OfPortStateAddWorker ofPortStateAddWorker,
23 NodeConnectorInfo nodeConnectorInfo) {
24 this.ofPortStateAddWorker = ofPortStateAddWorker;
25 this.nodeConnectorInfo = nodeConnectorInfo;
29 public List<? extends ListenableFuture<?>> call() throws Exception {
30 // If another renderer(for eg : OVS) needs to be supported, check can be performed here
31 // to call the respective helpers.
32 return ofPortStateAddWorker.addState(nodeConnectorInfo);
36 public String toString() {
37 return "OfPortStateAddWorkerForNodeConnector{"
38 + "ofStateInfo=" + ofPortStateInfo