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;
19 import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
22 * The DataBrokerImpl simply defers to the DOMDataBroker for all its operations.
23 * All transactions and listener registrations are wrapped by the DataBrokerImpl
24 * to allow binding aware components to use the DataBroker transparently.
26 * Besides this the DataBrokerImpl and it's collaborators also cache data that
27 * is already transformed from the binding independent to binding aware format
31 public class ForwardedBindingDataBroker extends AbstractForwardedDataBroker implements DataBroker {
33 public ForwardedBindingDataBroker(final DOMDataBroker domDataBroker, final BindingIndependentMappingService mappingService, final SchemaService schemaService) {
34 super(domDataBroker, mappingService,schemaService);
39 public ReadOnlyTransaction newReadOnlyTransaction() {
40 return new BindingDataReadTransactionImpl(getDelegate().newReadOnlyTransaction(),getCodec());
44 public ReadWriteTransaction newReadWriteTransaction() {
45 return new BindingDataReadWriteTransactionImpl(getDelegate().newReadWriteTransaction(),getCodec());
49 public WriteTransaction newWriteOnlyTransaction() {
50 return new BindingDataWriteTransactionImpl<>(getDelegate().newWriteOnlyTransaction(),getCodec());
54 public BindingTransactionChain createTransactionChain(final TransactionChainListener listener) {
55 return new BindingTranslatedTransactionChain(getDelegate(), getCodec(), listener);