Class ImportEntryProcessor

    • Constructor Detail

      • ImportEntryProcessor

        public ImportEntryProcessor()
    • Method Detail

      • handleImportEntry

        public void 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.
      • assignEntryToThread

        protected void assignEntryToThread​(String key,
                                           ImportEntry importEntry)
      • 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