Klasse BaseMonitor

java.lang.Object
java.lang.Thread
de.dlr.proseo.api.basemon.BaseMonitor
Alle implementierten Schnittstellen:
Runnable

public abstract class BaseMonitor extends Thread
Base class for implementing monitors on pickup points ("interface points" in the ESA Ground Segment Framework architecture). The monitor is intended to run "forever" (i. e. until it is shut down by an interrupt), so it does not terminate on errors during transfer or follow-up actions. It does terminate if it cannot correctly write its transfer history.
Autor:
Dr. Thomas Bassler
  • Konstruktordetails

    • BaseMonitor

      public BaseMonitor()
  • Methodendetails

    • getCheckInterval

      public long getCheckInterval()
      Gets the interval between pickup point checks
      Gibt zurück:
      the checkInterval the interval in milliseconds
    • setCheckInterval

      public void setCheckInterval(long checkInterval)
      Sets the interval between pickup point checks
      Parameter:
      checkInterval - the check interval to set in milliseconds
    • getTransferHistoryFile

      public Path getTransferHistoryFile()
      Gets the file path of the transfer history file
      Gibt zurück:
      the path to the transfer history file
    • setTransferHistoryFile

      public void setTransferHistoryFile(Path transferHistoryFile)
      Gets the file path of the transfer history file
      Parameter:
      transferHistoryFile - the path to the transfer history file to set
    • getTruncateInterval

      public long getTruncateInterval()
      Gets the interval to truncate transfer history file
      Gibt zurück:
      the truncation interval
    • setTruncateInterval

      public void setTruncateInterval(long truncateInterval)
      Sets the interval to truncate transfer history file
      Parameter:
      truncateInterval - the truncation interval to set
    • getHistoryRetentionDuration

      public Duration getHistoryRetentionDuration()
      Gets the period to retain transfer history entries for
      Gibt zurück:
      the history retention duration
    • setHistoryRetentionDuration

      public void setHistoryRetentionDuration(Duration historyRetentionDuration)
      Sets the period to retain transfer history entries for
      Parameter:
      historyRetentionDuration - the history retention duration to set
    • getMaxDownloadThreads

      public int getMaxDownloadThreads()
      Gets the maximum number of parallel download threads
      Gibt zurück:
      the maximum number of download threads
    • setMaxDownloadThreads

      public void setMaxDownloadThreads(int maxDownloadThreads)
      Sets the maximum number of parallel download threads
      Parameter:
      maxDownloadThreads - the maximum number of download threads to set
    • getTaskWaitInterval

      public int getTaskWaitInterval()
      Gets the interval to check for completed subtasks
      Gibt zurück:
      the task wait interval in millliseconds
    • setTaskWaitInterval

      public void setTaskWaitInterval(int taskWaitInterval)
      Sets the interval to check for completed subtasks
      Parameter:
      taskWaitInterval - the task wait interval in millliseconds to set
    • getMaxWaitCycles

      public int getMaxWaitCycles()
      Gets the maximum number of wait cycles for task completion checks
      Gibt zurück:
      the maximum number of wait cycles
    • setMaxWaitCycles

      public void setMaxWaitCycles(int maxWaitCycles)
      Sets the maximum number of wait cycles for task completion checks
      Parameter:
      maxWaitCycles - the maximum number of wait cycles to set
    • checkAvailableDownloads

      protected abstract BaseMonitor.TransferControl checkAvailableDownloads(Instant referenceTimeStamp)
      Check the pickup point for available objects (unfiltered)
      Parameter:
      referenceTimeStamp - the reference timestamp to apply for pickup point lookups
      Gibt zurück:
      a transfer control object containing the latest reference time and a list of available transfer objects
    • transferToTargetDir

      protected abstract boolean transferToTargetDir(TransferObject object)
      Download the given transfer object from the pickup point and copy it to the configured target directory
      Parameter:
      object - the transfer object to download
      Gibt zurück:
      true, if the download was successful, false otherwise
    • triggerFollowOnAction

      protected abstract boolean triggerFollowOnAction(TransferObject object)
      Trigger any necessary follow-on action on the transfer object (processing, order generation etc.)
      Parameter:
      object - the transfer object to start the action on
      Gibt zurück:
      true, if starting the action succeeded (not necessarily the action itself), false otherwise
    • run

      public void run(Integer maxCycles)
      Monitoring loop:
      1. Check data availability on pickup point
      2. Filter objects not yet processed from transfer history
      3. For all objects not yet processed:
        1. Transfer object to local target directory
        2. Record transfer in history
        3. Trigger follow-on action
      Parameter:
      maxCycles - maximum number of loop cycles (if null, run forever)
    • run

      public void run()
      Run forever (as required by Thread superclass, at the same time convenience function for calling run(Integer) with a null argument)
      Angegeben von:
      run in Schnittstelle Runnable
      Setzt außer Kraft:
      run in Klasse Thread