ad9e609b0b3729bba9da6e94a6ad9bc7630adb54
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / restconf / restful / transaction / TransactionVarsWrapper.java
1 /*
2  * Copyright (c) 2016 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.restconf.restful.transaction;
9
10 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
11 import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
12 import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
13 import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
14
15 /**
16  * This class represent delegation wrapper for transaction variables.
17  *
18  * @deprecated move to splitted module restconf-nb-rfc8040
19  */
20 @Deprecated
21 public final class TransactionVarsWrapper {
22
23     private final InstanceIdentifierContext<?> instanceIdentifier;
24     private final DOMMountPoint mountPoint;
25     private LogicalDatastoreType configuration = null;
26     private final DOMTransactionChain transactionChain;
27
28     /**
29      * Set base type of variables, which ones we need for transaction.
30      * {@link LogicalDatastoreType} is default set to null (to read all data
31      * from DS - config + state).
32      *
33      * @param instanceIdentifier
34      *             {@link InstanceIdentifierContext} of data for transaction
35      * @param mountPoint
36      *             mount point if is present
37      * @param transactionChain
38      *             transaction chain for creating specific type of transaction
39      *            in specific operation
40      */
41     public TransactionVarsWrapper(final InstanceIdentifierContext<?> instanceIdentifier, final DOMMountPoint mountPoint,
42             final DOMTransactionChain transactionChain) {
43         this.instanceIdentifier = instanceIdentifier;
44         this.mountPoint = mountPoint;
45         this.transactionChain = transactionChain;
46     }
47
48     /**
49      * Get instance identifier of data.
50      *
51      * @return {@link InstanceIdentifierContext}
52      */
53     public InstanceIdentifierContext<?> getInstanceIdentifier() {
54         return this.instanceIdentifier;
55     }
56
57     /**
58      * Get mount point.
59      *
60      * @return {@link DOMMountPoint}
61      */
62     public DOMMountPoint getMountPoint() {
63         return this.mountPoint;
64     }
65
66     /**
67      * Set {@link LogicalDatastoreType} of data for transaction.
68      *
69      * @param configuration
70      *             {@link LogicalDatastoreType}
71      */
72     public void setLogicalDatastoreType(final LogicalDatastoreType configuration) {
73         this.configuration = configuration;
74
75     }
76
77     /**
78      * Get type of data.
79      *
80      * @return {@link LogicalDatastoreType}
81      */
82     public LogicalDatastoreType getLogicalDatastoreType() {
83         return this.configuration;
84     }
85
86     /**
87      * Get transaction chain for creating specific transaction for specific
88      * operation.
89      *
90      * @return transaction chain
91      */
92     public DOMTransactionChain getTransactionChain() {
93         return this.transactionChain;
94     }
95 }