Package de.dlr.proseo.api.cadipmon
Class CadipMonitor
java.lang.Object
java.lang.Thread
de.dlr.proseo.api.basemon.BaseMonitor
de.dlr.proseo.api.cadipmon.CadipMonitor
- All Implemented Interfaces:
Runnable
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass describing a single CADU (DSDB) filestatic classClass holding session quality data (available as soon as final CADU file has been written by acquisition station)static classClass describing a download sessionNested classes/interfaces inherited from class de.dlr.proseo.api.basemon.BaseMonitor
BaseMonitor.TransferControlNested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionIndicator for parallel copying processesFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BaseMonitor.TransferControlcheckAvailableDownloads(Instant referenceTimeStamp) Check the configured CADIP for new downlink sessions, whose publication date is after the reference time stamp: Retrieve all downlink sessions with publication time after reference time stamp (authenticating with either Basic Auth or Bearer Token) Convert JSON session entries into transfer objects Return a list of all transfer objectsbooleanCheck the CADIP status (by querying all available sessions)intGets the interval to check for completed file downloadsGets the last copy performance for monitoring purposesintGets the maximum number of parallel file download threads within a download sessionintGets the maximum number of wait cycles for file download completion checksvoidsetFileWaitInterval(int fileWaitInterval) Sets the interval to check for completed file downloads(package private) voidsetLastCopyPerformance(Double copyPerformance) Records the last copy performance for monitoring purposesvoidsetMaxFileDownloadThreads(int maxFileDownloadThreads) Sets the maximum number of parallel file download threads within a download sessionvoidsetMaxFileWaitCycles(int maxFileWaitCycles) Sets the maximum number of wait cycles for file download completion checksprotected booleantransferToTargetDir(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 informationprotected booleantriggerFollowOnAction(TransferObject transferObject) protected booleantriggerParallelAction(CadipMonitor.TransferSession transferSession) Trigger any necessary parallel action on the transfer session (e. g.Methods inherited from class de.dlr.proseo.api.basemon.BaseMonitor
getCheckInterval, getHistoryRetentionDuration, getMaxDownloadThreads, getMaxWaitCycles, getTaskWaitInterval, getTransferHistoryFile, getTruncateInterval, run, run, setCheckInterval, setHistoryRetentionDuration, setMaxDownloadThreads, setMaxWaitCycles, setTaskWaitInterval, setTransferHistoryFile, setTruncateIntervalMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Field Details
-
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
Gets the last copy performance for monitoring purposes- Returns:
- the last copy performance in MiB/s
-
setLastCopyPerformance
Records the last copy performance for monitoring purposes- Parameters:
copyPerformance- the copy performance in MiB/s
-
checkAvailableDownloads
Check the configured CADIP for new downlink sessions, whose publication date is after the reference time stamp:- Retrieve all downlink sessions with publication time after reference time stamp (authenticating with either Basic Auth or Bearer Token)
- Convert JSON session entries into transfer objects
- Return a list of all transfer objects
- Specified by:
checkAvailableDownloadsin classBaseMonitor- Parameters:
referenceTimeStamp- the reference timestamp to apply for pickup point lookups- Returns:
- a transfer control object containing a list of available transfer objects
-
transferToTargetDir
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:
transferToTargetDirin classBaseMonitor
-
triggerParallelAction
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
- Specified by:
triggerFollowOnActionin classBaseMonitor
-
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
-