2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.databroker.actors.dds;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
14 * An {@link AbstractTransactionCommitCohort} for use with empty transactions. This relies on the fact that no backends
15 * have been touched, hence all state book-keeping needs to happen only locally and shares fate with the coordinator.
17 * Therefore all methods can finish immediately without any effects.
19 * @author Robert Varga
21 final class EmptyTransactionCommitCohort extends AbstractTransactionCommitCohort {
22 static final DOMStoreThreePhaseCommitCohort INSTANCE = new EmptyTransactionCommitCohort();
24 private EmptyTransactionCommitCohort() {
29 public ListenableFuture<Boolean> canCommit() {
34 public ListenableFuture<Void> preCommit() {
39 public ListenableFuture<Void> abort() {
44 public ListenableFuture<Void> commit() {