本文整理汇总了Java中org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction.delete方法的典型用法代码示例。如果您正苦于以下问题:Java ReadWriteTransaction.delete方法的具体用法?Java ReadWriteTransaction.delete怎么用?Java ReadWriteTransaction.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction
的用法示例。
在下文中一共展示了ReadWriteTransaction.delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: remove
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
@Override
protected void remove(final InstanceIdentifier<L2gateway> identifier, final L2gateway input) {
LOG.info("Removing L2gateway with ID: {}", input.getUuid());
List<L2gatewayConnection> connections = l2gwService
.getL2GwConnectionsByL2GatewayId(input.getUuid());
try {
ReadWriteTransaction tx = this.dataBroker.newReadWriteTransaction();
for (L2gatewayConnection connection : connections) {
InstanceIdentifier<L2gatewayConnection> iid = InstanceIdentifier.create(Neutron.class)
.child(L2gatewayConnections.class).child(L2gatewayConnection.class, connection.getKey());
tx.delete(LogicalDatastoreType.CONFIGURATION, iid);
}
tx.submit().checkedGet();
} catch (TransactionCommitFailedException e) {
LOG.error("Failed to delete associated l2gwconnection while deleting l2gw {} with id beacause of {}",
input.getUuid(), e.getLocalizedMessage());
//TODO :retry
}
List<Devices> l2Devices = input.getDevices();
for (Devices l2Device : l2Devices) {
LOG.trace("Removing L2gateway device: {}", l2Device);
removeL2Device(l2Device, input);
}
}
示例2: unregisterEndpoint
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
@Override
public Future<RpcResult<Void>> unregisterEndpoint(UnregisterEndpointInput input) {
final RpcResult<Void> result = RpcResultBuilder.<Void>success().build();
if ( input == null) {
return Futures.immediateFailedCheckedFuture(new IllegalArgumentException("Endpoint can not be empty!"));
}
final List<Uuid> toBeDeletedList = input.getIds();
if ( toBeDeletedList == null || toBeDeletedList.isEmpty()) {
return Futures.immediateFuture(result);
}
ReadWriteTransaction trans = dataBroker.newReadWriteTransaction();
for (Uuid ep : toBeDeletedList) {
InstanceIdentifier<Endpoint> eppath = Constants.DOM_ENDPOINTS_PATH
.child(Endpoint.class, new EndpointKey(ep));
trans.delete(LogicalDatastoreType.OPERATIONAL, eppath);
}
CheckedFuture<Void,TransactionCommitFailedException> future = trans.submit();
return Futures.transformAsync(future, (AsyncFunction<Void, RpcResult<Void>>) input1 -> Futures.immediateFuture(result), executor);
}
示例3: execute
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
@Override
public void execute(ReadWriteTransaction transaction) {
Collection<LogicalRouter> deletedLRRows =
TyperUtils.extractRowsRemoved(LogicalRouter.class, getUpdates(), getDbSchema()).values();
if (deletedLRRows != null) {
for (LogicalRouter lRouter : deletedLRRows) {
HwvtepNodeName routerNode = new HwvtepNodeName(lRouter.getName());
LOG.debug("Clearing device operational data for logical router {}", routerNode);
InstanceIdentifier<LogicalRouters> routerIid = getOvsdbConnectionInstance().getInstanceIdentifier()
.augmentation(HwvtepGlobalAugmentation.class)
.child(LogicalRouters.class, new LogicalRoutersKey(routerNode));
transaction.delete(LogicalDatastoreType.OPERATIONAL, routerIid);
getOvsdbConnectionInstance().getDeviceInfo().clearDeviceOperData(LogicalRouters.class, routerIid);
}
}
}
示例4: removeMcastMacsLocal
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private void removeMcastMacsLocal(ReadWriteTransaction transaction) {
Collection<McastMacsLocal> deletedLMMRows =
TyperUtils.extractRowsRemoved(McastMacsLocal.class, getUpdates(), getDbSchema()).values();
for (McastMacsLocal lmm : deletedLMMRows) {
if(lmm.getMac() != null && lmm.getLogicalSwitchColumn() != null &&
lmm.getLogicalSwitchColumn().getData() != null) {
InstanceIdentifier<LocalMcastMacs> lumId = getOvsdbConnectionInstance().getInstanceIdentifier()
.augmentation(HwvtepGlobalAugmentation.class)
.child(LocalMcastMacs.class,
new LocalMcastMacsKey(getLogicalSwitchRef(lmm.getLogicalSwitchColumn().getData()),
getMacAddress(lmm.getMac())));
transaction.delete(LogicalDatastoreType.OPERATIONAL, lumId);
} else {
LOG.debug("Failed to delete McastMacLocal entry {}", lmm.getUuid());
}
}
}
示例5: execute
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
@Override
public void execute(ReadWriteTransaction transaction) {
Collection<Bridge> removedRows = TyperUtils.extractRowsRemoved(Bridge.class,
getUpdates(), getDbSchema()).values();
for (Bridge bridge : removedRows) {
InstanceIdentifier<Node> bridgeIid =
SouthboundMapper.createInstanceIdentifier(instanceIdentifierCodec, getOvsdbConnectionInstance(),
bridge);
InstanceIdentifier<ManagedNodeEntry> mnIid = getOvsdbConnectionInstance().getInstanceIdentifier()
.augmentation(OvsdbNodeAugmentation.class)
.child(ManagedNodeEntry.class, new ManagedNodeEntryKey(new OvsdbBridgeRef(bridgeIid)));
// TODO handle removal of reference to managed node from model
transaction.delete(LogicalDatastoreType.OPERATIONAL, bridgeIid);
transaction.delete(LogicalDatastoreType.OPERATIONAL, mnIid);
}
}
示例6: removeUcastMacsLocal
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private void removeUcastMacsLocal(ReadWriteTransaction transaction) {
Collection<UcastMacsLocal> deletedLUMRows =
TyperUtils.extractRowsRemoved(UcastMacsLocal.class, getUpdates(), getDbSchema()).values();
for (UcastMacsLocal lum : deletedLUMRows) {
if(lum.getMac() != null && lum.getLogicalSwitchColumn() != null &&
lum.getLogicalSwitchColumn().getData() != null) {
InstanceIdentifier<LocalUcastMacs> lumId = getOvsdbConnectionInstance().getInstanceIdentifier()
.augmentation(HwvtepGlobalAugmentation.class).child(LocalUcastMacs.class,
new LocalUcastMacsKey(getLogicalSwitchRef(lum.getLogicalSwitchColumn().getData()),
getMacAddress(lum.getMac())));
transaction.delete(LogicalDatastoreType.OPERATIONAL, lumId);
} else {
LOG.debug("Failed to delete UcastMacLocal entry {}", lum.getUuid());
}
}
}
示例7: deleteNodeIfPresent
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
public static void deleteNodeIfPresent(ReadWriteTransaction tx,
LogicalDatastoreType logicalDatastoreType,
InstanceIdentifier<?> iid) throws ReadFailedException {
if (tx.read(logicalDatastoreType, iid).checkedGet().isPresent()) {
LOG.info("Deleting child node {}", getNodeIdVal(iid));
tx.delete(logicalDatastoreType, iid);
}
}
示例8: removeIfExists
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
public <T extends DataObject> Optional<T> removeIfExists(InstanceIdentifier<T> path) {
ReadWriteTransaction rwTx = dataBroker.newReadWriteTransaction();
Optional<T> potentialResult = readFromDs(path, rwTx);
if (potentialResult.isPresent()) {
rwTx.delete(logicalDatastoreType, path);
submitToDs(rwTx);
LOG.debug("Removed present path {}", path);
} else {
LOG.debug("No need to remove Path {} -- it is NOT present", path);
}
return potentialResult;
}
示例9: clearStaticRoute
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
@Override
public Future<RpcResult<Void>> clearStaticRoute(ClearStaticRouteInput input) {
FabricId fabricId = input.getFabricId();
NodeId ldev = input.getNodeId();
final FabricInstance fabricObj = FabricInstanceCache.INSTANCE.retrieveFabric(fabricId);
if (fabricObj == null) {
return Futures.immediateFailedFuture(
new IllegalArgumentException(String.format("fabric %s does not exist", fabricId)));
}
final InstanceIdentifier<Routes> routesIId = MdSalUtils.createNodeIId(fabricId, ldev)
.augmentation(LogicalRouterAugment.class)
.child(LrAttribute.class)
.child(Routes.class);
ReadWriteTransaction trans = dataBroker.newReadWriteTransaction();
if (MdSalUtils.syncReadOper(trans, routesIId).isPresent()) {
trans.delete(LogicalDatastoreType.OPERATIONAL,routesIId);
return Futures.transformAsync(trans.submit(), submitResult -> {
fabricObj.notifyRouteCleared(routesIId.firstIdentifierOf(Node.class));
return Futures.immediateFuture(RpcResultBuilder.<Void>success().build());
}, executor);
} else {
return Futures.immediateFuture(RpcResultBuilder.<Void>success().build());
}
}
示例10: execute
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
@Override
public void execute(ReadWriteTransaction transaction) {
Collection<Port> portRemovedRows = TyperUtils.extractRowsRemoved(
Port.class, getUpdates(), getDbSchema()).values();
Map<UUID, Port> portUpdatedRows = TyperUtils.extractRowsUpdated(
Port.class, getUpdates(), getDbSchema());
Map<UUID,Bridge> bridgeUpdatedRows = TyperUtils.extractRowsUpdated(
Bridge.class, getUpdates(), getDbSchema());
Map<UUID,Bridge> bridgeUpdatedOldRows = TyperUtils.extractRowsOld(
Bridge.class, getUpdates(), getDbSchema());
for (Port port : portRemovedRows) {
final String portName = port.getName();
boolean isPortInUpdatedRows = portUpdatedRows.values()
.stream().anyMatch(updatedPort -> portName.equals(updatedPort.getName()));
if (isPortInUpdatedRows) {
LOG.debug("port {} present in updated rows, skipping delete", portName);
continue;
}
Bridge updatedBridgeData = null;
for (UUID bridgeUuid : bridgeUpdatedOldRows.keySet()) {
Bridge oldBridgeData = bridgeUpdatedOldRows.get(bridgeUuid);
if (oldBridgeData.getPortsColumn() != null
&& oldBridgeData.getPortsColumn().getData().contains(port.getUuidColumn().getData())
&& (! bridgeUpdatedRows.isEmpty())) {
updatedBridgeData = bridgeUpdatedRows.get(bridgeUuid);
break;
}
}
if (updatedBridgeData == null) {
LOG.warn("Bridge not found for port {}",port);
continue;
}
final InstanceIdentifier<TerminationPoint> nodePath = SouthboundMapper
.createInstanceIdentifier(instanceIdentifierCodec, getOvsdbConnectionInstance(),
updatedBridgeData).child(
TerminationPoint.class,
new TerminationPointKey(new TpId(portName)));
transaction.delete(LogicalDatastoreType.OPERATIONAL, nodePath);
}
}
示例11: removeOldConfigs
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private void removeOldConfigs(ReadWriteTransaction transaction,
QueuesBuilder queuesBuilder, Map<String, String> oldOtherConfigs,
Queue queue, InstanceIdentifier<Node> nodeIId) {
InstanceIdentifier<Queues> queueIId = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
.child(Queues.class, queuesBuilder.build().getKey());
Set<String> otherConfigKeys = oldOtherConfigs.keySet();
for (String otherConfigKey : otherConfigKeys) {
KeyedInstanceIdentifier<QueuesOtherConfig, QueuesOtherConfigKey> otherIId =
queueIId
.child(QueuesOtherConfig.class, new QueuesOtherConfigKey(otherConfigKey));
transaction.delete(LogicalDatastoreType.OPERATIONAL, otherIId);
}
}
示例12: removeOldExternalIds
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private void removeOldExternalIds(ReadWriteTransaction transaction,
QueuesBuilder queuesBuilder, Map<String, String> oldExternalIds,
Queue queue, InstanceIdentifier<Node> nodeIId) {
InstanceIdentifier<Queues> queueIId = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
.child(Queues.class, queuesBuilder.build().getKey());
Set<String> externalIdsKeys = oldExternalIds.keySet();
for (String extIdKey : externalIdsKeys) {
KeyedInstanceIdentifier<QueuesExternalIds, QueuesExternalIdsKey> externalIId =
queueIId
.child(QueuesExternalIds.class, new QueuesExternalIdsKey(extIdKey));
transaction.delete(LogicalDatastoreType.OPERATIONAL, externalIId);
}
}
示例13: removeOldConfigs
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private void removeOldConfigs(ReadWriteTransaction transaction,
QosEntriesBuilder qosEntryBuilder, Map<String, String> oldOtherConfigs,
Qos qos, InstanceIdentifier<Node> nodeIId) {
InstanceIdentifier<QosEntries> qosIId = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
.child(QosEntries.class, qosEntryBuilder.build().getKey());
Set<String> otherConfigKeys = oldOtherConfigs.keySet();
for (String otherConfigKey : otherConfigKeys) {
KeyedInstanceIdentifier<QosOtherConfig, QosOtherConfigKey> otherIId =
qosIId
.child(QosOtherConfig.class, new QosOtherConfigKey(otherConfigKey));
transaction.delete(LogicalDatastoreType.OPERATIONAL, otherIId);
}
}
示例14: execute
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
@Override
public void execute(ReadWriteTransaction transaction) {
Collection<Manager> deletedManagerRows = TyperUtils.extractRowsRemoved(Manager.class, getUpdates(),getDbSchema()).values();
for (Manager manager : deletedManagerRows) {
InstanceIdentifier<Managers> managerIid = getOvsdbConnectionInstance().getInstanceIdentifier()
.augmentation(HwvtepGlobalAugmentation.class)
.child(Managers.class, new ManagersKey(new Uri(manager.getTargetColumn().getData())));
// TODO Delete any references
transaction.delete(LogicalDatastoreType.OPERATIONAL, managerIid);
}
}
示例15: removeOldQueues
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction; //导入方法依赖的package包/类
private void removeOldQueues(ReadWriteTransaction transaction,
QosEntriesBuilder qosEntryBuilder, Map<Long, UUID> oldQueueList,
Qos qos, InstanceIdentifier<Node> nodeIId) {
InstanceIdentifier<QosEntries> qosIId = nodeIId
.augmentation(OvsdbNodeAugmentation.class)
.child(QosEntries.class, qosEntryBuilder.build().getKey());
Collection<Long> queueListKeys = oldQueueList.keySet();
for (Long queueListKey : queueListKeys) {
KeyedInstanceIdentifier<QueueList, QueueListKey> otherIId =
qosIId
.child(QueueList.class, new QueueListKey(new Long(queueListKey.toString())));
transaction.delete(LogicalDatastoreType.OPERATIONAL, otherIId);
}
}