Class PersistableDocumentIDRegistry


  • public class PersistableDocumentIDRegistry
    extends DocumentIDRegistry
    Extended implementation of DocumentIDRegistry. Unlike the standard implementation it allows to persist the documentIDs and read them from database if necessary.
    • Constructor Detail

      • PersistableDocumentIDRegistry

        public PersistableDocumentIDRegistry​(java.lang.String processCode)
      • PersistableDocumentIDRegistry

        public PersistableDocumentIDRegistry​(CSVWriter documentIDWriter,
                                             java.lang.String processCode)
      • PersistableDocumentIDRegistry

        public PersistableDocumentIDRegistry​(CSVReader documentIDReader,
                                             java.lang.String processCode)
      • PersistableDocumentIDRegistry

        public PersistableDocumentIDRegistry​(CSVReader documentIDReader,
                                             CSVWriter documentIDWriter,
                                             java.lang.String processCode)
    • Method Detail

      • getID

        protected java.lang.String getID​(java.lang.String qualifier,
                                         long pk,
                                         DocumentIDRegistry.MODE mode)
        Description copied from class: DocumentIDRegistry
        Gets the ID to which the given PK is mapped.
        Overrides:
        getID in class DocumentIDRegistry
        Parameters:
        qualifier - scope in which will be searched
        pk - the PK for which the ID will be returned
        mode - defines the ID storage in which will be searched
        Returns:
        the ID to the given PK or null
      • getPK

        protected long getPK​(java.lang.String qualifier,
                             java.lang.String documentID,
                             DocumentIDRegistry.MODE mode)
        Description copied from class: DocumentIDRegistry
        Gets the PK to which the given ID is mapped. Used while import for resolving an ID to an PK.
        Overrides:
        getPK in class DocumentIDRegistry
        Parameters:
        qualifier - scope of the ID
        documentID - ID for which the PK will be returned
        mode - defines the ID storage in which will be searched
        Returns:
        the PK to the given ID or -1
      • addID

        protected void addID​(java.lang.String qualifier,
                             java.lang.String documentID,
                             long pk,
                             DocumentIDRegistry.MODE mode)
                      throws ImpExException
        Description copied from class: DocumentIDRegistry
        Adds a new mapping ID<->PK to the registry. If the pair is already existent, it will be replaced. T
        Overrides:
        addID in class DocumentIDRegistry
        Parameters:
        qualifier - the qualifier to which the ID is related
        documentID - the new ID
        pk - the PK to which the ID will be mapped
        mode - defines the ID storage where the ID will be added
        Throws:
        ImpExException - the ID already exists and maps to another OK
      • clearAllDocumentIds

        public void clearAllDocumentIds()
      • getQualifiersMap

        protected java.util.Map<java.lang.String,​org.apache.commons.collections4.bidimap.DualHashBidiMap<java.lang.String,​java.lang.Long>> getQualifiersMap​(DocumentIDRegistry.MODE mode)
        Description copied from class: DocumentIDRegistry
        Returns the storage related to the given mode.
        Overrides:
        getQualifiersMap in class DocumentIDRegistry
        Parameters:
        mode - the mode to which the associated storage is needed
        Returns:
        storage associated to given mode