Class ImportEntryManager


  • @ApplicationScoped
    public class ImportEntryManager
    extends Object
    This class is the main manager for performing multi-threaded and parallel import of data from the ImportEntry entity/table. The ImportEntryManager is a singleton/ApplicationScoped class.
    Author:
    mtaal
    • Constructor Detail

      • ImportEntryManager

        public ImportEntryManager()
    • Method Detail

      • isShutDown

        public boolean isShutDown()
      • start

        public void start()
      • getNumberOfQueuedTasks

        public long getNumberOfQueuedTasks()
      • getNumberOfActiveTasks

        public long getNumberOfActiveTasks()
      • isExecutorRunning

        public boolean isExecutorRunning()
      • notifyStartProcessingInCluster

        public void notifyStartProcessingInCluster()
        This method is used to set the cluster service into an state that indicates that it is currently processing import entries. Note that if we are not in a clustered environment, this method has no effect.
      • notifyEndProcessingInCluster

        public void notifyEndProcessingInCluster()
        This method is used to set the cluster service into an state that indicates that it is currently not processing import entries. Note that if we are not in a clustered environment, this method has no effect.
      • shutdown

        public void shutdown()
        Shutdown all the threads being used by the import framework
      • reportStats

        public void reportStats​(String typeOfData,
                                long timeForEntry)
      • notifyNewImportEntryCreated

        public void notifyNewImportEntryCreated()
        Is used to tell the import entry manager that a new entry was created in the import entry table, so it can go process it immediately.
      • setImportEntryProcessed

        public void setImportEntryProcessed​(String importEntryId)
        Set the ImportEntry to status Processed in the same transaction as the caller.
      • setImportEntryError

        public void setImportEntryError​(String importEntryId,
                                        Throwable t)
        Set the ImportEntry to status Error in the same transaction as the caller.
      • isImportEntryError

        public boolean isImportEntryError​(String importEntryId)
        Returns whether the ImportEntry is in status Error in the same transaction as the caller.
      • setImportEntryErrorIndependent

        public void setImportEntryErrorIndependent​(String importEntryId,
                                                   Throwable t)
        Sets an ImportEntry in status Error but does this in its own transaction so not together with the original data. This is relevant when the previous transaction which tried to import the data fails.