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

Refactor RemoteDeviceHandler

    XMLWordPrintable

Details

    • Improvement
    • Status: Confirmed
    • Medium
    • Resolution: Unresolved
    • None
    • 7.0.0
    • netconf-client-mdsal

    Description

      This interface is completely undocumented and has a bit unfriendly interface. The interaction of the callbacks does not enforce the lifecycle of the state introduced on RemoteDeviceHandler's onRemoteDeviceUp() and hence it is not clear when onRemoteDeviceDown() can (and should) be closed vs. when onRemoteDeviceFailed() should be called.

      Fix this by refacting as follows:

      public interface RemoteDeviceHandler extends AutoCloseable {
          @NonNull RemoteDeviceConnection onDeviceConnected(NetconfDeviceSchema deviceSchema, NetconfSessionPreferences sessionPreferences, RemoteDeviceServices services);
      
          void onDeviceFailed(@NonNull Throwable throwable);
      
          @Override
          void close();
      }
      
      public abstract class RemoteDeviceConnection extends AbstractRegistration {
      
          public abstract void onNotification(@NonNull DOMNotification domNotification);
      }
      

      This will force idem

      Attachments

        Issue Links

          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated: