Remove use of {String,UUID}Identifier
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / NoOpDOMStoreThreePhaseCommitCohort.java
1 /*
2  * Copyright (c) 2015 Brocade Communications 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.ListenableFuture;
11 import java.util.Collections;
12 import java.util.List;
13 import scala.concurrent.Future;
14
15 /**
16  * A {@link org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort}
17  * instance given out for empty transactions.
18  */
19 final class NoOpDOMStoreThreePhaseCommitCohort extends AbstractThreePhaseCommitCohort<Object> {
20     static final NoOpDOMStoreThreePhaseCommitCohort INSTANCE = new NoOpDOMStoreThreePhaseCommitCohort();
21
22     private NoOpDOMStoreThreePhaseCommitCohort() {
23         // Hidden to prevent instantiation
24     }
25
26     @Override
27     public ListenableFuture<Boolean> canCommit() {
28         return IMMEDIATE_BOOLEAN_SUCCESS;
29     }
30
31     @Override
32     public ListenableFuture<Void> preCommit() {
33         return IMMEDIATE_VOID_SUCCESS;
34     }
35
36     @Override
37     public ListenableFuture<Void> abort() {
38         return IMMEDIATE_VOID_SUCCESS;
39     }
40
41     @Override
42     public ListenableFuture<Void> commit() {
43         return IMMEDIATE_VOID_SUCCESS;
44     }
45
46     @Override
47     List<Future<Object>> getCohortFutures() {
48         return Collections.emptyList();
49     }
50 }