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