Interface MonitorInterface

All Known Implementing Classes:
OpsviewProvider

public interface MonitorInterface
ECMWF Product Data Store (OpenECPDS) Project This interface should be implemented by any class which implement a monitoring protocol (e.g. Nagios, Bigsister).
Since:
2024-07-01
Version:
6.7.7
Author:
Laurent Gougeon - syi@ecmwf.int, ECMWF.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addNotes(String destination, int type, String metadata)
    Adds/replaces the notes attached to a destination/host.
    void
    sendMessage(String name, String service, int status, String message)
    Sends the message.
  • Method Details

    • sendMessage

      void sendMessage(String name, String service, int status, String message) throws Exception
      Sends the message.
      Parameters:
      name - the name
      service - the service
      status - the status
      message - the message
      Throws:
      Exception - the exception
    • addNotes

      default void addNotes(String destination, int type, String metadata) throws Exception
      Adds/replaces the notes attached to a destination/host. A default method (rather than a second abstract one) so that sendMessage(String, String, int, String) remains this interface's only abstract method - existing providers set up as a lambda (a single-method functional interface, e.g. a DataMover relaying sendMessage calls to the MasterServer over its REST proxy) keep compiling unchanged, and simply don't support notes: the default throws UnsupportedOperationException, which MonitorManager.addNotes(String, int, String) turns into a MonitorException for the caller.
      Parameters:
      destination - the destination
      type - the destination's type (ecmwf.ecpds.master.transfer.DestinationOption), used by providers that group destinations by type (e.g. Opsview's Acquisition/Dissemination/Other filters)
      metadata - the metadata
      Throws:
      Exception - the exception