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 static java.util.Objects.requireNonNull;
12 import com.google.common.util.concurrent.ListenableFuture;
13 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
16 * An {@link AbstractTransactionCommitCohort} implementation for transactions which contain a single proxy. Since there
19 * @author Robert Varga
21 final class DirectTransactionCommitCohort extends AbstractTransactionCommitCohort {
22 private final AbstractProxyTransaction proxy;
24 DirectTransactionCommitCohort(final AbstractClientHistory parent, final TransactionIdentifier txId,
25 final AbstractProxyTransaction proxy) {
27 this.proxy = requireNonNull(proxy);
31 public ListenableFuture<Boolean> canCommit() {
32 return proxy.directCommit();
36 public ListenableFuture<Void> preCommit() {
41 public ListenableFuture<Void> abort() {
47 public ListenableFuture<Void> commit() {