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;
10 import com.google.common.base.Preconditions;
11 import com.google.common.collect.ForwardingObject;
12 import com.google.common.util.concurrent.ListenableFuture;
13 import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
16 * Utility class from bridging {@link DOMStoreThreePhaseCommitCohort} and
17 * {@link org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort}.
19 * @author Robert Varga
21 final class DOMStoreThreePhaseCommitCohortAdaptor extends ForwardingObject implements DOMStoreThreePhaseCommitCohort {
22 private final org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort delegate;
24 DOMStoreThreePhaseCommitCohortAdaptor(
25 final org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort delegate) {
26 this.delegate = Preconditions.checkNotNull(delegate);
30 public ListenableFuture<Boolean> canCommit() {
31 return delegate.canCommit();
35 public ListenableFuture<Void> preCommit() {
36 return delegate.preCommit();
40 public ListenableFuture<Void> abort() {
41 return delegate.abort();
45 public ListenableFuture<Void> commit() {
46 return delegate.commit();
50 protected Object delegate() {