Package org.corpus_tools.pepper.modules
Interface ModuleController
-
- All Known Implementing Classes:
ModuleControllerImpl
public interface ModuleControllerAn object of this types contains aPepperModuleand handles as a connector between such an object and the Pepper framework.- Author:
- Florian Zipser
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcomplete(DocumentController documentController)Adds the givenDocumentControllerto the output document bus to be processed by the nextPepperModuleobjects.voiddelete(DocumentController documentController)Notifies the Pepper framework, that theSDocumentbeing contained in passedDocumentControllershall not be processed any further by following Pepper modules.org.corpus_tools.salt.common.SCorpusGraphgetCorpusGraph()Returns theSCorpusGraphobject, the containedPepperImporteris mapping.StringgetId()Returns the id of this object.DocumentBusgetInputDocumentBus()TheDocumentBusobject working as input for thisModuleControllerImpl.PepperJobImplgetJob()Returns thePepperJobImplobject reference of this object.DocumentBusgetOutputDocumentBus()All documents which were consumed by thePepperModulecontained in this object are set to this output bus, regarding the status, thePepperModulereturned.PepperModulegetPepperModule()Returns thePepperModuleobject, this controller object is observing.DoublegetProgress(String globalId)Returns the progress as a value between 0 and 1 of the containedPepperModuleobject concerning to theSDocumentcorresponding to the passed global identifier.Future<?>importCorpusStructure(org.corpus_tools.salt.common.SCorpusGraph sCorpusGraph)Starts the import of corpus structure via the setPepperImporterobject by callingPepperImporter.importCorpusStructure(SCorpusGraph).DocumentControllernext()Returns the nextDocumentControllerwaiting in the input document bus to be processed by the containedPepperModule.DocumentControllernext(boolean ignorePermissionForDocument)Returns the nextDocumentControllerwaiting in the input document bus to be processed by the containedPepperModule.voidsetInputDocumentBus(DocumentBus inputDocumentBus)TheDocumentBusobject working as input for thisModuleControllerImpl.voidsetJob(PepperJobImpl job)Sets thePepperJobImplobject reference of this object.voidsetJob_basic(PepperJobImpl job)Sets thePepperJobImplobject reference of this object.voidsetOutputDocumentBus(DocumentBus outputDocumentBus)All documents which were consumed by thePepperModulecontained in this object are set to this output bus, regarding the status, thePepperModulereturned.voidsetPepperModule(PepperModule newPepperModule)Sets thePepperModuleobject, this controller object is observing.voidsetPepperModule_basic(PepperModule newPepperModule)Sets thePepperModuleobject, this controller object is observing.
-
-
-
Method Detail
-
getId
String getId()
Returns the id of this object.- Returns:
- the stable id
-
getPepperModule
PepperModule getPepperModule()
Returns thePepperModuleobject, this controller object is observing.- Returns:
- observed object
-
getJob
PepperJobImpl getJob()
Returns thePepperJobImplobject reference of this object.- Returns:
- containing
PepperJobImplobject
-
setJob
void setJob(PepperJobImpl job)
Sets thePepperJobImplobject reference of this object. And notifies the reverse methodPepperJobImpl, to set theModuleControllerImplobject to this.- Parameters:
job- newPepperJobImplobject
-
setJob_basic
void setJob_basic(PepperJobImpl job)
Sets thePepperJobImplobject reference of this object.- Parameters:
job- newPepperJobImplobject
-
getInputDocumentBus
DocumentBus getInputDocumentBus()
TheDocumentBusobject working as input for thisModuleControllerImpl. All documents on bus will be processed and set to#outputDocumentBus- Returns:
- bus which is input bus
-
setInputDocumentBus
void setInputDocumentBus(DocumentBus inputDocumentBus)
TheDocumentBusobject working as input for thisModuleControllerImpl. 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 thePepperModulecontained in this object are set to this output bus, regarding the status, thePepperModulereturned.- Returns:
- bus, which is output bus
-
setOutputDocumentBus
void setOutputDocumentBus(DocumentBus outputDocumentBus)
All documents which were consumed by thePepperModulecontained in this object are set to this output bus, regarding the status, thePepperModulereturned.- Parameters:
outputDocumentBus- bus to be used as input bus
-
getCorpusGraph
org.corpus_tools.salt.common.SCorpusGraph getCorpusGraph()
Returns theSCorpusGraphobject, the containedPepperImporteris mapping. This method will only return a non empty object, if the containedPepperModuleis anPepperImporterand ifimportCorpusStructure(SCorpusGraph)was called.- Returns:
-
importCorpusStructure
Future<?> importCorpusStructure(org.corpus_tools.salt.common.SCorpusGraph sCorpusGraph)
Starts the import of corpus structure via the setPepperImporterobject by callingPepperImporter.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- aSCorpusGraphobject, in which thePepperImportershall import the corpus structure.
-
next
DocumentController next(boolean ignorePermissionForDocument)
Returns the nextDocumentControllerwaiting in the input document bus to be processed by the containedPepperModule. In contrast to#pop(String), ifignorePermissionForDocumentis set to true this method returns aDocumentControllerobject even if thePepperJobpermission does not allow to process a further document. This mechanism can be used, if aPepperModulehas an own control mechanism of sendingSDocuments to sleep.- Parameters:
ignorePermissionForDocument- if set, a document will be returned even if the Pepper job gives no permission- Returns:
- next document controller
-
next
DocumentController next()
Returns the nextDocumentControllerwaiting in the input document bus to be processed by the containedPepperModule.- Returns:
- next document controller
-
complete
void complete(DocumentController documentController)
Adds the givenDocumentControllerto the output document bus to be processed by the nextPepperModuleobjects.- Parameters:
documentController- to be passed to next Pepper module
-
delete
void delete(DocumentController documentController)
Notifies the Pepper framework, that theSDocumentbeing contained in passedDocumentControllershall not be processed any further by following Pepper modules.- Parameters:
sElementId- the id corresponding to theSDocumentobject, which shall be not further processed
-
getProgress
Double getProgress(String globalId)
Returns the progress as a value between 0 and 1 of the containedPepperModuleobject concerning to theSDocumentcorresponding to the passed global identifier.- Parameters:
globalId- global id forSDocument, note, that this is not theSElementId- Returns:
- progress of process
-
setPepperModule
void setPepperModule(PepperModule newPepperModule)
Sets thePepperModuleobject, this controller object is observing. Also sets the inverse methodPepperModule#setPepperModuleController_basic(ModuleControllerImpl)- Parameters:
newPepperModule- new object to observe
-
setPepperModule_basic
void setPepperModule_basic(PepperModule newPepperModule)
Sets thePepperModuleobject, this controller object is observing.- Parameters:
newPepperModule- new object to observe
-
-