2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.restconf.restful.transaction;
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.netconf.sal.restconf.impl.InstanceIdentifierContext;
16 * This class represent delegation wrapper for transaction variables.
19 public final class TransactionVarsWrapper {
21 private final InstanceIdentifierContext<?> instanceIdentifier;
22 private final DOMMountPoint mountPoint;
23 private LogicalDatastoreType configuration = null;
24 private final DOMTransactionChain transactionChain;
27 * Set base type of variables, which ones we need for transaction.
28 * {@link LogicalDatastoreType} is default set to null (to read all data
29 * from DS - config + state).
31 * @param instanceIdentifier
32 * {@link InstanceIdentifierContext} of data for transaction
34 * mount point if is present
35 * @param transactionChain
36 * transaction chain for creating specific type of transaction
37 * in specific operation
39 public TransactionVarsWrapper(final InstanceIdentifierContext<?> instanceIdentifier, final DOMMountPoint mountPoint,
40 final DOMTransactionChain transactionChain) {
41 this.instanceIdentifier = instanceIdentifier;
42 this.mountPoint = mountPoint;
43 this.transactionChain = transactionChain;
47 * Get instance identifier of data.
49 * @return {@link InstanceIdentifierContext}
51 public InstanceIdentifierContext<?> getInstanceIdentifier() {
52 return this.instanceIdentifier;
58 * @return {@link DOMMountPoint}
60 public DOMMountPoint getMountPoint() {
61 return this.mountPoint;
65 * Set {@link LogicalDatastoreType} of data for transaction.
67 * @param configuration
68 * {@link LogicalDatastoreType}
70 public void setLogicalDatastoreType(final LogicalDatastoreType configuration) {
71 this.configuration = configuration;
78 * @return {@link LogicalDatastoreType}
80 public LogicalDatastoreType getLogicalDatastoreType() {
81 return this.configuration;
85 * Get transaction chain for creating specific transaction for specific
88 * @return transaction chain
90 public DOMTransactionChain getTransactionChain() {
91 return this.transactionChain;