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

Refactor RemoteDeviceHandler

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • 8.0.0
    • None
    • netconf-client-mdsal

      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

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

              Created:
              Updated: