use of org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException in project openflowplugin by opendaylight.
the class OpenflowpluginTestCommandProvider method _removeMDFlow.
public void _removeMDFlow(final CommandInterpreter ci) {
final ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
final NodeBuilder tn = createTestNode(ci.nextArgument());
final String flowtype = ci.nextArgument();
FlowBuilder tf;
if (flowtype.equals("fTM")) {
tf = createtablemiss();
} else {
tf = createTestFlow(tn, flowtype, ci.nextArgument());
}
final InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.getKey()).augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf.getTableId())).child(Flow.class, tf.getKey());
modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
final CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
public void onSuccess(final Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
@Override
public void onFailure(final Throwable throwable) {
LOG.error(throwable.getMessage(), throwable);
ci.println(String.format("Status of Group Data Loaded Transaction : failure. Reason : %s", throwable));
}
}, MoreExecutors.directExecutor());
}
use of org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException in project openflowplugin by opendaylight.
the class GroupForwarder method persistStaleGroup.
private void persistStaleGroup(StaleGroup staleGroup, InstanceIdentifier<FlowCapableNode> nodeIdent) {
WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
writeTransaction.put(LogicalDatastoreType.CONFIGURATION, getStaleGroupInstanceIdentifier(staleGroup, nodeIdent), staleGroup, false);
CheckedFuture<Void, TransactionCommitFailedException> submitFuture = writeTransaction.submit();
handleStaleGroupResultFuture(submitFuture);
}
use of org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException in project openflowplugin by opendaylight.
the class MeterForwarder method persistStaleMeter.
private void persistStaleMeter(StaleMeter staleMeter, InstanceIdentifier<FlowCapableNode> nodeIdent) {
WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
writeTransaction.put(LogicalDatastoreType.CONFIGURATION, getStaleMeterInstanceIdentifier(staleMeter, nodeIdent), staleMeter, false);
CheckedFuture<Void, TransactionCommitFailedException> submitFuture = writeTransaction.submit();
handleStaleMeterResultFuture(submitFuture);
}
use of org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException in project openflowplugin by opendaylight.
the class FlowForwarder method persistStaleFlow.
private void persistStaleFlow(StaleFlow staleFlow, InstanceIdentifier<FlowCapableNode> nodeIdent) {
WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
writeTransaction.put(LogicalDatastoreType.CONFIGURATION, getStaleFlowInstanceIdentifier(staleFlow, nodeIdent), staleFlow, false);
CheckedFuture<Void, TransactionCommitFailedException> submitFuture = writeTransaction.submit();
handleStaleFlowResultFuture(submitFuture);
}
use of org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException in project openflowplugin by opendaylight.
the class FlowNodeReconciliationImpl method deleteDSStaleFlows.
private void deleteDSStaleFlows(List<InstanceIdentifier<StaleFlow>> flowsForBulkDelete) {
WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
for (InstanceIdentifier<StaleFlow> staleFlowIId : flowsForBulkDelete) {
writeTransaction.delete(LogicalDatastoreType.CONFIGURATION, staleFlowIId);
}
CheckedFuture<Void, TransactionCommitFailedException> submitFuture = writeTransaction.submit();
handleStaleEntityDeletionResultFuture(submitFuture);
}
Aggregations