Misc polishing for case node data fixes

This commit is contained in:
Richard Cordovano 2019-04-07 20:56:55 -04:00
parent 51d50e5c2b
commit 720cb155ac

View File

@ -178,24 +178,26 @@ public final class CaseNodeData {
* @throws CaseMetadataException If the case metadata cannot be read.
*/
private static CaseNodeData upgradeCaseNodeData(String nodePath, CaseNodeData oldNodeData) throws CaseNodeDataException, CaseMetadataException, ParseException, IOException, CoordinationServiceException, InterruptedException {
final CaseMetadata metadata = getCaseMetadata(nodePath);
CaseNodeData nodeData;
switch (oldNodeData.getVersion()) {
case 0:
/*
* Version 0 node data consisted of only the version number and the
* errors occurred flag and was only written when an auto ingest job
* error occurred. To upgrade from version 0, the version 1 fields
* need to be set from the case metadata and the errors occurred
* flag needs to be carried forward. Note that the last accessed
* date gets advanced to now, since it is otherwise unknown.
* Version 0 node data consisted of only the version number and
* the errors occurred flag and was only written when an auto
* ingest job error occurred. To upgrade from version 0, the
* version 1 fields need to be set from the case metadata and
* the errors occurred flag needs to be carried forward. Note
* that the last accessed date gets advanced to now, since it is
* otherwise unknown.
*/
final CaseMetadata metadata = getCaseMetadata(nodePath);
nodeData = new CaseNodeData(metadata);
nodeData.setErrorsOccurred(oldNodeData.getErrorsOccurred());
break;
case 1:
/*
* Version 1 node data did not have a minor version number field.
* Version 1 node data did not have a minor version number
* field.
*/
oldNodeData.setMinorVersion(MINOR_VERSION);
nodeData = oldNodeData;