Add support for EventInstantAware notifications 80/81580/11
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 11 Apr 2019 21:11:17 +0000 (23:11 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 30 Apr 2019 03:30:30 +0000 (03:30 +0000)
commit3aa65296b24cb2fe7042a99e581702278451bc35
tree5a130472bd940688ef445a41d7cc9d7415181c3c
parentf6f3556fd543e3af5a239f5e8666c6305a6b8f5a
Add support for EventInstantAware notifications

This patch adds support for transmitting DOMEvent contents to
Binding Notifications through the EventInstantAware interface.

The design is such that binding-dom-adapter recognizes DOMEvent
and extracts the instant from it and uses the appropriate codec
call to instantiate a proxy Notification.

On codec side of things, the NotificationCodecContext maintains
a distinct Proxy, which also implements EventInstantAware and
when asked to create a proxy with an instant uses that instead
of the usual LazyDataObject to handle it. In order to make things
seamless and to not impact other LazyDataObject users, this
alternative proxy is serviced by an intermediate InvocationHandler,
which checks if the call is to eventInstance() and if not, it will
delegate to the normal LazyDataObject instance.

JIRA: MDSAL-282
Change-Id: I0dda9a55e4da6231c9bd3be03121a236ce187e47
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-adapter/src/main/java/org/opendaylight/mdsal/binding/dom/adapter/BindingDOMNotificationListenerAdapter.java
binding/mdsal-binding-dom-adapter/src/main/java/org/opendaylight/mdsal/binding/dom/adapter/BindingToNormalizedNodeCodec.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/api/BindingNormalizedNodeSerializer.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/BindingNormalizedNodeCodecRegistry.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/CodecDataObjectGenerator.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/impl/NotificationCodecContext.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/mdsal/binding/dom/codec/loader/CodecClassLoader.java
binding/mdsal-binding-dom-codec/src/test/java/org/opendaylight/mdsal/binding/dom/codec/test/NotificationProcessingTest.java