NormalizedNodeAggregator should also report empty
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / AbstractThreePhaseCommitCohort.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.cluster.datastore;
9
10 import com.google.common.util.concurrent.Futures;
11 import com.google.common.util.concurrent.ListenableFuture;
12 import java.util.List;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
15 import org.opendaylight.yangtools.yang.common.Empty;
16 import scala.concurrent.Future;
17
18 /**
19  * Abstract base class for {@link DOMStoreThreePhaseCommitCohort} instances returned by this
20  * implementation. In addition to the usual set of methods it also contains the list of actor
21  * futures.
22  */
23 public abstract class AbstractThreePhaseCommitCohort<T> implements DOMStoreThreePhaseCommitCohort {
24     protected static final @NonNull ListenableFuture<Empty> IMMEDIATE_EMPTY_SUCCESS =
25         Futures.immediateFuture(Empty.value());
26     protected static final @NonNull ListenableFuture<Boolean> IMMEDIATE_BOOLEAN_SUCCESS =
27         Futures.immediateFuture(Boolean.TRUE);
28
29     abstract List<Future<T>> getCohortFutures();
30 }