af2208f3a04925487a1877a4ae35b55bbd33a232
[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.FluentFuture;
12 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
13 import org.opendaylight.mdsal.common.api.CommitInfo;
14 import org.opendaylight.yangtools.yang.binding.DataObject;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
16
17 /**
18  * Utility {@link WriteTransaction} implementation which forwards all interface method
19  * invocation to a delegate instance.
20  *
21  * @deprecated Use org.opendaylight.mdsal.binding.spi.ForwardingWriteTransaction instead.
22  */
23 @Deprecated
24 public class ForwardingWriteTransaction extends ForwardingObject implements WriteTransaction {
25
26     private final WriteTransaction delegate;
27
28     protected ForwardingWriteTransaction(WriteTransaction delegate) {
29         this.delegate = delegate;
30     }
31
32     @Override
33     protected WriteTransaction delegate() {
34         return delegate;
35     }
36
37     @Override
38     public <T extends DataObject> void put(LogicalDatastoreType store, InstanceIdentifier<T> path, T data) {
39         delegate.put(store, path, data);
40     }
41
42     @Override
43     public <T extends DataObject> void put(LogicalDatastoreType store, InstanceIdentifier<T> path, T data,
44             boolean createMissingParents) {
45         delegate.put(store, path, data, createMissingParents);
46     }
47
48     @Override
49     public <T extends DataObject> void merge(LogicalDatastoreType store, InstanceIdentifier<T> path, T data) {
50         delegate.merge(store, path, data);
51     }
52
53     @Override
54     public <T extends DataObject> void merge(LogicalDatastoreType store, InstanceIdentifier<T> path, T data,
55             boolean createMissingParents) {
56         delegate.merge(store, path, data, createMissingParents);
57     }
58
59     @Override
60     public void delete(LogicalDatastoreType store, InstanceIdentifier<?> path) {
61         delegate.delete(store, path);
62     }
63
64     @Override
65     public boolean cancel() {
66         return delegate.cancel();
67     }
68
69     @Override
70     public FluentFuture<? extends CommitInfo> commit() {
71         return delegate.commit();
72     }
73
74     @Override
75     public Object getIdentifier() {
76         return delegate.getIdentifier();
77     }
78 }

©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.