Class ImportEntryProcessor

    • Constructor Detail

      • ImportEntryProcessor

        public ImportEntryProcessor()
    • Method Detail

      • handleImportEntry

        public boolean handleImportEntry​(ImportEntry importEntry)
        Is called from the ImportEntryManager thread, passes in a new ImportEntry to process. Finds the Thread which can handle this entry, if none is found a new thread is created, if one is found then the ImportEntry is passed/given to it. If the processing of the entry does not happen fast enough then it can be that the ImportEntry is again offered to the ImportEntryProcessor through a call to this method. The implementation should be able to gracefully handle duplicate entries. Also the implementation should check if the ImportEntry was possibly already handled and ignore it then.
        whether the importEntry has been assigned to a thread for it to be processed
      • assignEntryToThread

        protected boolean assignEntryToThread​(String key,
                                              ImportEntry importEntry)
        Assigns an import entry to a processing thread besed on its type and key.
        whether the import entry could be assigned to a thread
      • canHandleImportEntry

        protected abstract boolean canHandleImportEntry​(ImportEntry importEntryInformation)
        Can be used by implementing subclass to check that the ImportEntry can be processed now. In some cases other ImportEntries should be processed first. By returning false the ImportEntry is ignored for now. It will again be picked up in a next execution cycle of the ImportEntryManager thread and then offered again to this ImportEntryProcessor to be processed.
      • getProcessSelectionKey

        protected abstract String getProcessSelectionKey​(ImportEntry importEntry)
        Based on the ImportEntry returns a key which uniquely identifies the thread which should process this ImportEntry. Can be used to place import entries which block/use the same records in the same import thread, in this way preventing DB (dead)locks.
      • enableArchive

        protected boolean enableArchive()
        Declares if the import entry will later on be archived after it has been processed
      • isNonBlocking

        protected boolean isNonBlocking()
        Indicates if the import entry processor has a runnable that is to be executed in a non-blocking way
        true if it is non-blocking, false otherwise