From: Robert Varga Date: Wed, 19 Feb 2014 10:44:06 +0000 (+0100) Subject: Prune long-deprecated APIs X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~381^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=7d61ffcb9f6f82d4fc8e1f0a6fcf93288ea24c1d Prune long-deprecated APIs These APIs are from prototype days and have never properly worked. Prune them to reduce the baggage we carry around. Change-Id: I9ac89552edf76f0740c660c100ec0426627b413a Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataBrokerService.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataBrokerService.java index aa846ff78d..65f1ff2fe3 100644 --- a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataBrokerService.java +++ b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataBrokerService.java @@ -7,24 +7,19 @@ */ 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 // @@ -32,163 +27,37 @@ public interface DataBrokerService extends // DataModificationTransactionFactory, DataObject>, // DataReader, DataObject>, // DataChangePublisher, DataObject, DataChangeListener> { - - /** - * Returns a data from specified Data Store. - * - * Returns all the data visible to the consumer from specified Data Store. - * - * @param - * 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 getData(DataStoreIdentifier store, Class rootType); - - /** - * Returns a filtered subset of data from specified Data Store. - * - *

- * 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 get and get-config - * in Section 6 of RFC6241. - * - * - * @see http://tools.ietf.org/html/rfc6241#section-6 - * @param - * 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 getData(DataStoreIdentifier store, T filter); - - /** - * Returns a candidate data which are not yet commited. - * - * - * @param - * Interface generated from YANG module representing root of data - * @param store - * Identifier of the store, from which will be data retrieved - * @return - */ - @Deprecated - T getCandidateData(DataStoreIdentifier store, Class rootType); - - /** - * Returns a filtered subset of candidate data from specified Data Store. - * - *

- * 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 get and get-config in Section 6 - * of RFC6241. - * - * - * @see http://tools.ietf.org/html/rfc6241#section-6 - * @param - * 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 getCandidateData(DataStoreIdentifier store, T filter); - - /** - * - * @param - * 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 editCandidateData(DataStoreIdentifier store, DataRoot changeSet); - - /** - * Initiates a two-phase commit of candidate data. - * - *

- * The {@link Consumer} could initiate a commit of candidate data - * - *

- * The successful commit changes the state of the system and may affect - * several components. - * - *

