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.
9 package org.opendaylight.controller.sal.connect.netconf.sal;
11 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
12 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
13 import org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizer;
14 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
15 import org.opendaylight.controller.md.sal.dom.api.DOMDataChangeListener;
16 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
17 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
18 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
19 import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
20 import org.opendaylight.controller.sal.connect.netconf.listener.NetconfSessionCapabilities;
21 import org.opendaylight.controller.sal.connect.netconf.sal.tx.NetconfDeviceReadOnlyTx;
22 import org.opendaylight.controller.sal.connect.netconf.sal.tx.NetconfDeviceReadWriteTx;
23 import org.opendaylight.controller.sal.connect.netconf.sal.tx.NetconfDeviceWriteOnlyTx;
24 import org.opendaylight.controller.sal.connect.util.RemoteDeviceId;
25 import org.opendaylight.controller.sal.core.api.RpcImplementation;
26 import org.opendaylight.yangtools.concepts.ListenerRegistration;
27 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
28 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
30 final class NetconfDeviceDataBroker implements DOMDataBroker {
31 private final RemoteDeviceId id;
32 private final RpcImplementation rpc;
33 private final NetconfSessionCapabilities netconfSessionPreferences;
34 private final DataNormalizer normalizer;
36 public NetconfDeviceDataBroker(final RemoteDeviceId id, final RpcImplementation rpc, final SchemaContext schemaContext, NetconfSessionCapabilities netconfSessionPreferences) {
39 this.netconfSessionPreferences = netconfSessionPreferences;
40 normalizer = new DataNormalizer(schemaContext);
44 public DOMDataReadOnlyTransaction newReadOnlyTransaction() {
45 return new NetconfDeviceReadOnlyTx(rpc, normalizer, id);
49 public DOMDataReadWriteTransaction newReadWriteTransaction() {
50 return new NetconfDeviceReadWriteTx(newReadOnlyTransaction(), newWriteOnlyTransaction());
54 public DOMDataWriteTransaction newWriteOnlyTransaction() {
55 return new NetconfDeviceWriteOnlyTx(id, rpc, normalizer, netconfSessionPreferences.isCandidateSupported(), netconfSessionPreferences.isRollbackSupported());
59 public ListenerRegistration<DOMDataChangeListener> registerDataChangeListener(final LogicalDatastoreType store, final YangInstanceIdentifier path, final DOMDataChangeListener listener, final DataChangeScope triggeringScope) {
60 throw new UnsupportedOperationException("Data change listeners not supported for netconf mount point");
64 public DOMTransactionChain createTransactionChain(final TransactionChainListener listener) {
66 throw new UnsupportedOperationException("Transaction chains not supported for netconf mount point");