Search in sources :

Example 91 with TransactionCommitFailedException

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());
}
Also used : Table(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) TableKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey) NodeBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder) Flow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow) TransactionCommitFailedException(org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException) FlowBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder) ReadWriteTransaction(org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction)

Example 92 with TransactionCommitFailedException

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);
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) TransactionCommitFailedException(org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)

Example 93 with TransactionCommitFailedException

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);
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) TransactionCommitFailedException(org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)

Example 94 with TransactionCommitFailedException

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);
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) TransactionCommitFailedException(org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)

Example 95 with TransactionCommitFailedException

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);
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) TransactionCommitFailedException(org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException) StaleFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.StaleFlow)

Aggregations

TransactionCommitFailedException (org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException)117 ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)32 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)23 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)21 Test (org.junit.Test)19 ReadWriteTransaction (org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction)16 LogicalDatastoreType (org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType)13 ArrayList (java.util.ArrayList)12 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)12 DOMDataWriteTransaction (org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction)11 TepsInNotHostedTransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.not.hosted.transport.zones.TepsInNotHostedTransportZone)9 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)9 OptimisticLockFailedException (org.opendaylight.controller.md.sal.common.api.data.OptimisticLockFailedException)8 TransportZone (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.TransportZone)8 Nodes (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes)8 Subnetmap (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.neutronvpn.rev150602.subnetmaps.Subnetmap)7 Optional (com.google.common.base.Optional)6 IpPrefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix)6 Vteps (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.transport.zones.transport.zone.subnets.Vteps)6 ExternalNetworks (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.natservice.rev160111.ExternalNetworks)6