/*
- * Copyright (c) 2015, 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2015, 2017 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import javax.annotation.Nonnull;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipCandidateRegistration;
import org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactCommand;
import org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactInvoker;
import org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactInvokerImpl;
import org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.TransactionInvoker;
-import org.opendaylight.ovsdb.lib.EchoServiceCallbackFilters;
import org.opendaylight.ovsdb.lib.LockAquisitionCallback;
import org.opendaylight.ovsdb.lib.LockStolenCallback;
import org.opendaylight.ovsdb.lib.MonitorCallBack;
private EntityOwnershipCandidateRegistration deviceOwnershipCandidateRegistration;
private HwvtepGlobalAugmentation initialCreatedData = null;
private HwvtepDeviceInfo deviceInfo;
+ private DataBroker dataBroker;
+ private final HwvtepConnectionManager hwvtepConnectionManager;
- HwvtepConnectionInstance (ConnectionInfo key, OvsdbClient client,
- InstanceIdentifier<Node> iid, TransactionInvoker txInvoker) {
+ HwvtepConnectionInstance (HwvtepConnectionManager hwvtepConnectionManager, ConnectionInfo key, OvsdbClient client,
+ InstanceIdentifier<Node> iid, TransactionInvoker txInvoker, DataBroker dataBroker) {
+ this.hwvtepConnectionManager = hwvtepConnectionManager;
this.connectionInfo = key;
this.client = client;
this.instanceIdentifier = iid;
this.txInvoker = txInvoker;
- this.deviceInfo = new HwvtepDeviceInfo();
+ this.deviceInfo = new HwvtepDeviceInfo(this);
+ this.dataBroker = dataBroker;
}
- public void transact(TransactCommand command) {
+ public synchronized void transact(TransactCommand command) {
for (TransactInvoker transactInvoker: transactInvokers.values()) {
transactInvoker.invoke(command);
}
*/
}
+ public DataBroker getDataBroker() {
+ return dataBroker;
+ }
+
public ListenableFuture<List<String>> getDatabases() {
return client.getDatabases();
}
public void setInstanceIdentifier(InstanceIdentifier<Node> iid) {
this.instanceIdentifier = iid;
+ hwvtepConnectionManager.putConnectionInstance(instanceIdentifier, this);
}
public Entity getConnectedEntity() {