2 * Copyright (c) 2014 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.controller.md.sal.binding.impl;
11 import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
12 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
13 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
14 import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
15 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
16 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
17 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
18 import org.opendaylight.controller.sal.core.api.model.SchemaService;
21 * The DataBrokerImpl simply defers to the DOMDataBroker for all its operations.
22 * All transactions and listener registrations are wrapped by the DataBrokerImpl
23 * to allow binding aware components to use the DataBroker transparently.
25 * Besides this the DataBrokerImpl and it's collaborators also cache data that
26 * is already transformed from the binding independent to binding aware format
30 public class ForwardedBindingDataBroker extends AbstractForwardedDataBroker implements DataBroker {
32 public ForwardedBindingDataBroker(final DOMDataBroker domDataBroker, final BindingToNormalizedNodeCodec codec, final SchemaService schemaService) {
33 super(domDataBroker, codec,schemaService);
38 public ReadOnlyTransaction newReadOnlyTransaction() {
39 return new BindingDataReadTransactionImpl(getDelegate().newReadOnlyTransaction(),getCodec());
43 public ReadWriteTransaction newReadWriteTransaction() {
44 return new BindingDataReadWriteTransactionImpl(getDelegate().newReadWriteTransaction(),getCodec());
48 public WriteTransaction newWriteOnlyTransaction() {
49 return new BindingDataWriteTransactionImpl<>(getDelegate().newWriteOnlyTransaction(),getCodec());
53 public BindingTransactionChain createTransactionChain(final TransactionChainListener listener) {
54 return new BindingTranslatedTransactionChain(getDelegate(), getCodec(), listener);