[ONOS-3918] Handling of NETCONF <rpc-error> and no message-id
Change-Id: I8b9396a727fb54b5b84d02f258c14cfccad5bb99
diff --git a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceOutputEvent.java b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceOutputEvent.java
index f6ba4ab..956f063 100644
--- a/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceOutputEvent.java
+++ b/protocols/netconf/api/src/main/java/org/onosproject/netconf/NetconfDeviceOutputEvent.java
@@ -18,6 +18,8 @@
import org.onosproject.event.AbstractEvent;
+import java.util.Optional;
+
/**
* Describes network configuration event.
*/
@@ -25,7 +27,7 @@
AbstractEvent<NetconfDeviceOutputEvent.Type, Object> {
private final String messagePayload;
- private final int messageID;
+ private final Optional<Integer> messageID;
private final NetconfDeviceInfo deviceInfo;
/**
@@ -64,7 +66,8 @@
* @param msgID id of the message related to the event
* @param netconfDeviceInfo device of event
*/
- public NetconfDeviceOutputEvent(Type type, Object subject, String payload, int msgID,
+ public NetconfDeviceOutputEvent(Type type, Object subject, String payload,
+ Optional<Integer> msgID,
NetconfDeviceInfo netconfDeviceInfo) {
super(type, subject);
messagePayload = payload;
@@ -83,8 +86,10 @@
* @param msgID id of the message related to the event
* @param time occurrence time
*/
- public NetconfDeviceOutputEvent(Type type, Object subject, String payload, int msgID,
- NetconfDeviceInfo netconfDeviceInfo, long time) {
+ public NetconfDeviceOutputEvent(Type type, Object subject, String payload,
+ Optional<Integer> msgID,
+ NetconfDeviceInfo netconfDeviceInfo,
+ long time) {
super(type, subject, time);
messagePayload = payload;
deviceInfo = netconfDeviceInfo;
@@ -111,7 +116,7 @@
* Reply messageId.
* @return messageId
*/
- public Integer getMessageID() {
+ public Optional<Integer> getMessageID() {
return messageID;
}
}