2 * Copyright (c) 2015 Brocade Communications 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.datastore;
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.Collections;
12 import java.util.List;
13 import scala.concurrent.Future;
16 * A {@link org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort}
17 * instance given out for empty transactions.
19 final class NoOpDOMStoreThreePhaseCommitCohort extends AbstractThreePhaseCommitCohort<Object> {
20 static final NoOpDOMStoreThreePhaseCommitCohort INSTANCE = new NoOpDOMStoreThreePhaseCommitCohort();
22 private NoOpDOMStoreThreePhaseCommitCohort() {
23 // Hidden to prevent instantiation
27 public ListenableFuture<Boolean> canCommit() {
28 return IMMEDIATE_BOOLEAN_SUCCESS;
32 public ListenableFuture<Void> preCommit() {
33 return IMMEDIATE_VOID_SUCCESS;
37 public ListenableFuture<Void> abort() {
38 return IMMEDIATE_VOID_SUCCESS;
42 public ListenableFuture<Void> commit() {
43 return IMMEDIATE_VOID_SUCCESS;
47 List<Future<Object>> getCohortFutures() {
48 return Collections.emptyList();