import java.util.Optional;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.NetconfSession;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
import org.opendaylight.netconf.mapping.api.SessionAwareNetconfOperation;
@Override
public void setSession(final NetconfSession session) {
- this.netconfSession = session;
+ netconfSession = session;
}
@Override
}
@Override
- public void onNotification(final StreamNameType stream, final NetconfNotification notification) {
+ public void onNotification(final StreamNameType stream, final NotificationMessage notification) {
if (filter == null) {
currentSession.sendMessage(notification);
return;
SubtreeFilter.applySubtreeNotificationFilter(filter, notification.getDocument());
if (filtered.isPresent()) {
final Date eventTime = notification.getEventTime();
- currentSession.sendMessage(new NetconfNotification(filtered.orElseThrow(), eventTime));
+ currentSession.sendMessage(new NotificationMessage(filtered.orElseThrow(), eventTime));
}
} catch (DocumentedException e) {
LOG.warn("Failed to process notification {}", notification, e);
import org.checkerframework.checker.lock.qual.GuardedBy;
import org.opendaylight.mdsal.binding.dom.codec.spi.BindingDOMCodecFactory;
import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeGenerator;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.notifications.BaseNotificationPublisherRegistration;
import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
import org.opendaylight.netconf.notifications.NetconfNotificationListener;
}
@Override
- public synchronized void onNotification(final StreamNameType stream, final NetconfNotification notification) {
+ public synchronized void onNotification(final StreamNameType stream, final NotificationMessage notification) {
LOG.debug("Notification of type {} detected", stream);
if (LOG.isTraceEnabled()) {
LOG.debug("Notification of type {} detected: {}", stream, notification);
}
@Override
- public void onNotification(final StreamNameType stream, final NetconfNotification notification) {
+ public void onNotification(final StreamNameType stream, final NotificationMessage notification) {
checkState(baseListener != null, "Already closed");
checkArgument(stream.equals(registeredStream));
baseListener.onNotification(stream, notification);
baseRegistration.close();
}
- private NetconfNotification serializeNotification(final Notification<?> notification, final Absolute path) {
+ private NotificationMessage serializeNotification(final Notification<?> notification, final Absolute path) {
return transformUtil.transform(notification, path);
}
import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeContext;
import org.opendaylight.mdsal.binding.runtime.api.BindingRuntimeGenerator;
import org.opendaylight.mdsal.binding.runtime.spi.BindingRuntimeHelpers;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.api.xml.XmlUtil;
import org.opendaylight.netconf.util.NetconfUtil;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.Netconf;
/**
* Transform base notification for capabilities into NetconfNotification.
*/
- public NetconfNotification transform(final Notification<?> notification, final Absolute path) {
+ public NotificationMessage transform(final Notification<?> notification, final Absolute path) {
return transform(notification, Optional.empty(), path);
}
- public NetconfNotification transform(final Notification<?> notification, final Date eventTime,
+ public NotificationMessage transform(final Notification<?> notification, final Date eventTime,
final Absolute path) {
return transform(notification, Optional.ofNullable(eventTime), path);
}
- private NetconfNotification transform(final Notification<?> notification, final Optional<Date> eventTime,
+ private NotificationMessage transform(final Notification<?> notification, final Optional<Date> eventTime,
final Absolute path) {
final ContainerNode containerNode = serializer.toNormalizedNodeNotification(notification);
final DOMResult result = new DOMResult(XmlUtil.newDocument());
throw new IllegalStateException("Unable to serialize " + notification, e);
}
final Document node = (Document) result.getNode();
- return eventTime.isPresent() ? new NetconfNotification(node, eventTime.orElseThrow())
- : new NetconfNotification(node);
+ return eventTime.isPresent() ? new NotificationMessage(node, eventTime.orElseThrow())
+ : new NotificationMessage(node);
}
}
package org.opendaylight.netconf.mdsal.notification.impl;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import com.google.common.collect.Lists;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.format.DateTimeParseException;
-import java.util.ArrayList;
import java.util.Date;
-import java.util.Iterator;
-import org.junit.Assert;
+import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.mdsal.binding.dom.codec.impl.di.DefaultBindingDOMCodecFactory;
import org.opendaylight.mdsal.binding.generator.impl.DefaultBindingRuntimeGenerator;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.api.xml.XmlUtil;
import org.opendaylight.netconf.notifications.BaseNotificationPublisherRegistration;
import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
@Test
public void testEventTime() throws Exception {
//Testing values with SimpleDateFormat
- final ArrayList<String> checkWith = Lists.newArrayList(
+ final var iterator = List.of(
"2001-07-04T12:08:56.235-07:00",
"2015-10-23T09:42:27.671+00:00",
"1970-01-01T17:17:22.229+00:00",
"1937-01-01T23:59:59.870+00:20",
"1990-12-31T23:59:59.000+00:00",
"2015-10-23T23:59:59.200+00:00",
- "1985-04-12T23:59:59.520+00:00");
- final Iterator<String> iterator = checkWith.iterator();
+ "1985-04-12T23:59:59.520+00:00").iterator();
// Testing correct values
- for (final String time : Lists.newArrayList(
+ for (final String time : List.of(
"2001-07-04T12:08:56.235-07:00",
"2015-10-23T09:42:27.67175+00:00",
"1970-01-01T17:17:22.229568+00:00",
"2015-10-23T23:59:60.20001Z",
"1985-04-12T23:59:60.52Z"
)) {
- try {
- final Date apply = NetconfNotification.RFC3339_DATE_PARSER.apply(time);
- final Date parse =
- new SimpleDateFormat(RFC3339_DATE_FORMAT_WITH_MILLIS_BLUEPRINT).parse(iterator.next());
- assertEquals(parse.getTime(), apply.getTime());
- // Testing that we're consistent from formatting to parsing.
- final String dateString = NetconfNotification.RFC3339_DATE_FORMATTER.apply(apply);
- final Date date1 = NetconfNotification.RFC3339_DATE_PARSER.apply(dateString);
- final String dateString1 = NetconfNotification.RFC3339_DATE_FORMATTER.apply(date1);
- Assert.assertEquals(apply, date1);
- Assert.assertEquals(dateString, dateString1);
- } catch (final DateTimeParseException e) {
- fail("Failed to parse time value = " + time + " " + e);
- throw e;
- }
+ final Date apply = NotificationMessage.RFC3339_DATE_PARSER.apply(time);
+ final Date parse = new SimpleDateFormat(RFC3339_DATE_FORMAT_WITH_MILLIS_BLUEPRINT).parse(iterator.next());
+ assertEquals(parse.getTime(), apply.getTime());
+ // Testing that we're consistent from formatting to parsing.
+ final String dateString = NotificationMessage.RFC3339_DATE_FORMATTER.apply(apply);
+ final Date date1 = NotificationMessage.RFC3339_DATE_PARSER.apply(dateString);
+ final String dateString1 = NotificationMessage.RFC3339_DATE_FORMATTER.apply(date1);
+ assertEquals(apply, date1);
+ assertEquals(dateString, dateString1);
}
// Testing that we're consistent from formatting to parsing.
final Date date0 = Date.from(Instant.ofEpochMilli(0));
- final String dateString0 = NetconfNotification.RFC3339_DATE_FORMATTER.apply(date0);
- final Date date1 = NetconfNotification.RFC3339_DATE_PARSER.apply(dateString0);
- final String dateString1 = NetconfNotification.RFC3339_DATE_FORMATTER.apply(date1);
- Assert.assertEquals(date0, date1);
- Assert.assertEquals(dateString0, dateString1);
+ final String dateString0 = NotificationMessage.RFC3339_DATE_FORMATTER.apply(date0);
+ final Date date1 = NotificationMessage.RFC3339_DATE_PARSER.apply(dateString0);
+ final String dateString1 = NotificationMessage.RFC3339_DATE_FORMATTER.apply(date1);
+ assertEquals(date0, date1);
+ assertEquals(dateString0, dateString1);
// Testing wrong values
- for (final String time : Lists.newArrayList(
+ for (final String time : List.of(
"0",
"205-10-23T09:42:27.67175+00:00",
"1970-01-01T17:60:22.229568+00:00",
"1937-01-01T32:00:27.87+00:20",
"2060-13-31T15:59:90-08:00",
- "1990-12-31T23:58:60Z"
- )) {
- try {
- NetconfNotification.RFC3339_DATE_PARSER.apply(time);
- } catch (final DateTimeParseException e) {
- continue;
- }
- fail("Should have thrown an exception; value= " + time);
+ "1990-12-31T23:58:60Z")) {
+ assertThrows(DateTimeParseException.class, () -> NotificationMessage.RFC3339_DATE_PARSER.apply(time));
}
}
final NetconfCapabilityChangeBuilder capabilityChangedBuilder = new NetconfCapabilityChangeBuilder();
final NetconfNotificationListener listener = mock(NetconfNotificationListener.class);
- doNothing().when(listener).onNotification(any(StreamNameType.class), any(NetconfNotification.class));
+ doNothing().when(listener).onNotification(any(StreamNameType.class), any(NotificationMessage.class));
final NotificationListenerRegistration notificationListenerRegistration = netconfNotificationManager
.registerNotificationListener(NetconfNotificationManager.BASE_NETCONF_STREAM.getName(), listener);
final NetconfCapabilityChange notification = capabilityChangedBuilder.build();
baseNotificationPublisherRegistration.onCapabilityChanged(notification);
- verify(listener).onNotification(any(StreamNameType.class), any(NetconfNotification.class));
+ verify(listener).onNotification(any(StreamNameType.class), any(NotificationMessage.class));
notificationListenerRegistration.close();
final NetconfNotificationListener listener = mock(NetconfNotificationListener.class);
netconfNotificationManager.registerNotificationListener(testStream.getName(), listener);
- doNothing().when(listener).onNotification(eq(testStreamName), any(NetconfNotification.class));
+ doNothing().when(listener).onNotification(eq(testStreamName), any(NotificationMessage.class));
- final NetconfNotification notification = new NetconfNotification(
+ final NotificationMessage notification = new NotificationMessage(
XmlUtil.readXmlToDocument("<notification/>"));
netconfNotificationManager.onNotification(testStream.getName(), notification);
verify(streamListener).onStreamUnregistered(NetconfNotificationManager.BASE_NETCONF_STREAM.getName());
- try {
- baseNotificationPublisherRegistration.onCapabilityChanged(new NetconfCapabilityChangeBuilder().build());
- } catch (final IllegalStateException e) {
- // Exception should be thrown after manager is closed
- return;
- }
-
- fail("Publishing into a closed manager should fail");
+ final var change = new NetconfCapabilityChangeBuilder().build();
+ assertThrows(IllegalStateException.class,
+ () -> baseNotificationPublisherRegistration.onCapabilityChanged(change));
}
@Test
import org.junit.Test;
import org.opendaylight.mdsal.binding.dom.codec.impl.di.DefaultBindingDOMCodecFactory;
import org.opendaylight.mdsal.binding.generator.impl.DefaultBindingRuntimeGenerator;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.api.xml.XmlUtil;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfCapabilityChange;
"<notification xmlns=\"urn:ietf:params:netconf:capability:notification:1.0\">"
+ INNER_NOTIFICATION
+ "<eventTime>"
- + NetconfNotification.RFC3339_DATE_FORMATTER.apply(DATE)
+ + NotificationMessage.RFC3339_DATE_FORMATTER.apply(DATE)
+ "</eventTime>"
+ "</notification>";
netconfCapabilityChangeBuilder.setDeletedCapability(Set.of(new Uri("uri4"), new Uri("uri3")));
final NetconfCapabilityChange capabilityChange = netconfCapabilityChangeBuilder.build();
- final NetconfNotification transform = UTIL.transform(capabilityChange, DATE,
+ final NotificationMessage transform = UTIL.transform(capabilityChange, DATE,
Absolute.of(NetconfCapabilityChange.QNAME));
final String serialized = XmlUtil.toString(transform.getDocument());
@Test
public void testTransformFromDOM() throws Exception {
- final NetconfNotification netconfNotification =
- new NetconfNotification(XmlUtil.readXmlToDocument(INNER_NOTIFICATION), DATE);
+ final NotificationMessage netconfNotification =
+ new NotificationMessage(XmlUtil.readXmlToDocument(INNER_NOTIFICATION), DATE);
XMLUnit.setIgnoreWhitespace(true);
compareXml(EXPECTED_NOTIFICATION, netconfNotification.toString());
}
-
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.notifications;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType;
/**
* Generic listener for netconf notifications.
*/
public interface NetconfNotificationListener {
-
/**
* Callback used to notify the listener about any new notification.
*/
- void onNotification(StreamNameType stream, NetconfNotification notification);
-
+ void onNotification(StreamNameType stream, NotificationMessage notification);
}
import java.net.URI;
import java.time.Instant;
import java.time.format.DateTimeParseException;
-import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayDeque;
import java.util.Collection;
import java.util.Deque;
import org.opendaylight.netconf.api.EffectiveOperation;
import org.opendaylight.netconf.api.NetconfDocumentedException;
import org.opendaylight.netconf.api.NetconfMessage;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.api.xml.XmlElement;
import org.opendaylight.netconf.api.xml.XmlUtil;
import org.opendaylight.netconf.client.NetconfMessageUtil;
}
try {
- return new SimpleEntry<>(
- NetconfNotification.RFC3339_DATE_PARSER.apply(eventTimeElement.getTextContent()).toInstant(),
+ return Map.entry(
+ NotificationMessage.RFC3339_DATE_PARSER.apply(eventTimeElement.getTextContent()).toInstant(),
notificationElement);
} catch (final DocumentedException e) {
throw new IllegalArgumentException("Notification payload does not contain " + EVENT_TIME + " " + message,
e);
} catch (final DateTimeParseException e) {
LOG.warn("Unable to parse event time from {}. Setting time to {}", eventTimeElement,
- NetconfNotification.UNKNOWN_EVENT_TIME, e);
- return new SimpleEntry<>(NetconfNotification.UNKNOWN_EVENT_TIME.toInstant(),
- notificationElement);
+ NotificationMessage.UNKNOWN_EVENT_TIME, e);
+ return Map.entry(NotificationMessage.UNKNOWN_EVENT_TIME.toInstant(), notificationElement);
}
}
import org.opendaylight.mdsal.dom.api.DOMEvent;
import org.opendaylight.mdsal.dom.api.DOMNotification;
import org.opendaylight.netconf.api.NetconfMessage;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.api.xml.XmlUtil;
import org.opendaylight.netconf.sal.connect.netconf.schema.mapping.NetconfMessageTransformer;
import org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext;
assertNotNull(root);
assertEquals(1, root.body().size());
assertEquals("interface-enabled", root.getIdentifier().getNodeType().getLocalName());
- assertEquals(NetconfNotification.RFC3339_DATE_PARSER.apply("2008-07-08T00:01:00Z").toInstant(),
+ assertEquals(NotificationMessage.RFC3339_DATE_PARSER.apply("2008-07-08T00:01:00Z").toInstant(),
((DOMEvent) domNotification).getEventInstant());
assertEquals(Absolute.of(INTERFACES_QNAME, INTERFACE_QNAME, INTERFACE_ENABLED_NOTIFICATION_QNAME),
domNotification.getType());
import org.opendaylight.mdsal.dom.api.DOMEvent;
import org.opendaylight.mdsal.dom.api.DOMNotification;
import org.opendaylight.netconf.api.NetconfMessage;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.api.xml.XmlUtil;
import org.opendaylight.netconf.sal.connect.netconf.schema.mapping.NetconfMessageTransformer;
import org.opendaylight.yangtools.rfc8528.data.util.EmptyMountPointContext;
assertNotNull(root);
assertEquals(6, root.body().size());
assertEquals("user-visited-page", root.getIdentifier().getNodeType().getLocalName());
- assertEquals(NetconfNotification.RFC3339_DATE_PARSER.apply("2015-10-23T09:42:27.67175+00:00").toInstant(),
+ assertEquals(NotificationMessage.RFC3339_DATE_PARSER.apply("2015-10-23T09:42:27.67175+00:00").toInstant(),
((DOMEvent) domNotification).getEventInstant());
}
}
/**
* Special kind of netconf message that contains a timestamp.
*/
-public final class NetconfNotification extends NetconfMessage {
- private static final Logger LOG = LoggerFactory.getLogger(NetconfNotification.class);
+public final class NotificationMessage extends NetconfMessage {
+ private static final Logger LOG = LoggerFactory.getLogger(NotificationMessage.class);
private static final String NOTIFICATION_TAG = "notification";
private static final String EVENT_TIME_TAG = "eventTime";
/**
* Create new notification and capture the timestamp in the constructor.
*/
- public NetconfNotification(final Document notificationContent) {
+ public NotificationMessage(final Document notificationContent) {
this(notificationContent, new Date());
}
* Create new notification with provided timestamp.
*/
@SuppressFBWarnings("EI_EXPOSE_REP2") // stores a reference to an externally mutable Date object
- public NetconfNotification(final Document notificationContent, final Date eventTime) {
+ public NotificationMessage(final Document notificationContent, final Date eventTime) {
super(wrapNotification(notificationContent, eventTime));
this.eventTime = eventTime;
}
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
-public class NetconfNotificationTest {
-
+public class NotificationMessageTest {
@Test
public void testWrapNotification() throws Exception {
final Document document = UntrustedXML.newDocumentBuilder().newDocument();
final Date eventTime = new Date();
eventTime.setTime(10000000);
- final NetconfNotification netconfNotification = new NetconfNotification(document, eventTime);
+ final NotificationMessage netconfNotification = new NotificationMessage(document, eventTime);
final Document resultDoc = netconfNotification.getDocument();
final NodeList nodeList = resultDoc.getElementsByTagNameNS(
"urn:ietf:params:netconf:capability:notification:1.0", "notification");
final Element eventTimeElement = (Element) childNodes.item(0);
- assertEquals(eventTime.getTime(), NetconfNotification.RFC3339_DATE_PARSER
+ assertEquals(eventTime.getTime(), NotificationMessage.RFC3339_DATE_PARSER
.apply(eventTimeElement.getTextContent()).getTime());
assertEquals(eventTime, netconfNotification.getEventTime());
-
}
}
import java.util.regex.Pattern;
import org.opendaylight.netconf.api.NetconfMessage;
import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.api.monitoring.NetconfManagementSession;
import org.opendaylight.netconf.nettyutil.AbstractNetconfSession;
import org.opendaylight.netconf.nettyutil.handler.NetconfMessageToXMLEncoder;
@Override
public ChannelFuture sendMessage(final NetconfMessage netconfMessage) {
final ChannelFuture channelFuture = super.sendMessage(netconfMessage);
- if (netconfMessage instanceof NetconfNotification notification) {
+ if (netconfMessage instanceof NotificationMessage notification) {
outNotification++;
sessionListener.onNotification(this, notification);
}
import org.opendaylight.netconf.api.NetconfMessage;
import org.opendaylight.netconf.api.NetconfSessionListener;
import org.opendaylight.netconf.api.NetconfTerminationReason;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.netconf.api.monitoring.SessionEvent;
import org.opendaylight.netconf.api.monitoring.SessionListener;
throw new IllegalStateException("Unable to process incoming message", failure);
}
- public void onNotification(final NetconfServerSession session, final NetconfNotification notification) {
+ public void onNotification(final NetconfServerSession session, final NotificationMessage notification) {
monitoringSessionListener.onSessionEvent(SessionEvent.notification(session));
}
import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.netconf.api.NetconfMessage;
import org.opendaylight.netconf.api.NetconfTerminationReason;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.netconf.api.monitoring.SessionEvent;
import org.opendaylight.netconf.api.monitoring.SessionListener;
@Test
public void testOnNotification() throws Exception {
- listener.onNotification(session, new NetconfNotification(XmlUtil.readXmlToDocument("<notification/>")));
+ listener.onNotification(session, new NotificationMessage(XmlUtil.readXmlToDocument("<notification/>")));
verify(monitoringListener).onSessionEvent(argThat(sessionEventIs(SessionEvent.Type.NOTIFICATION)));
}
import org.mockito.junit.MockitoJUnitRunner;
import org.opendaylight.netconf.api.NetconfMessage;
import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
-import org.opendaylight.netconf.api.messages.NetconfNotification;
+import org.opendaylight.netconf.api.messages.NotificationMessage;
import org.opendaylight.netconf.api.xml.XmlUtil;
import org.opendaylight.netconf.nettyutil.AbstractChannelInitializer;
import org.opendaylight.netconf.nettyutil.handler.NetconfEXICodec;
public void testSendNotification() throws Exception {
doNothing().when(listener).onNotification(any(), any());
final Document msgDoc = XmlUtil.readXmlToDocument("<notification></notification>");
- final NetconfNotification notif = new NetconfNotification(msgDoc);
+ final NotificationMessage notif = new NotificationMessage(msgDoc);
session.sendMessage(notif);
channel.runPendingTasks();
final Object o = channel.readOutbound();