Interface ModuleController

  • All Known Implementing Classes:
    ModuleControllerImpl

    public interface ModuleController
    An object of this types contains a PepperModule and handles as a connector between such an object and the Pepper framework.
    Author:
    Florian Zipser
    • Method Detail

      • getId

        String getId()
        Returns the id of this object.
        Returns:
        the stable id
      • getPepperModule

        PepperModule getPepperModule()
        Returns the PepperModule object, this controller object is observing.
        Returns:
        observed object
      • getInputDocumentBus

        DocumentBus getInputDocumentBus()
        The DocumentBus object working as input for this ModuleControllerImpl. All documents on bus will be processed and set to #outputDocumentBus
        Returns:
        bus which is input bus
      • setInputDocumentBus

        void setInputDocumentBus​(DocumentBus inputDocumentBus)
        The DocumentBus object working as input for this ModuleControllerImpl. All documents on bus will be processed and set to #outputDocumentBus
        Parameters:
        inputDocumentBus - bus to be used as input bus
      • getOutputDocumentBus

        DocumentBus getOutputDocumentBus()
        All documents which were consumed by the PepperModule contained in this object are set to this output bus, regarding the status, the PepperModule returned.
        Returns:
        bus, which is output bus
      • setOutputDocumentBus

        void setOutputDocumentBus​(DocumentBus outputDocumentBus)
        All documents which were consumed by the PepperModule contained in this object are set to this output bus, regarding the status, the PepperModule returned.
        Parameters:
        outputDocumentBus - bus to be used as input bus
      • importCorpusStructure

        Future<?> importCorpusStructure​(org.corpus_tools.salt.common.SCorpusGraph sCorpusGraph)
        Starts the import of corpus structure via the set PepperImporter object by calling PepperImporter.importCorpusStructure(SCorpusGraph). The import runs in a separate thread, which is set as child of current thread. Therefore, don#t forget to call method, this method keeps the focus until, the import of the corpus structure has ended. This enables the calling object to wait until the corpus structure was imported. This method can only be invoked once per time.
        Parameters:
        sCorpusGraph - a SCorpusGraph object, in which the PepperImporter shall import the corpus structure.
      • next

        DocumentController next​(boolean ignorePermissionForDocument)
        Returns the next DocumentController waiting in the input document bus to be processed by the contained PepperModule. In contrast to #pop(String), if ignorePermissionForDocument is set to true this method returns a DocumentController object even if the PepperJob permission does not allow to process a further document. This mechanism can be used, if a PepperModule has an own control mechanism of sending SDocuments to sleep.
        Parameters:
        ignorePermissionForDocument - if set, a document will be returned even if the Pepper job gives no permission
        Returns:
        next document controller
      • complete

        void complete​(DocumentController documentController)
        Adds the given DocumentController to the output document bus to be processed by the next PepperModule objects.
        Parameters:
        documentController - to be passed to next Pepper module
      • delete

        void delete​(DocumentController documentController)
        Notifies the Pepper framework, that the SDocument being contained in passed DocumentController shall not be processed any further by following Pepper modules.
        Parameters:
        sElementId - the id corresponding to the SDocument object, which shall be not further processed
      • getProgress

        Double getProgress​(String globalId)
        Returns the progress as a value between 0 and 1 of the contained PepperModule object concerning to the SDocument corresponding to the passed global identifier.
        Parameters:
        globalId - global id for SDocument, note, that this is not the SElementId
        Returns:
        progress of process
      • setPepperModule

        void setPepperModule​(PepperModule newPepperModule)
        Sets the PepperModule object, this controller object is observing. Also sets the inverse method PepperModule#setPepperModuleController_basic(ModuleControllerImpl)
        Parameters:
        newPepperModule - new object to observe
      • setPepperModule_basic

        void setPepperModule_basic​(PepperModule newPepperModule)
        Sets the PepperModule object, this controller object is observing.
        Parameters:
        newPepperModule - new object to observe