- public void getSSE(@Encoded @PathParam("identifier") final String identifier, @Context final UriInfo uriInfo,
- @Context final SseEventSink sink, @Context final Sse sse) {
- final String streamName = ListenersBroker.createStreamNameFromUri(identifier);
- final BaseListenerInterface listener;
- final String notificaionType =
- uriInfo.getQueryParameters().getFirst(RestconfStreamsConstants.NOTIFICATION_TYPE);
- if (notificaionType != null && notificaionType.equals(RestconfStreamsConstants.DEVICE)) {
- listener = listenersBroker.deviceNotificationListenerFor(streamName);
- if (listener == null) {
- LOG.debug("Listener for device path with name {} was not found.", streamName);
- throw new RestconfDocumentedException("Data missing", ErrorType.APPLICATION, ErrorTag.DATA_MISSING);
- }
- } else {
- listener = listenersBroker.listenerFor(streamName);
- if (listener == null) {
- LOG.debug("Listener for stream with name {} was not found.", streamName);
- throw new RestconfDocumentedException("Data missing", ErrorType.APPLICATION, ErrorTag.DATA_MISSING);
- }
+ public void getSSE(@Encoded @PathParam("identifier") final String identifier, @Context final SseEventSink sink,
+ @Context final Sse sse) {
+ final var streamName = ListenersBroker.createStreamNameFromUri(identifier);
+ final var listener = listenersBroker.listenerFor(streamName);
+ if (listener == null) {
+ LOG.debug("Listener for stream with name {} was not found.", streamName);
+ throw new RestconfDocumentedException("Data missing", ErrorType.APPLICATION, ErrorTag.DATA_MISSING);