public class DiffParser extends DumpParser
DumpParser parses a baseline dump of a database and compares it with
the current database state via calls to Dumper#dumpDiff(Record, Record) on an enclosed Dumper.
Records from the baseline will either be added to the dump as changes or marked as seen. The
same Dumper can then be used to generate a full database dump adding and records added since
the baseline.
The dump being compared against must be a newly generated dump from an earlier state of the same database as this code cannot work out the correct id to use if the record has changed and has to use the id from the parse.
conn| Constructor and Description |
|---|
DiffParser(AppContext conn,
Dumper dumper) |
| Modifier and Type | Method and Description |
|---|---|
Dumper |
getDumper() |
protected Repository.IdMode |
getIdMode() |
int |
processRecord(int parse_id,
Repository.Record rec)
handle a
Repository.Record once we have parsed it |
void |
processSpecification(java.lang.String table,
TableSpecification spec)
handle a
TableSpecification once we have parsed it. |
boolean |
skipSpecification(java.lang.String table)
should we skip parsing the following
TableSpecification. |
characters, endDocument, endElement, endPrefixMapping, getPreserveIds, ignorableWhitespace, processingInstruction, setDocumentLocator, setPreserveIds, skippedEntity, skipRecord, startDocument, startElement, startPrefixMappinggetContext, getLogger, resetLoggerpublic DiffParser(AppContext conn, Dumper dumper)
conn - public Dumper getDumper()
public int processRecord(int parse_id,
Repository.Record rec)
throws ConsistencyError,
DataException,
java.io.IOException
DumpParserRepository.Record once we have parsed itprocessRecord in class DumpParserparse_id - int id parsed from file.rec - uncommitted Repository.Record parsed from the fileConsistencyErrorDataExceptionjava.io.IOExceptionpublic void processSpecification(java.lang.String table,
TableSpecification spec)
throws DataFault
DumpParserTableSpecification once we have parsed it.processSpecification in class DumpParserDataFaultpublic boolean skipSpecification(java.lang.String table)
DumpParserTableSpecification.skipSpecification in class DumpParserprotected Repository.IdMode getIdMode()
getIdMode in class DumpParser