Class CadipMonitor

All Implemented Interfaces:
Runnable

@Component @Scope("singleton") public class CadipMonitor extends BaseMonitor
Monitor for CADU Interface Points (CADIP) For specification details see "CADU Interface Delivery Point Specification" (ESA-EOPG-EOPGC-IF-15, issue 1.1)
Author:
Dr. Thomas Bassler
  • Field Details

    • copySuccess

      Map<String,Boolean> copySuccess
      Indicator for parallel copying processes
  • Constructor Details

    • CadipMonitor

      public CadipMonitor()
  • Method Details

    • getMaxFileDownloadThreads

      public int getMaxFileDownloadThreads()
      Gets the maximum number of parallel file download threads within a download session
      Returns:
      the maximum number of parallel file download threads
    • setMaxFileDownloadThreads

      public void setMaxFileDownloadThreads(int maxFileDownloadThreads)
      Sets the maximum number of parallel file download threads within a download session
      Parameters:
      maxFileDownloadThreads - the maximum number of parallel file download threads to set
    • getFileWaitInterval

      public int getFileWaitInterval()
      Gets the interval to check for completed file downloads
      Returns:
      the check interval in millliseconds
    • setFileWaitInterval

      public void setFileWaitInterval(int fileWaitInterval)
      Sets the interval to check for completed file downloads
      Parameters:
      fileWaitInterval - the check interval in millliseconds to set
    • getMaxFileWaitCycles

      public int getMaxFileWaitCycles()
      Gets the maximum number of wait cycles for file download completion checks
      Returns:
      the maximum number of wait cycles
    • setMaxFileWaitCycles

      public void setMaxFileWaitCycles(int maxFileWaitCycles)
      Sets the maximum number of wait cycles for file download completion checks
      Parameters:
      maxFileWaitCycles - the maximum number of wait cycles to set
    • getLastCopyPerformance

      public Double getLastCopyPerformance()
      Gets the last copy performance for monitoring purposes
      Returns:
      the last copy performance in MiB/s
    • setLastCopyPerformance

      void setLastCopyPerformance(Double copyPerformance)
      Records the last copy performance for monitoring purposes
      Parameters:
      copyPerformance - the copy performance in MiB/s
    • checkAvailableDownloads

      protected BaseMonitor.TransferControl checkAvailableDownloads(Instant referenceTimeStamp)
      Check the configured CADIP for new downlink sessions, whose publication date is after the reference time stamp:
      1. Retrieve all downlink sessions with publication time after reference time stamp (authenticating with either Basic Auth or Bearer Token)
      2. Convert JSON session entries into transfer objects
      3. Return a list of all transfer objects
      Specified by:
      checkAvailableDownloads in class BaseMonitor
      Parameters:
      referenceTimeStamp - the reference timestamp to apply for pickup point lookups
      Returns:
      a transfer control object containing a list of available transfer objects
    • transferToTargetDir

      protected boolean transferToTargetDir(TransferObject object)
      Transfer the session found and its CADU files to the configured CADU target directory for L0 processing
      • Create empty "done" list
      • Create session and channel directories
      • WHILE session is not complete
        • Retrieve file list for session
        • FOR EACH CADU file in file list and not in "done" list DO IN PARALLEL (up to quota)
          • Download CADU file (check size)
          • IF CADU file is marked as "final block", set session as completed
      • Check session quality information
      Specified by:
      transferToTargetDir in class BaseMonitor
    • triggerParallelAction

      protected boolean triggerParallelAction(CadipMonitor.TransferSession transferSession)
      Trigger any necessary parallel action on the transfer session (e. g. L0 processing)
      Parameters:
      transferSession - the transfer session to start the action on
      Returns:
      true, if starting the action succeeded (not necessarily the action itself), false otherwise
    • triggerFollowOnAction

      protected boolean triggerFollowOnAction(TransferObject transferObject)
      Specified by:
      triggerFollowOnAction in class BaseMonitor
    • checkStatus

      public boolean checkStatus()
      Check the CADIP status (by querying all available sessions)
      Returns:
      true, if the CADIP is reachable and has session data, false otherwise