MwRevisionProcessorpublic class MwRevisionProcessorBroker extends java.lang.Object implements MwRevisionProcessor
| Constructor | Description |
|---|---|
MwRevisionProcessorBroker() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
finishRevisionProcessing() |
Finalises the processing of one dump file (and hence of the current block
of pages).
|
void |
processRevision(MwRevision mwRevision) |
Process the given MediaWiki revision.
|
void |
registerMwRevisionProcessor(MwRevisionProcessor mwRevisionProcessor,
java.lang.String model,
boolean onlyCurrentRevisions) |
Registers an MwRevisionProcessor, which will henceforth be notified of
all revisions that are encountered in the dump.
|
void |
startRevisionProcessing(java.lang.String siteName,
java.lang.String baseUrl,
java.util.Map<java.lang.Integer,java.lang.String> namespaces) |
Initialises the revision processor for processing revisions.
|
public void registerMwRevisionProcessor(MwRevisionProcessor mwRevisionProcessor, java.lang.String model, boolean onlyCurrentRevisions)
Importantly, the MwRevision that the registered processors will
receive is owned by this MwRevisionProcessorBroker. Its data is
valid only during the execution of
MwRevisionProcessor.processRevision(MwRevision), but it
will not be permanent. If the data is to be retained permanently, the
revision processor needs to make its own copy.
mwRevisionProcessor - the revision processor to registermodel - the content model that the processor is registered for; it
will only be notified of revisions in that model; if null is
given, all revisions will be processed whatever their modelonlyCurrentRevisions - if true, then the subscriber is only notified of the most
current revisions; if false, then it will receive all
revisions, current or notpublic void startRevisionProcessing(java.lang.String siteName,
java.lang.String baseUrl,
java.util.Map<java.lang.Integer,java.lang.String> namespaces)
MwRevisionProcessorstartRevisionProcessing in interface MwRevisionProcessorsiteName - the name of the sitebaseUrl - the base URL of the sitenamespaces - map from integer namespace ids to namespace prefixes;
namespace strings do not include the final ":" used in
MediaWiki to separate namespace prefixes from article titles,
and the prefixes use spaces, not underscores as in MediaWiki
URLs.public void processRevision(MwRevision mwRevision)
MwRevisionProcessorprocessRevision in interface MwRevisionProcessormwRevision - the revision to processpublic void finishRevisionProcessing()
finishRevisionProcessing in interface MwRevisionProcessorCopyright © 2014–2017 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage