NETVIRT-1630 migrate to md-sal APIs
[netvirt.git] / cloud-servicechain / impl / src / main / java / org / opendaylight / netvirt / cloudservicechain / jobs / VpnPseudoPortDataBaseJob.java
1 /*
2  * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.netvirt.cloudservicechain.jobs;
9
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.genius.infra.ManagedNewTransactionRunner;
15 import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
16
17 /**
18  * Modifies VpnPseudoPort stateful data. Objects of this class are intended to
19  * be used with DataStoreJobCoordinator
20  */
21 public abstract class VpnPseudoPortDataBaseJob implements Callable<List<? extends ListenableFuture<?>>> {
22
23     final ManagedNewTransactionRunner txRunner;
24     protected final String vpnRd;
25
26     public VpnPseudoPortDataBaseJob(DataBroker dataBroker, String vpnRd) {
27         this.txRunner = new ManagedNewTransactionRunnerImpl(dataBroker);
28         this.vpnRd = vpnRd;
29     }
30
31     public String getDsJobCoordinatorKey() {
32         return "VpnPseudoPortDataUpdater." + this.vpnRd;
33     }
34
35 }