Bug 9034: TracingBroker with TracingReadOnlyTransaction
[controller.git] / opendaylight / md-sal / mdsal-trace / dom-impl / src / main / java / org / opendaylight / controller / md / sal / trace / dom / impl / TracingTransactionChain.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.trace.dom.impl;
9
10 import java.util.Objects;
11 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
12 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
13 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
14 import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
15
16 class TracingTransactionChain implements DOMTransactionChain {
17
18     private final DOMTransactionChain delegate;
19     private final TracingBroker tracingBroker;
20
21     TracingTransactionChain(DOMTransactionChain delegate, TracingBroker tracingBroker) {
22         this.delegate = Objects.requireNonNull(delegate);
23         this.tracingBroker = Objects.requireNonNull(tracingBroker);
24     }
25
26     @Override
27     public DOMDataReadOnlyTransaction newReadOnlyTransaction() {
28         return new TracingReadOnlyTransaction(delegate.newReadOnlyTransaction(), tracingBroker);
29     }
30
31     @Override
32     public DOMDataReadWriteTransaction newReadWriteTransaction() {
33         return new TracingReadWriteTransaction(delegate.newReadWriteTransaction(), tracingBroker);
34     }
35
36     @Override
37     public DOMDataWriteTransaction newWriteOnlyTransaction() {
38         return new TracingWriteTransaction(delegate.newWriteOnlyTransaction(), tracingBroker);
39     }
40
41     @Override
42     public void close() {
43         delegate.close();
44     }
45
46 }

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