Use random UUIDs for stream names
Deriving stream names from their parameters is rather tacky, as it opens
up race conditions, lifecycle leaks and the lure to try to parse the
names out.
This patch refactors the logic to split stream name allocation, which is
now random, and creation of the actual stream via StreamFactory.
Since we now know names cannot conflict and that each AbstractStream has
its name embedded, we can do away with BiMaps and StampedLocks and
instead keep all streams in a single ConcurrentMap.
We end up removing a ton of duplicated code, allowing us to focus on
the lifecycle itself.
This in turn shows that we do not have an end-of-stream indicator for
subscribers to see -- so introduce it and pick up the resulting
DeviceNotificationListenerAdaptor clean ups.
This refactor also shows that {Json,Xml}NotificationListenerTest are
only testing NotificationFormatter, so we rename them and migrate to
JUnit5.
JIRA: NETCONF-1102
Change-Id: I043bebbd9240281cda9e29b41881de43f0a6b769
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
17 files changed: