*/
package org.opendaylight.controller.sal.binding.api.data;
-import java.util.concurrent.Future;
-
import org.opendaylight.controller.md.sal.common.api.data.DataChangePublisher;
import org.opendaylight.controller.md.sal.common.api.data.DataModificationTransactionFactory;
import org.opendaylight.controller.md.sal.common.api.data.DataReader;
import org.opendaylight.controller.sal.binding.api.BindingAwareService;
-import org.opendaylight.controller.sal.common.DataStoreIdentifier;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.DataRoot;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
/**
* DataBrokerService provides unified access to the data stores available in the
* system.
- *
- *
+ *
+ *
* @see DataProviderService
*/
public interface DataBrokerService extends //
DataModificationTransactionFactory<InstanceIdentifier<? extends DataObject>, DataObject>, //
DataReader<InstanceIdentifier<? extends DataObject>, DataObject>, //
DataChangePublisher<InstanceIdentifier<? extends DataObject>, DataObject, DataChangeListener> {
-
- /**
- * Returns a data from specified Data Store.
- *
- * Returns all the data visible to the consumer from specified Data Store.
- *
- * @param <T>
- * Interface generated from YANG module representing root of data
- * @param store
- * Identifier of the store, from which will be data retrieved
- * @return data visible to the consumer
- */
- @Deprecated
- <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType);
-
- /**
- * Returns a filtered subset of data from specified Data Store.
- *
- * <p>
- * The filter is modeled as an hierarchy of Java TOs starting with
- * implementation of {@link DataRoot} representing data root. The semantics
- * of the filter tree is the same as filter semantics defined in the NETCONF
- * protocol for rpc operations <code>get</code> and <code>get-config</code>
- * in Section 6 of RFC6241.
- *
- *
- * @see http://tools.ietf.org/html/rfc6241#section-6
- * @param <T>
- * Interface generated from YANG module representing root of data
- * @param store
- * Identifier of the store, from which will be data retrieved
- * @param filter
- * Data tree filter similar to the NETCONF filter
- * @return
- */
- @Deprecated
- <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);
-
- /**
- * Returns a candidate data which are not yet commited.
- *
- *
- * @param <T>
- * Interface generated from YANG module representing root of data
- * @param store
- * Identifier of the store, from which will be data retrieved
- * @return
- */
- @Deprecated
- <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType);
-
- /**
- * Returns a filtered subset of candidate data from specified Data Store.
- *
- * <p>
- * The filter is modeled as an hierarchy of {@link Node} starting with
- * {@link CompositeNode} representing data root. The semantics of the filter
- * tree is the same as filter semantics defined in the NETCONF protocol for
- * rpc operations <code>get</code> and <code>get-config</code> in Section 6
- * of RFC6241.
- *
- *
- * @see http://tools.ietf.org/html/rfc6241#section-6
- * @param <T>
- * Interface generated from YANG module representing root of data
- * @param store
- * Identifier of the store, from which will be data retrieved
- * @param filter
- * A filter data root
- * @return
- */
- @Deprecated
- <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter);
-
- /**
- *
- * @param <T>
- * Interface generated from YANG module representing root of data
- * @param store
- * Identifier of the store, in which will be the candidate data
- * modified
- * @param changeSet
- * Modification of data tree.
- * @return Result object containing the modified data tree if the operation
- * was successful, otherwise list of the encountered errors.
- */
- @Deprecated
- RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet);
-
- /**
- * Initiates a two-phase commit of candidate data.
- *
- * <p>
- * The {@link Consumer} could initiate a commit of candidate data
- *
- * <p>
- * The successful commit changes the state of the system and may affect
- * several components.
- *
- * <p>
- * The effects of successful commit of data are described in the
- * specifications and YANG models describing the {@link Provider} components
- * of controller. It is assumed that {@link Consumer} has an understanding
- * of this changes.
- *
- *
- * @see DataCommitHandler for further information how two-phase commit is
- * processed.
- * @param store
- * Identifier of the store, where commit should occur.
- * @return Result of the commit, containing success information or list of
- * encountered errors, if commit was not successful.
- */
- @Deprecated
- Future<RpcResult<Void>> commit(DataStoreIdentifier store);
-
- @Deprecated
- DataObject getData(InstanceIdentifier<? extends DataObject> data);
-
- @Deprecated
- DataObject getConfigurationData(InstanceIdentifier<?> data);
/**
* Creates a data modification transaction.
- *
+ *
* @return new blank data modification transaction.
*/
- DataModificationTransaction beginTransaction();
-
- @Deprecated
- public void registerChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener);
-
- @Deprecated
- public void unregisterChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener);
+ @Override
+ DataModificationTransaction beginTransaction();
/**
- * Reads data subtree from configurational store.
- * (Store which is populated by consumer, which is usually used to
+ * Reads data subtree from configurational store.
+ * (Store which is populated by consumer, which is usually used to
* inject state into providers. E.g. Flow configuration)-
- *
+ *
*/
@Override
public DataObject readConfigurationData(InstanceIdentifier<? extends DataObject> path);
-
+
/**
- * Reads data subtree from operational store.
- * (Store which is populated by providers, which is usually used to
+ * Reads data subtree from operational store.
+ * (Store which is populated by providers, which is usually used to
* capture state of providers. E.g. Topology)
- *
+ *
*/
@Override
public DataObject readOperationalData(InstanceIdentifier<? extends DataObject> path);
-
+
/**
- * Register a data change listener for particular subtree.
- *
+ * Register a data change listener for particular subtree.
+ *
* Callback is invoked each time data in subtree changes.
- *
+ *
*/
@Override
public ListenerRegistration<DataChangeListener> registerDataChangeListener(
\r
import java.util.Map;
import java.util.Map.Entry;
-import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicLong;
import org.opendaylight.controller.md.sal.common.impl.service.AbstractDataBroker;
import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
import org.opendaylight.controller.sal.binding.impl.util.BindingAwareDataReaderRouter;
-import org.opendaylight.controller.sal.common.DataStoreIdentifier;
import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.DataRoot;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.util.DataObjectReadingUtil;
-import org.opendaylight.yangtools.yang.common.RpcResult;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableMap;
}\r
\r
@Override\r
- @Deprecated\r
- public <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType) {\r
- throw new UnsupportedOperationException("Deprecated");\r
- }\r
-\r
- @Override\r
- @Deprecated\r
- public <T extends DataRoot> T getData(DataStoreIdentifier store, T filter) {\r
- throw new UnsupportedOperationException("Deprecated");\r
- }\r
-\r
- @Override\r
- @Deprecated\r
- public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType) {\r
- throw new UnsupportedOperationException("Deprecated");\r
- }\r
-\r
- @Override\r
- @Deprecated\r
- public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter) {\r
- throw new UnsupportedOperationException("Deprecated");\r
- }\r
-\r
- @Override\r
- @Deprecated\r
- public RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet) {\r
- throw new UnsupportedOperationException("Deprecated");\r
- }\r
-\r
- @Override\r
- @Deprecated\r
- public Future<RpcResult<Void>> commit(DataStoreIdentifier store) {\r
- throw new UnsupportedOperationException("Deprecated");\r
- }\r
-\r
- @Override\r
- @Deprecated\r
- public DataObject getData(InstanceIdentifier<? extends DataObject> data) {\r
- throw new UnsupportedOperationException("Deprecated");\r
- }\r
-\r
- @Override\r
- @Deprecated\r
- public DataObject getConfigurationData(InstanceIdentifier<?> data) {\r
- throw new UnsupportedOperationException("Deprecated");\r
- }\r
-\r
- @Override\r
- @Deprecated\r
- public void registerChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {\r
- throw new UnsupportedOperationException("Deprecated");\r
- }\r
-\r
- @Override\r
- @Deprecated\r
- public void unregisterChangeListener(InstanceIdentifier<? extends DataObject> path,\r
- DataChangeListener changeListener) {\r
- throw new UnsupportedOperationException("Deprecated");\r
- }\r
-\r
- @Override\r
- public void close() throws Exception {\r
+ public void close() {\r
\r
}
+++ /dev/null
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.impl
-
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService
-import org.opendaylight.controller.sal.common.DataStoreIdentifier
-import org.opendaylight.yangtools.yang.binding.DataRoot
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.opendaylight.yangtools.yang.binding.DataObject
-import org.opendaylight.controller.sal.binding.api.data.DataChangeListener
-
-abstract class DeprecatedDataAPISupport implements DataProviderService {
-
- @Deprecated
- override commit(DataStoreIdentifier store) {
- throw new UnsupportedOperationException("Deprecated")
- }
-
- @Deprecated
- override editCandidateData(DataStoreIdentifier store, DataRoot changeSet) {
- throw new UnsupportedOperationException("Deprecated")
- }
-
- @Deprecated
- override <T extends DataRoot> getCandidateData(DataStoreIdentifier store, Class<T> rootType) {
- throw new UnsupportedOperationException("Deprecated")
- }
-
- @Deprecated
- override <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter) {
- throw new UnsupportedOperationException("Deprecated")
- }
-
- @Deprecated
- override getConfigurationData(InstanceIdentifier<?> data) {
- throw new UnsupportedOperationException("Deprecated")
- }
-
- @Deprecated
- override <T extends DataRoot> getData(DataStoreIdentifier store, Class<T> rootType) {
- throw new UnsupportedOperationException("Deprecated")
- }
-
- @Deprecated
- override <T extends DataRoot> T getData(DataStoreIdentifier store, T filter) {
- throw new UnsupportedOperationException("Deprecated")
- }
-
- @Deprecated
- override getData(InstanceIdentifier<? extends DataObject> path) {
- return readOperationalData(path);
- }
-
- override registerChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {
- }
-
- override unregisterChangeListener(InstanceIdentifier<? extends DataObject> path,
- DataChangeListener changeListener) {
- }
-
-}
*/
package org.opendaylight.controller.md.sal.binding.util;
-import java.util.concurrent.Future;
-
import org.opendaylight.controller.sal.binding.api.NotificationListener;
import org.opendaylight.controller.sal.binding.api.NotificationService;
import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
-import org.opendaylight.controller.sal.common.DataStoreIdentifier;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.concepts.Registration;
import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.DataRoot;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.Notification;
import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.yangtools.yang.common.RpcResult;
import com.google.common.base.Preconditions;
return getNotificationBrokerChecked().registerNotificationListener(listener);
}
- @Override
- @Deprecated
- public <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType) {
- return getDataBrokerChecked().getData(store, rootType);
- }
-
- @Override
- @Deprecated
- public <T extends DataRoot> T getData(DataStoreIdentifier store, T filter) {
- return getDataBrokerChecked().getData(store, filter);
- }
-
- @Override
- @Deprecated
- public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType) {
- return getDataBrokerChecked().getCandidateData(store, rootType);
- }
-
- @Override
- @Deprecated
- public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter) {
- return getDataBrokerChecked().getCandidateData(store, filter);
- }
-
- @Override
- @Deprecated
- public RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet) {
- return getDataBrokerChecked().editCandidateData(store, changeSet);
- }
-
- @Override
- @Deprecated
- public Future<RpcResult<Void>> commit(DataStoreIdentifier store) {
- return getDataBrokerChecked().commit(store);
- }
-
- @Override
- @Deprecated
- public DataObject getData(InstanceIdentifier<? extends DataObject> data) {
- return getDataBrokerChecked().getData(data);
- }
-
- @Override
- @Deprecated
- public DataObject getConfigurationData(InstanceIdentifier<?> data) {
- return getDataBrokerChecked().getConfigurationData(data);
- }
-
@Override
public DataModificationTransaction beginTransaction() {
return getDataBrokerChecked().beginTransaction();
}
- @Override
- @Deprecated
- public void registerChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {
- getDataBrokerChecked().registerChangeListener(path, changeListener);
- }
-
- @Override
- @Deprecated
- public void unregisterChangeListener(InstanceIdentifier<? extends DataObject> path,
- DataChangeListener changeListener) {
- getDataBrokerChecked().unregisterChangeListener(path, changeListener);
- }
-
@Override
@Deprecated
public DataObject readConfigurationData(InstanceIdentifier<? extends DataObject> path) {
package org.opendaylight.controller.sal.restconf.binding.impl;
import java.net.URL;
-import java.util.concurrent.Future;
+
import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
-import org.opendaylight.controller.sal.common.DataStoreIdentifier;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.restconf.client.api.RestconfClientContext;
import org.opendaylight.yangtools.restconf.client.api.RestconfClientContextFactory;
import org.opendaylight.yangtools.restconf.client.api.UnsupportedProtocolException;
import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.DataRoot;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
import org.opendaylight.yangtools.yang.model.api.SchemaContextHolder;
import org.slf4j.Logger;
public DataBrokerServiceImpl(URL baseUrl, BindingIndependentMappingService mappingService, SchemaContextHolder schemaContextHolder) throws UnsupportedProtocolException {
this.restconfClientContext = restconfClientContextFactory.getRestconfClientContext(baseUrl, mappingService, schemaContextHolder);
}
- @Override
- public <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType) {
- return null;
- }
-
- @Override
- public <T extends DataRoot> T getData(DataStoreIdentifier store, T filter) {
- return null;
- }
-
- @Override
- public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType) {
- return null;
- }
-
- @Override
- public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter) {
- return null;
- }
-
- @Override
- public RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet) {
- return null;
- }
-
- @Override
- public Future<RpcResult<Void>> commit(DataStoreIdentifier store) {
- return null;
- }
-
- @Override
- public DataObject getData(InstanceIdentifier<? extends DataObject> data) {
- return null;
- }
-
- @Override
- public DataObject getConfigurationData(InstanceIdentifier<?> data) {
- return null;
- }
@Override
public DataModificationTransaction beginTransaction() {
return null;
}
- @Override
- public void registerChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {
-
- }
-
- @Override
- public void unregisterChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {
-
- }
-
@Override
public DataObject readConfigurationData(InstanceIdentifier<? extends DataObject> path) {
//TODO implementation using restconf-client
//TODO implementation using restconf-client
return null;
}
-
-
-
-
-
}
import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
-import org.opendaylight.controller.sal.common.DataStoreIdentifier;
import org.opendaylight.controller.sal.restconf.broker.listeners.RemoteDataChangeNotificationListener;
import org.opendaylight.controller.sal.restconf.broker.tools.RemoteStreamTools;
import org.opendaylight.controller.sal.restconf.broker.transactions.RemoteDataModificationTransaction;
import org.opendaylight.yangtools.restconf.client.api.event.EventStreamInfo;
import org.opendaylight.yangtools.restconf.client.api.event.ListenableEventStreamContext;
import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.DataRoot;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
this.restconfClientContext = restconfClientContext;
this.salRemoteService = this.restconfClientContext.getRpcServiceContext(SalRemoteService.class).getRpcService();
}
- @Override
- public <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType) {
- throw new UnsupportedOperationException("Deprecated");
- }
-
- @Override
- public <T extends DataRoot> T getData(DataStoreIdentifier store, T filter) {
- throw new UnsupportedOperationException("Deprecated");
- }
-
- @Override
- public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType) {
- throw new UnsupportedOperationException("Deprecated");
- }
-
- @Override
- public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter) {
- throw new UnsupportedOperationException("Deprecated");
- }
-
- @Override
- public RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet) {
- throw new UnsupportedOperationException("Deprecated");
- }
-
- @Override
- public Future<RpcResult<Void>> commit(DataStoreIdentifier store) {
- throw new UnsupportedOperationException("Deprecated");
- }
-
- @Override
- public DataObject getData(InstanceIdentifier<? extends DataObject> data) {
- throw new UnsupportedOperationException("Deprecated");
- }
-
- @Override
- public DataObject getConfigurationData(InstanceIdentifier<?> data) {
- throw new UnsupportedOperationException("Deprecated");
- }
@Override
public DataModificationTransaction beginTransaction() {
return remoteDataModificationTransaction;
}
- @Override
- public void registerChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {
- throw new UnsupportedOperationException("Deprecated");
- }
-
- @Override
- public void unregisterChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {
- throw new UnsupportedOperationException("Deprecated");
- }
-
@Override
public DataObject readConfigurationData(InstanceIdentifier<? extends DataObject> path) {
try {