Uploaded image for project: 'infrautils'
  1. infrautils
  2. INFRAUTILS-99

Revise DiagStatus API

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • 6.0.0
    • diagstatus

    Description

      There are a number of lifecycle problems in this API.

      ServiceRegistration is not idempotent. It would be nice if it were an AutoCloseable instance – yangtools.concepts.Registration preferrably, but we cannot quite have that now. Anyway unregister() should have a much-preferred idempotent close().

      Furthermore ServiceDescriptor takes moduleServiceName which is also supplied to DiagStatusService.register(). This means that ServiceRegistration knows this name and hence could provide a newDescriptor(ServiceState) method without users passing this in.

      Finally DiagStatusService.report() takes a ServiceDescriptor and a ServiceState, both of which are required.

      Let us have a:

      interface DiagStatus implements AutoCloseable {
      
         void report(ServiceState state);
      
         @Override
         close();
      }
      

      which replaces ServiceRegistration.

      Attachments

        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: