2 * Copyright (c) 2013 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.sal.binding.impl;
11 import java.util.concurrent.Future;
12 import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
13 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
14 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
15 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
16 import org.opendaylight.yangtools.concepts.ListenerRegistration;
17 import org.opendaylight.yangtools.restconf.client.api.RestconfClientContext;
18 import org.opendaylight.yangtools.restconf.client.api.RestconfClientContextFactory;
19 import org.opendaylight.yangtools.restconf.client.api.UnsupportedProtocolException;
20 import org.opendaylight.yangtools.yang.binding.DataObject;
21 import org.opendaylight.yangtools.yang.binding.DataRoot;
22 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
23 import org.opendaylight.yangtools.yang.common.RpcResult;
24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory;
27 public class DataBrokerServiceImpl implements DataBrokerService {
29 private static final Logger logger = LoggerFactory.getLogger(DataBrokerServiceImpl.class.toString());
30 private final RestconfClientContext restconfClientContext;
31 private final RestconfClientContextFactory restconfClientContextFactory = null;
33 public DataBrokerServiceImpl(URL baseUrl) throws UnsupportedProtocolException {
34 this.restconfClientContext = restconfClientContextFactory.getRestconfClientContext(baseUrl);
37 public <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType) {
42 public <T extends DataRoot> T getData(DataStoreIdentifier store, T filter) {
47 public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType) {
52 public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter) {
57 public RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet) {
62 public Future<RpcResult<Void>> commit(DataStoreIdentifier store) {
67 public DataObject getData(InstanceIdentifier<? extends DataObject> data) {
72 public DataObject getConfigurationData(InstanceIdentifier<?> data) {
77 public DataModificationTransaction beginTransaction() {
78 //TODO implementation using sal-remote
83 public void registerChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {
88 public void unregisterChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {
93 public DataObject readConfigurationData(InstanceIdentifier<? extends DataObject> path) {
94 //TODO implementation using restconf-client
100 public DataObject readOperationalData(InstanceIdentifier<? extends DataObject> path) {
101 //TODO implementation using restconf-client
106 public ListenerRegistration<DataChangeListener> registerDataChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener listener) {
107 //TODO implementation using restconf-client