Prune APIs which have been deprecated well before the Hydrogen release.
No outside users should be relying on them at this point.
Change-Id: I5b966c98733912ece175ce8fa5a4a821c3b2c6d9
Signed-off-by: Robert Varga <rovarga@cisco.com>
import org.opendaylight.yangtools.yang.binding.Notification;
public interface NotificationProviderService extends NotificationService, NotificationPublishService<Notification> {
-
-
- /**
- * Deprecated. Use {@link #publish(Notification)}.
- *
- * @param notification
- */
- @Deprecated
- void notify(Notification notification);
-
- /**
- * Deprecated. Use {@link #publish(Notification,ExecutorService)}.
- *
- * @param notification
- */
- @Deprecated
- void notify(Notification notification, ExecutorService service);
-
/**
* Publishes a notification.
*
import org.opendaylight.yangtools.yang.binding.Notification;
public interface NotificationService extends BindingAwareService {
- /**
- *
- * Deprecated: use {@link #addNotificationListener(Class, NotificationListener)} istead.
- *
- * @param listener
- */
- @Deprecated
- <T extends Notification> void addNotificationListener(Class<T> notificationType, NotificationListener<T> listener);
-
- /**
- *
- * Deprecated: use {@link #addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener)} istead.
- *
- * @param listener
- */
- @Deprecated
- void addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener);
-
- /**
- * Deprecated: use {@link Registration#close()} istead.
- * @param listener
- */
- @Deprecated
- void removeNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener);
-
- /**
- * Deprecated: use {@link Registration#close()} istead.
- * @param listener
- */
- @Deprecated
- <T extends Notification> void removeNotificationListener(Class<T> notificationType, NotificationListener<T> listener);
-
-
/**
* Register a generic listener for specified notification type only.
*
<T extends Notification> Registration<NotificationListener<T>> registerNotificationListener(
Class<T> notificationType, NotificationListener<T> listener);
-
/**
* Register a listener which implements generated notification interfaces derived from
* {@link org.opendaylight.yangtools.yang.binding.NotificationListener}.
/**
* Synchronized wrapper for DataModificationTransaction.
- *
+ *
* To get instance of synchronized wrapper use {@link #from(DataModificationTransaction)}
*
*/
public final class SynchronizedTransaction implements DataModificationTransaction,Delegator<DataModificationTransaction> {
private final DataModificationTransaction delegate;
-
+
private SynchronizedTransaction(DataModificationTransaction delegate) {
this.delegate = delegate;
}
/**
* Returns synchronized wrapper on supplied transaction.
- *
+ *
* @param transaction Transaction for which synchronized wrapper should be created.
* @return Synchronized wrapper over transaction.
*/
return delegate.getUpdatedOperationalData();
}
- @Deprecated
- public synchronized void putRuntimeData(InstanceIdentifier<? extends DataObject> path, DataObject data) {
- delegate.putRuntimeData(path, data);
- }
-
@Override
public synchronized Object getIdentifier() {
return delegate.getIdentifier();
return delegate.getUpdatedConfigurationData();
}
- @Deprecated
- public synchronized void removeRuntimeData(InstanceIdentifier<? extends DataObject> path) {
- delegate.removeRuntimeData(path);
- }
-
@Override
public synchronized void removeOperationalData(InstanceIdentifier<? extends DataObject> path) {
delegate.removeOperationalData(path);
this.executor = executor;\r
}\r
\r
- @Deprecated\r
- override <T extends Notification> addNotificationListener(Class<T> notificationType,\r
- NotificationListener<T> listener) {\r
- listeners.put(notificationType, listener)\r
- }\r
-\r
- @Deprecated\r
- override <T extends Notification> removeNotificationListener(Class<T> notificationType,\r
- NotificationListener<T> listener) {\r
- listeners.remove(notificationType, listener)\r
- }\r
-\r
- override notify(Notification notification) {\r
- publish(notification)\r
- }\r
-\r
def getNotificationTypes(Notification notification) {\r
notification.class.interfaces.filter[it != Notification && Notification.isAssignableFrom(it)]\r
}\r
\r
- @Deprecated\r
- override addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) {\r
- throw new UnsupportedOperationException("Deprecated method. Use registerNotificationListener instead.");\r
-\r
- }\r
-\r
- @Deprecated\r
- override removeNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) {\r
- throw new UnsupportedOperationException(\r
- "Deprecated method. Use RegisterNotificationListener returned value to close registration.")\r
- }\r
-\r
- @Deprecated\r
- override notify(Notification notification, ExecutorService service) {\r
- publish(notification, service)\r
- }\r
-\r
override publish(Notification notification) {\r
publish(notification, executor)\r
}\r
return getRpcRegistryChecked().getRpcService(module);
}
- @Override
- @Deprecated
- public <T extends Notification> void addNotificationListener(Class<T> notificationType,
- NotificationListener<T> listener) {
- getNotificationBrokerChecked().addNotificationListener(notificationType, listener);
- }
-
- @Override
- @Deprecated
- public void addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
- getNotificationBrokerChecked().addNotificationListener(listener);
- }
-
- @Override
- @Deprecated
- public void removeNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
- getNotificationBrokerChecked().removeNotificationListener(listener);
- }
-
- @Override
- @Deprecated
- public <T extends Notification> void removeNotificationListener(Class<T> notificationType,
- NotificationListener<T> listener) {
- getNotificationBrokerChecked().removeNotificationListener(notificationType, listener);
- }
-
@Override
public <T extends Notification> Registration<NotificationListener<T>> registerNotificationListener(
Class<T> notificationType, NotificationListener<T> listener) {
return getRpcRegistryChecked().addRoutedRpcImplementation(type, implementation);
}
- @Override
- @Deprecated
- public void notify(Notification notification) {
- getNotificationBrokerChecked().notify(notification);
- }
-
- @Override
- @Deprecated
- public void notify(Notification notification, ExecutorService service) {
- getNotificationBrokerChecked().notify(notification, service);
- }
-
@Override
public void publish(Notification notification) {
getNotificationBrokerChecked().publish(notification);
import org.opendaylight.yangtools.yang.common.RpcResult;
public interface DataModification<P extends Path<P>, D> extends DataChange<P, D>, DataReader<P, D> {
-
/**
* Returns transaction identifier
*
TransactionStatus getStatus();
- /**
- *
- * @deprecated Use {@link #putOperationalData(Object, Object)} instead.
- *
- * @param path
- * @param data
- */
- @Deprecated
- void putRuntimeData(P path, D data);
-
/**
* Store a piece of data at specified path. This acts as a merge operation,
* which is to say that any pre-existing data which is not explicitly
*/
void putConfigurationData(P path, D data);
- /**
- * @deprecated Use {@link #removeOperationalData(Object)}
- *
- * @param path
- */
- @Deprecated
- void removeRuntimeData(P path);
-
void removeOperationalData(P path);
void removeConfigurationData(P path);
* {@link TransactionStatus#FAILED} is reached.
*/
Future<RpcResult<TransactionStatus>> commit();
-
}
private final Map<P, D> unmodifiable_operationalUpdate;
private final Set<P> unmodifiable_configurationRemove;
private final Set<P> unmodifiable_OperationalRemove;
- private DataReader<P, D> reader;
+ private final DataReader<P, D> reader;
public AbstractDataModification(DataReader<P, D> reader) {
this.reader = reader;
operationalUpdate.put(path, mergeOperationalData(path,original,data));
}
- @Override
- public final void putRuntimeData(P path, D data) {
- putOperationalData(path, data);
- }
-
@Override
public final void removeOperationalData(P path) {
checkMutable();
operationalRemove.put(path, path);
}
- @Override
- public final void removeRuntimeData(P path) {
- removeOperationalData(path);
- }
-
@Override
public final void removeConfigurationData(P path) {
checkMutable();
}
return null;
}
-
+
protected D mergeOperationalData(P path,D stored, D modified) {
return modified;
}
-
+
protected D mergeConfigurationData(P path,D stored, D modified) {
return modified;
}
import org.opendaylight.controller.sal.core.api.Provider;
import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-
/**
* Notification Publishing Service
*
* <li>For each subscriber {@link Broker} invokes
* {@link NotificationListener#onNotification(CompositeNode)}
* </ol>
- *
- *
- *
*/
public interface NotificationPublishService extends NotificationService {
-
/**
* Publishes a notification.
*
* @param notification
* Notification to publish
*/
- @Deprecated
- void sendNotification(CompositeNode notification);
-
void publish(CompositeNode notification);
}
private final DataBrokerImpl dataReader;
private final NotificationRouter notificationRouter;
private final DataReader<InstanceIdentifier,CompositeNode> readWrapper;
-
-
+
+
private final InstanceIdentifier mountPath;
private SchemaContext schemaContext;
return dataReader.readOperationalData(path);
}
+ @Override
public Registration<DataReader<InstanceIdentifier, CompositeNode>> registerOperationalReader(
InstanceIdentifier path, DataReader<InstanceIdentifier, CompositeNode> reader) {
return dataReader.registerOperationalReader(path, reader);
}
+ @Override
public Registration<DataReader<InstanceIdentifier, CompositeNode>> registerConfigurationReader(
InstanceIdentifier path, DataReader<InstanceIdentifier, CompositeNode> reader) {
return dataReader.registerConfigurationReader(path, reader);
return rpcs.addRpcImplementation(rpcType, implementation);
}
+ @Override
public Set<QName> getSupportedRpcs() {
return rpcs.getSupportedRpcs();
}
-
+
+ @Override
public RpcResult<CompositeNode> invokeRpc(QName rpc, CompositeNode input) {
return rpcs.invokeRpc(rpc, input);
}
+ @Override
public ListenerRegistration<RpcRegistrationListener> addRpcRegistrationListener(RpcRegistrationListener listener) {
return rpcs.addRpcRegistrationListener(listener);
}
return dataReader.registerDataChangeListener(path, listener);
}
- @Override
- public void sendNotification(CompositeNode notification) {
- publish(notification);
- }
-
@Override
public Registration<DataCommitHandler<InstanceIdentifier, CompositeNode>> registerCommitHandler(
InstanceIdentifier path, DataCommitHandler<InstanceIdentifier, CompositeNode> commitHandler) {
return dataReader.registerCommitHandler(path, commitHandler);
}
-
+
@Override
public void removeRefresher(DataStoreIdentifier store, DataRefresher refresher) {
// NOOP
}
-
+
@Override
public void addRefresher(DataStoreIdentifier store, DataRefresher refresher) {
// NOOP
}
-
+
@Override
public void addValidator(DataStoreIdentifier store, DataValidator validator) {
// NOOP
public void removeValidator(DataStoreIdentifier store, DataValidator validator) {
// NOOP
}
-
+
+ @Override
public SchemaContext getSchemaContext() {
return schemaContext;
}
+ @Override
public void setSchemaContext(SchemaContext schemaContext) {
this.schemaContext = schemaContext;
}
class ReadWrapper implements DataReader<InstanceIdentifier, CompositeNode> {
-
-
+
+
private InstanceIdentifier shortenPath(InstanceIdentifier path) {
InstanceIdentifier ret = null;
if(mountPath.contains(path)) {
}
return ret;
}
-
+
@Override
public CompositeNode readConfigurationData(InstanceIdentifier path) {
InstanceIdentifier newPath = shortenPath(path);
}
return MountPointImpl.this.readConfigurationData(newPath);
}
-
+
@Override
public CompositeNode readOperationalData(InstanceIdentifier path) {
InstanceIdentifier newPath = shortenPath(path);
NotificationPublishService {
@Override
- public void sendNotification(CompositeNode notification) {
+ public void publish(CompositeNode notification) {
checkSessionState();
if (notification == null)
throw new IllegalArgumentException(
"Notification must not be null.");
NotificationModule.this.sendNotification(notification);
}
-
- @Override
- public void publish(CompositeNode notification) {
- sendNotification(notification);
- }
}
@Override
super(ref, delegate);
}
- public void sendNotification(CompositeNode notification) {
- getDelegate().sendNotification(notification);
- }
-
+ @Override
public Registration<NotificationListener> addNotificationListener(QName notification, NotificationListener listener) {
return addRegistration(getDelegate().addNotificationListener(notification, listener));
}
+ @Override
public void publish(CompositeNode notification) {
getDelegate().publish(notification);
}
this._executor = executor;
}
- @Override
- public <T extends Notification> void addNotificationListener(Class<T> notificationType, NotificationListener<T> listener) {
- this.listeners.put(notificationType, listener);
- }
-
- @Override
- public void addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
- UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException("Deprecated method. Use registerNotificationListener instead.");
- throw _unsupportedOperationException;
- }
-
- @Override
- public void removeNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
- UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException(
- "Deprecated method. Use RegisterNotificationListener returned value to close registration.");
- throw _unsupportedOperationException;
- }
-
- @Override
- public <T extends Notification> void removeNotificationListener(Class<T> notificationType, NotificationListener<T> listener) {
- this.listeners.remove(notificationType, listener);
- }
-
@Override
public <T extends Notification> Registration<NotificationListener<T>> registerNotificationListener(Class<T> notificationType, NotificationListener<T> listener) {
//TODO implementation using sal-remote
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Future;
+
import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
return null;
}
- @Override
- public void putRuntimeData(InstanceIdentifier<? extends DataObject> path, DataObject data) {
-
- }
-
@Override
public void putOperationalData(InstanceIdentifier<? extends DataObject> path, DataObject data) {
}
- @Override
- public void removeRuntimeData(InstanceIdentifier<? extends DataObject> path) {
-
- }
-
@Override
public void removeOperationalData(InstanceIdentifier<? extends DataObject> path) {
package org.opendaylight.controller.sample.toaster.provider;
import java.util.Collections;
-
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.opendaylight.controller.config.yang.config.toaster_provider.impl.ToasterProviderRuntimeMXBean;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.common.util.Futures;
import org.opendaylight.controller.sal.common.util.Rpcs;
import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.DisplayString;
import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.MakeToastInput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.common.util.concurrent.Futures;
+
public class OpendaylightToaster implements ToasterData, ToasterService, ToasterProviderRuntimeMXBean {
private static final Logger log = LoggerFactory.getLogger(OpendaylightToaster.class);
private static final DisplayString toasterManufacturer = new DisplayString("Opendaylight");
private static final DisplayString toasterModelNumber = new DisplayString("Model 1 - Binding Aware");
- private ToasterStatus toasterStatus;
+ private final ToasterStatus toasterStatus;
private NotificationProviderService notificationProvider;
private final ExecutorService executor;
currentTask.cancel(true);
ToastDoneBuilder toastDone = new ToastDoneBuilder();
toastDone.setToastStatus(ToastStatus.Cancelled);
- notificationProvider.notify(toastDone.build());
+ notificationProvider.publish(toastDone.build());
}
public void setNotificationProvider(NotificationProviderService salService) {
ToastDoneBuilder notifyBuilder = new ToastDoneBuilder();
notifyBuilder.setToastStatus(ToastStatus.Done);
- notificationProvider.notify(notifyBuilder.build());
+ notificationProvider.publish(notifyBuilder.build());
log.trace("Toast Done");
logToastInput(toastRequest);
currentTask = null;