Deprecate all MD-SAL APIs
[controller.git] / opendaylight / md-sal / sal-dom-compat / src / main / java / org / opendaylight / controller / sal / core / compat / DOMStoreThreePhaseCommitCohortAdapter.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, s.r.o. 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.sal.core.compat;
9
10 import static java.util.Objects.requireNonNull;
11
12 import com.google.common.collect.ForwardingObject;
13 import com.google.common.util.concurrent.ListenableFuture;
14 import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
15
16 @Deprecated
17 public class DOMStoreThreePhaseCommitCohortAdapter extends ForwardingObject implements DOMStoreThreePhaseCommitCohort {
18     private final org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort delegate;
19
20     public DOMStoreThreePhaseCommitCohortAdapter(
21             final org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort delegate) {
22         this.delegate = requireNonNull(delegate);
23     }
24
25     @Override
26     protected org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort delegate() {
27         return delegate;
28     }
29
30     @Override
31     public ListenableFuture<Void> preCommit() {
32         return delegate.preCommit();
33     }
34
35     @Override
36     public ListenableFuture<Void> commit() {
37         return delegate.commit();
38     }
39
40     @Override
41     public ListenableFuture<Boolean> canCommit() {
42         return delegate.canCommit();
43     }
44
45     @Override
46     public ListenableFuture<Void> abort() {
47         return delegate.abort();
48     }
49 }