Class FallbackMonitor

java.lang.Object
org.gcube.documentstore.persistence.FallbackMonitor
All Implemented Interfaces:
Runnable

public class FallbackMonitor extends Object implements Runnable
This class is used as scheduled thread to check if some records where persisted in fallback file to retry to persist them with the discovered PersistenceBackend
Author:
Luca Frosini (ISTI - CNR)
  • Field Details

  • Constructor Details

    • FallbackMonitor

      public FallbackMonitor(PersistenceBackend persistenceBackend)
      Creates the monitor of the given persistence backend; it elaborates the fallback file only once started (start()).
      Parameters:
      persistenceBackend - the persistence backend whose fallback file is elaborated
    • FallbackMonitor

      @Deprecated public FallbackMonitor(PersistenceBackend persistenceBackend, boolean schedule)
      Creates the monitor and, if requested, starts it.
      Parameters:
      persistenceBackend - the persistence backend whose fallback file is elaborated
      schedule - whether to start the monitor
  • Method Details

    • start

      public void start()
      Schedules the periodic elaboration of the fallback file.
    • elaborateFile

      protected void elaborateFile(File elaborationFile)
    • manageOldAccountingFile

      @Deprecated protected void manageOldAccountingFile()
      Deprecated.
    • elaborateFallbackFile

      protected void elaborateFallbackFile(File elaborationFile)
    • elaborateFallbackFile

      protected void elaborateFallbackFile()
    • run

      public void run()
      Elaborates the fallback file with the library's credentials (LibraryCredentials).
      Specified by:
      run in interface Runnable