Add is{Notification,Rpc,RpcReply}Message methods
[netconf.git] / protocol / netconf-api / src / main / java / org / opendaylight / netconf / api / messages / RpcReplyMessage.java
index 071a3ab771f138f1efed28d4fb4656112ee7bfaa..ebf5959fd378d9bdce66e42f4a45ada3900cfeab 100644 (file)
@@ -69,4 +69,10 @@ public final class RpcReplyMessage extends NetconfMessage {
         final var attr = getDocument().getDocumentElement().getAttributeNode(XmlNetconfConstants.MESSAGE_ID);
         return attr == null ? null : attr.getValue();
     }
+
+    public static boolean isRpcReplyMessage(final Document document) {
+        final var root = document.getDocumentElement();
+        return NamespaceURN.BASE.equals(root.getNamespaceURI())
+            && XmlNetconfConstants.RPC_REPLY_KEY.equals(root.getLocalName());
+    }
 }