Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-1014

Expand netconf.api.messages

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: High High
    • 8.0.0
    • None
    • netconf

      We have a baseline NetconfMessage, HelloMessage and NotificationMessage. We are notably missing RpcMessage and RpcReplyMessage – which means our object model of NETCONF Messages Layer is incomplete.

      This omission actually has a number of repercussions across the code, as we do not end up deferring to the internal document to check its tags over and over again to determine which message we are talking to.

      This issue has these deliverables, to be delivered in this order:

      1. move NetconfMessage to netconf.api.messages
      2. introduce RpcMessage and RpcReplyMessage
      3. Make Notification's constructor private and provide a wrapping and non-wrapping static methods yielding NotificationMessage, to go in-line with Rpc- and RpcReplyMessage interface
      4. netty-util's NetconfStartExiMessage should be turned into an utility class that constructs a raw Document and returns an RpcMessage with that Document
      5. make NetconfMessage abstract and sealed, permitting on only the known messages, to be constructed through a 'public static @NonNull NetconfMessage of(Document document)' method. NOTE: This turned out to be more tangled up than anticipated, so it had to be broken down into a few steps:
        1. Implement the NetconfMessage.of(Document) method
        2. Since the of() method verifies the content of the document and constructs a corresponding subclass of NetconfMessage accordingly, there are some tests that will be failing when using the of() method, because they are using documents with malformed payload. Fix those tests
        3. Eliminate all usages of NetconfMessage constructor outside of its inheritors, make the constructor protected, make the class abstract and sealed, permitting only Hello-, Notification-, Rpc-, RpcReply- Message.
      6. improve netconf.server.spi.SubtreeFilter to not take plain org.w3c.Documents, but rather NotificationMessage, RpcMessage, RpcReplyMessage
      7. audit for other opportunities, like NetconfDeviceCommunicator.processMessage(), where we should be able to use instanceof checks and have Request.request be a RpcMessage

       

            Unassigned Unassigned
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: