public class MwRevisionProcessorBroker extends Object implements MwRevisionProcessor
Constructor and Description |
---|
MwRevisionProcessorBroker() |
Modifier and Type | Method and 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,
String model,
boolean onlyCurrentRevisions)
Registers an MwRevisionProcessor, which will henceforth be notified of
all revisions that are encountered in the dump.
|
void |
startRevisionProcessing(String siteName,
String baseUrl,
Map<Integer,String> namespaces)
Initialises the revision processor for processing revisions.
|
public void registerMwRevisionProcessor(MwRevisionProcessor mwRevisionProcessor, 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(String siteName, String baseUrl, Map<Integer,String> namespaces)
MwRevisionProcessor
startRevisionProcessing
in interface MwRevisionProcessor
siteName
- 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)
MwRevisionProcessor
processRevision
in interface MwRevisionProcessor
mwRevision
- the revision to processpublic void finishRevisionProcessing()
finishRevisionProcessing
in interface MwRevisionProcessor
Copyright © 2014–2024 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage