本文整理汇总了Java中org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction.cancel方法的典型用法代码示例。如果您正苦于以下问题:Java ReadWriteTransaction.cancel方法的具体用法?Java ReadWriteTransaction.cancel怎么用?Java ReadWriteTransaction.cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction
的用法示例。
在下文中一共展示了ReadWriteTransaction.cancel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeOvsdbTopology
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private void initializeOvsdbTopology(LogicalDatastoreType type) {
InstanceIdentifier<Topology> path = InstanceIdentifier
.create(NetworkTopology.class)
.child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID));
ReadWriteTransaction transaction = db.newReadWriteTransaction();
CheckedFuture<Optional<Topology>, ReadFailedException> ovsdbTp = transaction.read(type, path);
try {
if (!ovsdbTp.get().isPresent()) {
TopologyBuilder tpb = new TopologyBuilder();
tpb.setTopologyId(SouthboundConstants.OVSDB_TOPOLOGY_ID);
transaction.put(type, path, tpb.build(), true);
transaction.submit();
} else {
transaction.cancel();
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("Error initializing ovsdb topology", e);
}
}
示例2: initializeHwvtepTopology
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private void initializeHwvtepTopology(LogicalDatastoreType type) {
InstanceIdentifier<Topology> path = InstanceIdentifier
.create(NetworkTopology.class)
.child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID));
ReadWriteTransaction transaction = db.newReadWriteTransaction();
CheckedFuture<Optional<Topology>, ReadFailedException> hwvtepTp = transaction.read(type, path);
try {
if (!hwvtepTp.get().isPresent()) {
TopologyBuilder tpb = new TopologyBuilder();
tpb.setTopologyId(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID);
transaction.put(type, path, tpb.build(), true);
transaction.submit();
} else {
transaction.cancel();
}
} catch (Exception e) {
LOG.error("Error initializing hwvtep topology", e);
}
}
示例3: add
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private boolean add(S input, ReadWriteTransaction tx) throws InterruptedException, ExecutionException {
Preconditions.checkNotNull(tx);
if (exists(input.getID(), tx)) {
tx.cancel();
return false;
}
addMd(input, tx);
return true;
}
示例4: remove
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private boolean remove(String uuid, ReadWriteTransaction tx) throws InterruptedException, ExecutionException {
Preconditions.checkNotNull(tx);
if (!exists(uuid, tx)) {
tx.cancel();
return false;
}
removeMd(toMd(uuid), tx);
return true;
}
示例5: update
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private boolean update(String uuid, S delta, ReadWriteTransaction tx)
throws InterruptedException, ExecutionException {
Preconditions.checkNotNull(tx);
if (!exists(uuid, tx)) {
tx.cancel();
return false;
}
updateMd(delta, tx);
return true;
}