Deprecate all MD-SAL APIs
[controller.git] / opendaylight / md-sal / sal-dom-spi / src / main / java / org / opendaylight / controller / md / sal / dom / spi / ForwardingDOMDataReadOnlyTransaction.java
1 /*
2  * Copyright (c) 2014 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.md.sal.dom.spi;
9
10 import com.google.common.base.Optional;
11 import com.google.common.collect.ForwardingObject;
12 import com.google.common.util.concurrent.CheckedFuture;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
15 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
16 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
17 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
18 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
19
20 /**
21  * Utility {@link DOMDataReadOnlyTransaction} implementation which forwards all interface
22  * method invocation to a delegate instance.
23  *
24  * @deprecated Use {@link org.opendaylight.mdsal.dom.spi.ForwardingDOMDataReadOnlyTransaction} instead.
25  */
26 @Deprecated
27 public abstract class ForwardingDOMDataReadOnlyTransaction extends ForwardingObject
28         implements DOMDataReadOnlyTransaction {
29     @Override
30     protected abstract @NonNull DOMDataReadOnlyTransaction delegate();
31
32     @Override
33     public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
34             final YangInstanceIdentifier path) {
35         return delegate().read(store, path);
36     }
37
38     @Override
39     public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
40             final YangInstanceIdentifier path) {
41         return delegate().exists(store, path);
42     }
43
44     @Override
45     public Object getIdentifier() {
46         return delegate().getIdentifier();
47     }
48
49     @Override
50     public void close() {
51         delegate().close();
52     }
53 }

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