Remove explicit default super-constructor calls
[controller.git] / opendaylight / md-sal / sal-binding-api / src / main / java / org / opendaylight / controller / md / sal / binding / api / ForwardingWriteTransaction.java
1 /*
2  * Copyright (c) 2017 Red Hat, 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.md.sal.binding.api;
9
10 import com.google.common.collect.ForwardingObject;
11 import com.google.common.util.concurrent.CheckedFuture;
12 import com.google.common.util.concurrent.ListenableFuture;
13 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
14 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
15 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
16 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
17 import org.opendaylight.yangtools.yang.binding.DataObject;
18 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
19 import org.opendaylight.yangtools.yang.common.RpcResult;
20
21 /**
22  * Utility {@link WriteTransaction} implementation which forwards all interface method
23  * invocation to a delegate instance.
24  */
25 @SuppressWarnings("deprecation") // due to CheckedFuture & TransactionStatus
26 public class ForwardingWriteTransaction extends ForwardingObject implements WriteTransaction {
27
28     private final WriteTransaction delegate;
29
30     protected ForwardingWriteTransaction(WriteTransaction delegate) {
31         this.delegate = delegate;
32     }
33
34     @Override
35     protected WriteTransaction delegate() {
36         return delegate;
37     }
38
39     @Override
40     public <T extends DataObject> void put(LogicalDatastoreType store, InstanceIdentifier<T> path, T data) {
41         delegate.put(store, path, data);
42     }
43
44     @Override
45     public <T extends DataObject> void put(LogicalDatastoreType store, InstanceIdentifier<T> path, T data,
46             boolean createMissingParents) {
47         delegate.put(store, path, data, createMissingParents);
48     }
49
50     @Override
51     public <T extends DataObject> void merge(LogicalDatastoreType store, InstanceIdentifier<T> path, T data) {
52         delegate.merge(store, path, data);
53     }
54
55     @Override
56     public <T extends DataObject> void merge(LogicalDatastoreType store, InstanceIdentifier<T> path, T data,
57             boolean createMissingParents) {
58         delegate.merge(store, path, data, createMissingParents);
59     }
60
61     @Override
62     public void delete(LogicalDatastoreType store, InstanceIdentifier<?> path) {
63         delegate.delete(store, path);
64     }
65
66     @Override
67     public boolean cancel() {
68         return delegate.cancel();
69     }
70
71     @Override
72     public CheckedFuture<Void, TransactionCommitFailedException> submit() {
73         return delegate.submit();
74     }
75
76     @Override
77     public ListenableFuture<RpcResult<TransactionStatus>> commit() {
78         return delegate.commit();
79     }
80
81     @Override
82     public Object getIdentifier() {
83         return delegate.getIdentifier();
84     }
85
86 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.