Adjust to yangtools-2.0.0/odlparent-3.0.0 changes
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / handlers / TransactionChainHandler.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
9 package org.opendaylight.restconf.nb.rfc8040.handlers;
10
11 import com.google.common.base.Preconditions;
12 import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
13
14
15 /**
16  * Implementation of {@link TransactionChainHandler}.
17  *
18  */
19 public class TransactionChainHandler implements Handler<DOMTransactionChain> {
20
21     private DOMTransactionChain transactionChain;
22
23     /**
24      * Prepare transaction chain service for Restconf services.
25      *
26      * @param transactionChain Transaction chain
27      */
28     public TransactionChainHandler(final DOMTransactionChain transactionChain) {
29         Preconditions.checkNotNull(transactionChain);
30         this.transactionChain = transactionChain;
31     }
32
33     @Override
34     @SuppressWarnings("checkstyle:hiddenField")
35     public void update(final DOMTransactionChain transactionChain) {
36         Preconditions.checkNotNull(transactionChain);
37         this.transactionChain = transactionChain;
38     }
39
40     @Override
41     public DOMTransactionChain get() {
42         return this.transactionChain;
43     }
44 }