diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestControlPanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestControlPanel.java index aa9201efc7..40bd33f67f 100755 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestControlPanel.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestControlPanel.java @@ -982,7 +982,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer { List completedJobs = new ArrayList<>(); manager.getJobs(pendingJobs, runningJobs, completedJobs); // Sort the completed jobs list by completed date - Collections.sort(completedJobs, new AutoIngestJob.ReverseCompletedDateComparator()); + Collections.sort(completedJobs, new AutoIngestJob.CompletedDateDescendingComparator()); EventQueue.invokeLater(new RefreshComponentsTask(pendingJobs, runningJobs, completedJobs)); } } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java index 213ca60d23..5b6c1da4b2 100755 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboard.java @@ -454,7 +454,8 @@ public final class AutoIngestDashboard extends JPanel implements Observer { List runningJobs = jobsSnapshot.getRunningJobs(); List completedJobs = jobsSnapshot.getCompletedJobs(); pendingJobs.sort(new AutoIngestJob.PriorityComparator()); - completedJobs.sort(new AutoIngestJob.ReverseCompletedDateComparator()); + runningJobs.sort(new AutoIngestJob.DataSourceFileNameComparator()); + completedJobs.sort(new AutoIngestJob.CompletedDateDescendingComparator()); refreshTable(pendingJobs, pendingTable, pendingTableModel); refreshTable(runningJobs, runningTable, runningTableModel); refreshTable(completedJobs, completedTable, completedTableModel); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJob.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJob.java index 74a1cb37e6..b43b00d3fd 100755 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJob.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestJob.java @@ -502,7 +502,7 @@ public final class AutoIngestJob implements Comparable, Serializa * Comparator that supports doing a descending sort of jobs based on job * completion date. */ - static class ReverseCompletedDateComparator implements Comparator { + static class CompletedDateDescendingComparator implements Comparator { @Override public int compare(AutoIngestJob o1, AutoIngestJob o2) { @@ -512,8 +512,7 @@ public final class AutoIngestJob implements Comparable, Serializa } /** - * Comparator that supports doing a descending sort of jobs based on job - * priority. + * Comparator that orders jobs in descending order by job priority. */ public static class PriorityComparator implements Comparator { @@ -525,17 +524,19 @@ public final class AutoIngestJob implements Comparable, Serializa } /** - * Comparator that supports doing an alphabetical sort of jobs based on a - * combination of case name and processing host. + * Comparator that orders jobs such that those running on the local host + * appear first, then the remaining jobs are sorted alphabetically by case + * name. This is very specific to the auto ionghest control panel use case, + * where there is at most one job running on the local host. */ - static class CaseNameAndProcessingHostComparator implements Comparator { + static class LocalHostAndCaseComparator implements Comparator { @Override public int compare(AutoIngestJob aJob, AutoIngestJob anotherJob) { if (aJob.getProcessingHostName().equalsIgnoreCase(LOCAL_HOST_NAME)) { - return -1; // aJob is for this, float to top + return -1; } else if (anotherJob.getProcessingHostName().equalsIgnoreCase(LOCAL_HOST_NAME)) { - return 1; // anotherJob is for this, float to top + return 1; } else { return aJob.getManifest().getCaseName().compareToIgnoreCase(anotherJob.getManifest().getCaseName()); } @@ -543,6 +544,18 @@ public final class AutoIngestJob implements Comparable, Serializa } + /** + * Comparator that orders jobs by data source name. + */ + static class DataSourceFileNameComparator implements Comparator { + + @Override + public int compare(AutoIngestJob aJob, AutoIngestJob anotherJob) { + return aJob.getManifest().getDataSourceFileName().compareToIgnoreCase(anotherJob.getManifest().getDataSourceFileName()); + } + + } + /** * Processing statuses for an auto ingest job. */ diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java index 2cf88cbaa9..bb9e68c610 100755 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java @@ -468,7 +468,7 @@ public final class AutoIngestManager extends Observable implements PropertyChang } for (AutoIngestJob job : hostNamesToRunningJobs.values()) { runningJobs.add(job); - runningJobs.sort(new AutoIngestJob.CaseNameAndProcessingHostComparator()); + runningJobs.sort(new AutoIngestJob.LocalHostAndCaseComparator()); } } if (null != completedJobs) {