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, startPrefixMapping
getContext, getLogger, resetLogger
public DiffParser(AppContext conn, Dumper dumper)
conn
- public Dumper getDumper()
public int processRecord(int parse_id, Repository.Record rec) throws ConsistencyError, DataException, java.io.IOException
DumpParser
Repository.Record
once we have parsed itprocessRecord
in class DumpParser
parse_id
- int id parsed from file.rec
- uncommitted Repository.Record
parsed from the fileConsistencyError
DataException
java.io.IOException
public void processSpecification(java.lang.String table, TableSpecification spec) throws DataFault
DumpParser
TableSpecification
once we have parsed it.processSpecification
in class DumpParser
DataFault
public boolean skipSpecification(java.lang.String table)
DumpParser
TableSpecification
.skipSpecification
in class DumpParser
protected Repository.IdMode getIdMode()
getIdMode
in class DumpParser