summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
0200653)
We should have final classes and similar things.
Change-Id: Ie60973456464367db6396906fd079b76f5cfc3dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
import org.opendaylight.yangtools.yang.binding.Notification;
@VisibleForTesting
import org.opendaylight.yangtools.yang.binding.Notification;
@VisibleForTesting
+// FIXME: 10.0.0: make this class final
public class BindingDOMNotificationPublishServiceAdapter extends AbstractBindingAdapter<DOMNotificationPublishService>
implements NotificationPublishService {
public class BindingDOMNotificationPublishServiceAdapter extends AbstractBindingAdapter<DOMNotificationPublishService>
implements NotificationPublishService {
super(adapterContext, domPublishService);
}
super(adapterContext, domPublishService);
}
+ @Deprecated(forRemoval = true, since = "9.0.2")
public DOMNotificationPublishService getDomPublishService() {
return getDelegate();
}
public DOMNotificationPublishService getDomPublishService() {
return getDelegate();
}
@Override
public ListenableFuture<? extends Object> offerNotification(final Notification<?> notification) {
@Override
public ListenableFuture<? extends Object> offerNotification(final Notification<?> notification) {
- ListenableFuture<?> offerResult = getDelegate().offerNotification(toDomNotification(notification));
- return DOMNotificationPublishService.REJECTED.equals(offerResult)
- ? NotificationPublishService.REJECTED
- : offerResult;
+ return toBindingResult(getDelegate().offerNotification(toDomNotification(notification)));
}
@Override
public ListenableFuture<? extends Object> offerNotification(final Notification<?> notification, final int timeout,
final TimeUnit unit) throws InterruptedException {
}
@Override
public ListenableFuture<? extends Object> offerNotification(final Notification<?> notification, final int timeout,
final TimeUnit unit) throws InterruptedException {
- ListenableFuture<?> offerResult = getDelegate().offerNotification(toDomNotification(notification), timeout,
- unit);
- return DOMNotificationPublishService.REJECTED.equals(offerResult)
- ? NotificationPublishService.REJECTED
- : offerResult;
+ return toBindingResult(getDelegate().offerNotification(toDomNotification(notification), timeout, unit));
}
private @NonNull DOMNotification toDomNotification(final Notification<?> notification) {
}
private @NonNull DOMNotification toDomNotification(final Notification<?> notification) {
return LazySerializedDOMNotification.create(currentSerializer(), notification, instant);
}
return LazySerializedDOMNotification.create(currentSerializer(), notification, instant);
}
+ private static @NonNull ListenableFuture<? extends Object> toBindingResult(
+ final @NonNull ListenableFuture<? extends Object> domResult) {
+ return DOMNotificationPublishService.REJECTED.equals(domResult) ? NotificationPublishService.REJECTED
+ : domResult;
+ }
+
+ // FIXME: 10.0.0: hide this class and make it final
protected static class Builder extends BindingDOMAdapterBuilder<NotificationPublishService> {
Builder(final AdapterContext adapterContext) {
super(adapterContext);
protected static class Builder extends BindingDOMAdapterBuilder<NotificationPublishService> {
Builder(final AdapterContext adapterContext) {
super(adapterContext);
import org.opendaylight.yangtools.yang.binding.NotificationListener;
@VisibleForTesting
import org.opendaylight.yangtools.yang.binding.NotificationListener;
@VisibleForTesting
+// FIXME: 10.0.0: make this class final
public class BindingDOMNotificationServiceAdapter implements NotificationService {
public static final Factory<NotificationService> BUILDER_FACTORY = Builder::new;
public class BindingDOMNotificationServiceAdapter implements NotificationService {
public static final Factory<NotificationService> BUILDER_FACTORY = Builder::new;