Class DelayNotices

java.lang.Object
ecmwf.ecpds.master.plugin.http.controller.monitoring.DelayNotices

public final class DelayNotices extends Object
ECMWF Product Data Store (OpenECPDS) Project The register of the delay notices, kept in the DELAY_NOTICE table of the database (see the Master's DataBaseImpl). The status, creation and version are columns; everything else is a JSON document. References (DLY-YYYY-NNNN) are allocated atomically by the Master, so several Monitors can register notices at the same time, and modifications use optimistic locking (the version column) so that two operators changing the same notice cannot overwrite each other. Notices are kept until an operator deletes them.
Since:
2026-10-12
Version:
8.2.0
Author:
Laurent Gougeon - syi@ecmwf.int, ECMWF.
  • Method Details

    • list

      public static List<Map<String,Object>> list(int limit) throws Exception
      Loads the most recent notices.
      Parameters:
      limit - the maximum number of notices
      Returns:
      the notices, most recent first
      Throws:
      Exception - if they cannot be read
    • list

      public static List<Map<String,Object>> list(String fromDate, String toDate) throws Exception
      Loads notices created within an inclusive date range.
      Parameters:
      fromDate - the start date
      toDate - the end date
      Returns:
      the notices, most recent first
      Throws:
      Exception - if they cannot be read
    • get

      public static Map<String,Object> get(String ref) throws Exception
      Gets a notice.
      Parameters:
      ref - the reference
      Returns:
      the notice, or null
      Throws:
      Exception - if it cannot be read
    • create

      public static String create(Map<String,Object> notice, String status, String createdBy) throws Exception
      Registers a new notice; the reference is allocated by the Master.
      Parameters:
      notice - the content (the "ref" is added to it)
      status - the initial status
      createdBy - the user
      Returns:
      the reference
      Throws:
      Exception - if it cannot be saved
    • modify

      public static Map<String,Object> modify(String ref, DelayNotices.Change change) throws Exception
      Modifies a notice atomically: the notice is read, changed by the given function and written back only if nobody changed it in the meantime, otherwise the whole operation is retried on the fresh version.
      Parameters:
      ref - the reference
      change - the change (it may throw IllegalArgumentException to refuse it and, being possibly run again, must not have side effects)
      Returns:
      the notice after the change
      Throws:
      Exception - if the notice is unknown, the change is refused or it cannot be saved
    • delete

      public static void delete(String ref) throws Exception
      Deletes a notice.
      Parameters:
      ref - the reference
      Throws:
      Exception - if it cannot be deleted
    • defaultCc

      public static String defaultCc() throws Exception
      Gets the default Cc recipients.
      Returns:
      the addresses, or an empty string
      Throws:
      Exception - if the setting cannot be read
    • setDefaultCc

      public static void setDefaultCc(String cc) throws Exception
      Sets the default Cc recipients.
      Parameters:
      cc - the addresses
      Throws:
      Exception - if it cannot be saved
    • defaultBcc

      public static String defaultBcc() throws Exception
      Gets the default Bcc recipients.
      Returns:
      the addresses, or an empty string
      Throws:
      Exception - if the setting cannot be read
    • setDefaultBcc

      public static void setDefaultBcc(String bcc) throws Exception
      Sets the default Bcc recipients.
      Parameters:
      bcc - the addresses
      Throws:
      Exception - if it cannot be saved