diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties index 8a66bb8764..e756c0b2ad 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties @@ -255,3 +255,4 @@ AinStatusDashboard.nodeStatusTableTitle.text=Auto Ingest Nodes AinStatusDashboard.healthMonitorButton.text=Health Monitor CasesDashboardTopComponent.refreshButton.text=Refresh AutoIngestCasesDeletionDialog.jLabel1.text=Progress +CasesDashboardTopComponent.cleanCaseNodesButton.text=Clean Case Znodes diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties-MERGED b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties-MERGED index cc7704604a..4a186b26f2 100755 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties-MERGED +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties-MERGED @@ -89,10 +89,6 @@ AutoIngestControlPanel.runningTable.toolTipText=The Running table displays the c AutoIngestControlPanel.SharedConfigurationDisabled=Shared configuration disabled AutoIngestControlPanel.ShowLogFailed.Message=Case log file does not exist AutoIngestControlPanel.ShowLogFailed.Title=Unable to display case log -# {0} - case db status -# {1} - search svc Status -# {2} - coord svc Status -# {3} - msg broker status AutoIngestControlPanel.tbServicesStatusMessage.Message=Case databases {0}, keyword search {1}, coordination {2}, messaging {3} AutoIngestControlPanel.tbServicesStatusMessage.Message.Down=down AutoIngestControlPanel.tbServicesStatusMessage.Message.Unknown=unknown @@ -138,6 +134,7 @@ AutoIngestJobsNode.status.text=Status AutoIngestJobsPanel.waitNode.text=Please Wait... AutoIngestMetricsDialog.initReportText=Select a date above and click the 'Generate Metrics Report' button to generate\na metrics report. AutoIngestMetricsDialog.title.text=Auto Ingest Metrics +CaseNodesCleanupAction.progressDisplayName=Cleanup Case Znodes ConfirmationDialog.DoNotDelete=Do not delete ConfirmationDialog.Delete=Permanently delete ConfirmationDialog.DeleteAreYouSure=The entire case will be removed. Are you sure you want to delete case @@ -186,24 +183,17 @@ DeleteCaseTask.progress.acquiringManifestLocks=Acquiring exclusive manifest file DeleteCaseTask.progress.connectingToCoordSvc=Connecting to the coordination service... DeleteCaseTask.progress.deletingCaseDirCoordSvcNode=Deleting case directory znode... DeleteCaseTask.progress.deletingCaseNameCoordSvcNode=Deleting case name znode... -# {0} - data source path DeleteCaseTask.progress.deletingDataSource=Deleting data source {0}... DeleteCaseTask.progress.deletingJobLogLockNode=Deleting case auto ingest log znode... -# {0} - manifest file path DeleteCaseTask.progress.deletingManifest=Deleting manifest file {0}... -# {0} - manifest file path DeleteCaseTask.progress.deletingManifestFileNode=Deleting the manifest file znode for {0}... DeleteCaseTask.progress.deletingResourcesLockNode=Deleting case resources znode... DeleteCaseTask.progress.gettingManifestPaths=Getting manifest file paths... -# {0} - manifest file path DeleteCaseTask.progress.lockingManifest=Locking manifest file {0}... -# {0} - manifest file path DeleteCaseTask.progress.Manifest=Deleting manifest file {0}... DeleteCaseTask.progress.openingCaseDatabase=Opening the case database... DeleteCaseTask.progress.openingCaseMetadataFile=Opening case metadata file... -# {0} - manifest file path DeleteCaseTask.progress.parsingManifest=Parsing manifest file {0}... -# {0} - manifest file path DeleteCaseTask.progress.releasingManifestLock=Releasing lock on the manifest file {0}... DeleteCaseTask.progress.startMessage=Starting deletion... HINT_CasesDashboardTopComponent=This is an adminstrative dashboard for multi-user cases @@ -441,3 +431,4 @@ AinStatusDashboard.nodeStatusTableTitle.text=Auto Ingest Nodes AinStatusDashboard.healthMonitorButton.text=Health Monitor CasesDashboardTopComponent.refreshButton.text=Refresh AutoIngestCasesDeletionDialog.jLabel1.text=Progress +CasesDashboardTopComponent.cleanCaseNodesButton.text=Clean Case Znodes diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/CasesDashboardTopComponent.form b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/CasesDashboardTopComponent.form index 8625b7f645..dd74bacc5c 100755 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/CasesDashboardTopComponent.form +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/CasesDashboardTopComponent.form @@ -21,7 +21,9 @@ - + + + @@ -37,7 +39,10 @@ - + + + + @@ -58,5 +63,15 @@ + + + + + + + + + + diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/CasesDashboardTopComponent.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/CasesDashboardTopComponent.java index ec2d1c0c17..5986593f88 100755 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/CasesDashboardTopComponent.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/CasesDashboardTopComponent.java @@ -119,6 +119,7 @@ public final class CasesDashboardTopComponent extends TopComponent implements Ex refreshButton = new javax.swing.JButton(); caseBrowserScrollPane = new javax.swing.JScrollPane(); + cleanCaseNodesButton = new javax.swing.JButton(); org.openide.awt.Mnemonics.setLocalizedText(refreshButton, org.openide.util.NbBundle.getMessage(CasesDashboardTopComponent.class, "CasesDashboardTopComponent.refreshButton.text")); // NOI18N refreshButton.addActionListener(new java.awt.event.ActionListener() { @@ -127,6 +128,13 @@ public final class CasesDashboardTopComponent extends TopComponent implements Ex } }); + org.openide.awt.Mnemonics.setLocalizedText(cleanCaseNodesButton, org.openide.util.NbBundle.getMessage(CasesDashboardTopComponent.class, "CasesDashboardTopComponent.cleanCaseNodesButton.text")); // NOI18N + cleanCaseNodesButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cleanCaseNodesButtonActionPerformed(evt); + } + }); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -136,7 +144,9 @@ public final class CasesDashboardTopComponent extends TopComponent implements Ex .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(refreshButton) - .addGap(0, 458, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(cleanCaseNodesButton) + .addGap(0, 313, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(caseBrowserScrollPane) .addContainerGap()))) @@ -147,7 +157,9 @@ public final class CasesDashboardTopComponent extends TopComponent implements Ex .addContainerGap() .addComponent(caseBrowserScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(refreshButton) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(refreshButton) + .addComponent(cleanCaseNodesButton)) .addContainerGap()) ); }// //GEN-END:initComponents @@ -156,8 +168,13 @@ public final class CasesDashboardTopComponent extends TopComponent implements Ex caseBrowserPanel.displayCases(); }//GEN-LAST:event_refreshButtonActionPerformed + private void cleanCaseNodesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cleanCaseNodesButtonActionPerformed + new CaseNodesCleanupAction().actionPerformed(evt); + }//GEN-LAST:event_cleanCaseNodesButtonActionPerformed + // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JScrollPane caseBrowserScrollPane; + private javax.swing.JButton cleanCaseNodesButton; private javax.swing.JButton refreshButton; // End of variables declaration//GEN-END:variables diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/DeleteCaseTask.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/DeleteCaseTask.java index c585dbd2bb..3f197b1975 100755 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/DeleteCaseTask.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/DeleteCaseTask.java @@ -62,7 +62,6 @@ final class DeleteCaseTask implements Runnable { private static final int MANIFEST_FILE_LOCKING_TIMEOUT_MINS = 5; private static final int MANIFEST_DELETE_TRIES = 3; - private static final String NO_NODE_ERROR_MSG_FRAGMENT = "KeeperErrorCode = NoNode"; private static final Logger logger = AutoIngestDashboardLogger.getLogger(); private final CaseNodeData caseNodeData; private final DeleteOptions deleteOption; @@ -688,7 +687,7 @@ final class DeleteCaseTask implements Runnable { try { coordinationService.deleteNode(CategoryNode.CASES, resourcesNodePath); } catch (CoordinationServiceException ex) { - if (!isNoNodeException(ex)) { + if (!DeleteCaseUtils.isNoNodeException(ex)) { logger.log(Level.SEVERE, String.format("Error deleting case resources znode for %s", caseNodeData.getDisplayName()), ex); } } @@ -710,7 +709,7 @@ final class DeleteCaseTask implements Runnable { try { coordinationService.deleteNode(CategoryNode.CASES, logFilePath); } catch (CoordinationServiceException ex) { - if (!isNoNodeException(ex)) { + if (!DeleteCaseUtils.isNoNodeException(ex)) { logger.log(Level.SEVERE, String.format("Error deleting case auto ingest job log znode for %s", caseNodeData.getDisplayName()), ex); } } @@ -767,24 +766,6 @@ final class DeleteCaseTask implements Runnable { } } - /** - * Examines a coordination service exception to try to determine if it is a - * no node exception. - * - * @param ex A coordination service exception. - * - * @return True or false. - */ - private boolean isNoNodeException(CoordinationServiceException ex) { - boolean isNodeNodeEx = false; - Throwable cause = ex.getCause(); - if (cause != null) { - String causeMessage = cause.getMessage(); - isNodeNodeEx = causeMessage.contains(NO_NODE_ERROR_MSG_FRAGMENT); - } - return isNodeNodeEx; - } - /** * Releases all of the manifest file locks that have been acquired by this * task.