2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. 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.controller.sal.core.compat;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.collect.ForwardingObject;
13 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadTransaction;
14 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
15 import org.opendaylight.controller.sal.core.spi.data.DOMStoreTransactionChain;
16 import org.opendaylight.controller.sal.core.spi.data.DOMStoreWriteTransaction;
18 public class DOMStoreTransactionChainAdapter extends ForwardingObject implements DOMStoreTransactionChain {
19 private final org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain delegate;
21 public DOMStoreTransactionChainAdapter(
22 final org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain delegate) {
23 this.delegate = requireNonNull(delegate);
27 protected org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain delegate() {
32 public DOMStoreWriteTransaction newWriteOnlyTransaction() {
33 return new DOMStoreWriteTransactionAdapter(delegate.newWriteOnlyTransaction());
37 public DOMStoreReadWriteTransaction newReadWriteTransaction() {
38 return new DOMStoreReadWriteTransactionAdapter(delegate.newReadWriteTransaction());
42 public DOMStoreReadTransaction newReadOnlyTransaction() {
43 return new DOMStoreReadTransactionAdapter<>(delegate.newReadOnlyTransaction());