NPE bug fix.

This commit is contained in:
U-BASIS\dgrove 2017-09-18 00:52:17 -04:00
parent 4fbe9b26a9
commit 3eed4fb759
3 changed files with 7 additions and 16 deletions

View File

@ -213,6 +213,7 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
pendingTable.removeColumn(pendingTable.getColumn(JobsTableModelColumns.CASE_DIRECTORY_PATH.getColumnHeader())); pendingTable.removeColumn(pendingTable.getColumn(JobsTableModelColumns.CASE_DIRECTORY_PATH.getColumnHeader()));
pendingTable.removeColumn(pendingTable.getColumn(JobsTableModelColumns.STATUS.getColumnHeader())); pendingTable.removeColumn(pendingTable.getColumn(JobsTableModelColumns.STATUS.getColumnHeader()));
pendingTable.removeColumn(pendingTable.getColumn(JobsTableModelColumns.MANIFEST_FILE_PATH.getColumnHeader())); pendingTable.removeColumn(pendingTable.getColumn(JobsTableModelColumns.MANIFEST_FILE_PATH.getColumnHeader()));
pendingTable.removeColumn(pendingTable.getColumn(JobsTableModelColumns.JOB.getColumnHeader()));
/* /*
* Set up a column to display the cases associated with the jobs. * Set up a column to display the cases associated with the jobs.
@ -275,6 +276,7 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.STATUS.getColumnHeader())); runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.STATUS.getColumnHeader()));
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.CASE_DIRECTORY_PATH.getColumnHeader())); runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.CASE_DIRECTORY_PATH.getColumnHeader()));
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.MANIFEST_FILE_PATH.getColumnHeader())); runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.MANIFEST_FILE_PATH.getColumnHeader()));
runningTable.removeColumn(runningTable.getColumn(JobsTableModelColumns.JOB.getColumnHeader()));
/* /*
* Set up a column to display the cases associated with the jobs. * Set up a column to display the cases associated with the jobs.
@ -348,6 +350,7 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.HOST_NAME.getColumnHeader())); completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.HOST_NAME.getColumnHeader()));
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.CASE_DIRECTORY_PATH.getColumnHeader())); completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.CASE_DIRECTORY_PATH.getColumnHeader()));
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.MANIFEST_FILE_PATH.getColumnHeader())); completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.MANIFEST_FILE_PATH.getColumnHeader()));
completedTable.removeColumn(completedTable.getColumn(JobsTableModelColumns.JOB.getColumnHeader()));
/* /*
* Set up a column to display the cases associated with the jobs. * Set up a column to display the cases associated with the jobs.
@ -477,7 +480,6 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
job.getCaseDirectoryPath(), // CASE_DIRECTORY_PATH job.getCaseDirectoryPath(), // CASE_DIRECTORY_PATH
job.getManifest().getFilePath(), // MANIFEST_FILE_PATH job.getManifest().getFilePath(), // MANIFEST_FILE_PATH
job job
//DLG: Put job object in the table
}); });
} }
setSelectedEntry(table, tableModel, currentRow); setSelectedEntry(table, tableModel, currentRow);
@ -554,7 +556,7 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
STATUS(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.Status")), STATUS(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.Status")),
CASE_DIRECTORY_PATH(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.CaseFolder")), CASE_DIRECTORY_PATH(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.CaseFolder")),
MANIFEST_FILE_PATH(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.ManifestFilePath")), MANIFEST_FILE_PATH(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.JobsTableModel.ColumnHeader.ManifestFilePath")),
JOB(""); // DLG: JOB("");
private final String header; private final String header;
@ -566,15 +568,6 @@ public final class AutoIngestDashboard extends JPanel implements Observer {
return header; return header;
} }
/*
* DLG: We need to add the AutoIngestJob object for the row to the
* table. As a model you can look in AutoIngestControlPanel to see how a
* boolean is stored in a hidden IS_LOCAL_JOB column and do something
* similar for the job. Once youy hjave done that, you can change the
* button event handler for the Prioritize button to make it pass the
* AutoIngestJob to the AutoIngestMonitor instead of the manifest file
* path.
*/
private static final String[] headers = { private static final String[] headers = {
CASE.getColumnHeader(), CASE.getColumnHeader(),
DATA_SOURCE.getColumnHeader(), DATA_SOURCE.getColumnHeader(),

View File

@ -332,14 +332,14 @@ final class AutoIngestJobNodeData {
/** /**
* Gets the path to the case directory of the case associated with the job. * Gets the path to the case directory of the case associated with the job.
* *
* @return The case directory path or null if the case directory has not * @return The case directory path or an empty string path if the case
* been created yet. * directory has not been created yet.
*/ */
synchronized Path getCaseDirectoryPath() { synchronized Path getCaseDirectoryPath() {
if (!caseDirectoryPath.isEmpty()) { if (!caseDirectoryPath.isEmpty()) {
return Paths.get(caseDirectoryPath); return Paths.get(caseDirectoryPath);
} else { } else {
return null; return Paths.get("");
} }
} }

View File

@ -277,7 +277,6 @@ public final class AutoIngestMonitor extends Observable implements PropertyChang
* *
* @param job The job to be prioritized. * @param job The job to be prioritized.
*/ */
// DLG: New method!!
JobsSnapshot prioritizeJob(AutoIngestJob job) throws AutoIngestMonitorException { JobsSnapshot prioritizeJob(AutoIngestJob job) throws AutoIngestMonitorException {
int highestPriority = 0; int highestPriority = 0;
@ -315,7 +314,6 @@ public final class AutoIngestMonitor extends Observable implements PropertyChang
eventPublisher.publishRemotely(new AutoIngestCasePrioritizedEvent(LOCAL_HOST_NAME, caseName)); eventPublisher.publishRemotely(new AutoIngestCasePrioritizedEvent(LOCAL_HOST_NAME, caseName));
}).start(); }).start();
jobsSnapshot.addOrReplacePendingJob(job); //DLG: Is this needed?
return jobsSnapshot; return jobsSnapshot;
} }
} }