- * 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> commit(DataStoreIdentifier store); - - @Deprecated - DataObject getData(InstanceIdentifier data); - - @Deprecated - DataObject getConfigurationData(InstanceIdentifier data); /** * Creates a data modification transaction. - * + * * @return new blank data modification transaction. */ - DataModificationTransaction beginTransaction(); - - @Deprecated - public void registerChangeListener(InstanceIdentifier path, DataChangeListener changeListener); - - @Deprecated - public void unregisterChangeListener(InstanceIdentifier 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 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 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 registerDataChangeListener( diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataBrokerImpl.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataBrokerImpl.java index 16d5a24cb5..48ccbfbc95 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataBrokerImpl.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataBrokerImpl.java @@ -9,19 +9,15 @@ package org.opendaylight.controller.sal.binding.impl; 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; @@ -79,68 +75,7 @@ public class DataBrokerImpl extends AbstractDataBroker T getData(DataStoreIdentifier store, Class rootType) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - @Deprecated - public T getData(DataStoreIdentifier store, T filter) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - @Deprecated - public T getCandidateData(DataStoreIdentifier store, Class rootType) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - @Deprecated - public T getCandidateData(DataStoreIdentifier store, T filter) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - @Deprecated - public RpcResult editCandidateData(DataStoreIdentifier store, DataRoot changeSet) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - @Deprecated - public Future> commit(DataStoreIdentifier store) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - @Deprecated - public DataObject getData(InstanceIdentifier data) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - @Deprecated - public DataObject getConfigurationData(InstanceIdentifier data) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - @Deprecated - public void registerChangeListener(InstanceIdentifier path, DataChangeListener changeListener) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - @Deprecated - public void unregisterChangeListener(InstanceIdentifier path, - DataChangeListener changeListener) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - public void close() throws Exception { + public void close() { } diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DeprecatedDataAPISupport.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DeprecatedDataAPISupport.xtend deleted file mode 100644 index ee2ade5863..0000000000 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DeprecatedDataAPISupport.xtend +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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 getCandidateData(DataStoreIdentifier store, Class rootType) { - throw new UnsupportedOperationException("Deprecated") - } - - @Deprecated - override T getCandidateData(DataStoreIdentifier store, T filter) { - throw new UnsupportedOperationException("Deprecated") - } - - @Deprecated - override getConfigurationData(InstanceIdentifier data) { - throw new UnsupportedOperationException("Deprecated") - } - - @Deprecated - override getData(DataStoreIdentifier store, Class rootType) { - throw new UnsupportedOperationException("Deprecated") - } - - @Deprecated - override T getData(DataStoreIdentifier store, T filter) { - throw new UnsupportedOperationException("Deprecated") - } - - @Deprecated - override getData(InstanceIdentifier path) { - return readOperationalData(path); - } - - override registerChangeListener(InstanceIdentifier path, DataChangeListener changeListener) { - } - - override unregisterChangeListener(InstanceIdentifier path, - DataChangeListener changeListener) { - } - -} diff --git a/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/AbstractBindingSalConsumerInstance.java b/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/AbstractBindingSalConsumerInstance.java index 77b411002b..64c1ad3ab4 100644 --- a/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/AbstractBindingSalConsumerInstance.java +++ b/opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/AbstractBindingSalConsumerInstance.java @@ -7,23 +7,18 @@ */ 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; @@ -114,72 +109,11 @@ public abstract class AbstractBindingSalConsumerInstance T getData(DataStoreIdentifier store, Class rootType) { - return getDataBrokerChecked().getData(store, rootType); - } - - @Override - @Deprecated - public T getData(DataStoreIdentifier store, T filter) { - return getDataBrokerChecked().getData(store, filter); - } - - @Override - @Deprecated - public T getCandidateData(DataStoreIdentifier store, Class rootType) { - return getDataBrokerChecked().getCandidateData(store, rootType); - } - - @Override - @Deprecated - public T getCandidateData(DataStoreIdentifier store, T filter) { - return getDataBrokerChecked().getCandidateData(store, filter); - } - - @Override - @Deprecated - public RpcResult editCandidateData(DataStoreIdentifier store, DataRoot changeSet) { - return getDataBrokerChecked().editCandidateData(store, changeSet); - } - - @Override - @Deprecated - public Future> commit(DataStoreIdentifier store) { - return getDataBrokerChecked().commit(store); - } - - @Override - @Deprecated - public DataObject getData(InstanceIdentifier 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 path, DataChangeListener changeListener) { - getDataBrokerChecked().registerChangeListener(path, changeListener); - } - - @Override - @Deprecated - public void unregisterChangeListener(InstanceIdentifier path, - DataChangeListener changeListener) { - getDataBrokerChecked().unregisterChangeListener(path, changeListener); - } - @Override @Deprecated public DataObject readConfigurationData(InstanceIdentifier path) { diff --git a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/binding/impl/DataBrokerServiceImpl.java b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/binding/impl/DataBrokerServiceImpl.java index 6fe56c87ed..416f1941c1 100644 --- a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/binding/impl/DataBrokerServiceImpl.java +++ b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/binding/impl/DataBrokerServiceImpl.java @@ -8,19 +8,16 @@ 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; @@ -35,45 +32,6 @@ public class DataBrokerServiceImpl implements DataBrokerService { public DataBrokerServiceImpl(URL baseUrl, BindingIndependentMappingService mappingService, SchemaContextHolder schemaContextHolder) throws UnsupportedProtocolException { this.restconfClientContext = restconfClientContextFactory.getRestconfClientContext(baseUrl, mappingService, schemaContextHolder); } - @Override - public T getData(DataStoreIdentifier store, Class rootType) { - return null; - } - - @Override - public T getData(DataStoreIdentifier store, T filter) { - return null; - } - - @Override - public T getCandidateData(DataStoreIdentifier store, Class rootType) { - return null; - } - - @Override - public T getCandidateData(DataStoreIdentifier store, T filter) { - return null; - } - - @Override - public RpcResult editCandidateData(DataStoreIdentifier store, DataRoot changeSet) { - return null; - } - - @Override - public Future> commit(DataStoreIdentifier store) { - return null; - } - - @Override - public DataObject getData(InstanceIdentifier data) { - return null; - } - - @Override - public DataObject getConfigurationData(InstanceIdentifier data) { - return null; - } @Override public DataModificationTransaction beginTransaction() { @@ -81,16 +39,6 @@ public class DataBrokerServiceImpl implements DataBrokerService { return null; } - @Override - public void registerChangeListener(InstanceIdentifier path, DataChangeListener changeListener) { - - } - - @Override - public void unregisterChangeListener(InstanceIdentifier path, DataChangeListener changeListener) { - - } - @Override public DataObject readConfigurationData(InstanceIdentifier path) { //TODO implementation using restconf-client @@ -109,9 +57,4 @@ public class DataBrokerServiceImpl implements DataBrokerService { //TODO implementation using restconf-client return null; } - - - - - } diff --git a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/impl/DataBrokerServiceImpl.java b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/impl/DataBrokerServiceImpl.java index e31d576d01..003ad9853a 100644 --- a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/impl/DataBrokerServiceImpl.java +++ b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/impl/DataBrokerServiceImpl.java @@ -14,7 +14,6 @@ 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.controller.sal.restconf.broker.listeners.RemoteDataChangeNotificationListener; import org.opendaylight.controller.sal.restconf.broker.tools.RemoteStreamTools; import org.opendaylight.controller.sal.restconf.broker.transactions.RemoteDataModificationTransaction; @@ -28,7 +27,6 @@ import org.opendaylight.yangtools.restconf.client.api.RestconfClientContext; 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; @@ -46,45 +44,6 @@ public class DataBrokerServiceImpl implements DataBrokerService { this.restconfClientContext = restconfClientContext; this.salRemoteService = this.restconfClientContext.getRpcServiceContext(SalRemoteService.class).getRpcService(); } - @Override - public T getData(DataStoreIdentifier store, Class rootType) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - public T getData(DataStoreIdentifier store, T filter) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - public T getCandidateData(DataStoreIdentifier store, Class rootType) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - public T getCandidateData(DataStoreIdentifier store, T filter) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - public RpcResult editCandidateData(DataStoreIdentifier store, DataRoot changeSet) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - public Future> commit(DataStoreIdentifier store) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - public DataObject getData(InstanceIdentifier data) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - public DataObject getConfigurationData(InstanceIdentifier data) { - throw new UnsupportedOperationException("Deprecated"); - } @Override public DataModificationTransaction beginTransaction() { @@ -94,16 +53,6 @@ public class DataBrokerServiceImpl implements DataBrokerService { return remoteDataModificationTransaction; } - @Override - public void registerChangeListener(InstanceIdentifier path, DataChangeListener changeListener) { - throw new UnsupportedOperationException("Deprecated"); - } - - @Override - public void unregisterChangeListener(InstanceIdentifier path, DataChangeListener changeListener) { - throw new UnsupportedOperationException("Deprecated"); - } - @Override public DataObject readConfigurationData(InstanceIdentifier path) { try {