Search in sources :

Example 6 with TransactionCommitSuccess

use of org.opendaylight.controller.cluster.access.commands.TransactionCommitSuccess in project controller by opendaylight.

the class AbstractProxyTransaction method doCommit.

final void doCommit(final VotingFuture<?> ret) {
    checkReadWrite();
    checkSealed();
    sendRequest(new TransactionDoCommitRequest(getIdentifier(), nextSequence(), localActor()), t -> {
        if (t instanceof TransactionCommitSuccess) {
            ret.voteYes();
        } else if (t instanceof RequestFailure) {
            ret.voteNo(((RequestFailure<?, ?>) t).getCause().unwrap());
        } else {
            ret.voteNo(unhandledResponseException(t));
        }
        LOG.debug("Transaction {} doCommit completed", this);
        // Needed for ProxyHistory$Local data tree rebase points.
        parent.completeTransaction(this);
        enqueuePurge();
    });
}
Also used : TransactionDoCommitRequest(org.opendaylight.controller.cluster.access.commands.TransactionDoCommitRequest) TransactionCommitSuccess(org.opendaylight.controller.cluster.access.commands.TransactionCommitSuccess) RequestFailure(org.opendaylight.controller.cluster.access.concepts.RequestFailure)

Aggregations

TransactionCommitSuccess (org.opendaylight.controller.cluster.access.commands.TransactionCommitSuccess)6 Test (org.junit.Test)4 CommitLocalTransactionRequest (org.opendaylight.controller.cluster.access.commands.CommitLocalTransactionRequest)2 ModifyTransactionRequest (org.opendaylight.controller.cluster.access.commands.ModifyTransactionRequest)2 TransactionDoCommitRequest (org.opendaylight.controller.cluster.access.commands.TransactionDoCommitRequest)1 RequestFailure (org.opendaylight.controller.cluster.access.concepts.RequestFailure)1 DOMStoreThreePhaseCommitCohort (org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort)1