From fd532e68b87f248cbdaefde869ffdf7a0c9bc014 Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Tue, 12 May 2015 11:35:57 -0400 Subject: [PATCH 1/5] lower consistency --- .../org/sleuthkit/autopsy/timeline/events/db/EventDB.java | 6 +++--- .../autopsy/imagegallery/ImageGalleryController.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/timeline/events/db/EventDB.java b/Core/src/org/sleuthkit/autopsy/timeline/events/db/EventDB.java index 2282451ac7..8687db0a31 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/events/db/EventDB.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/events/db/EventDB.java @@ -202,9 +202,9 @@ public class EventDB { return "1"; } String strip = StringUtils.strip(filter.getText()); - return "((" + MED_DESCRIPTION_COLUMN + " LIKE '%" + strip + "%') OR (" // NON-NLS - + FULL_DESCRIPTION_COLUMN + " LIKE '%" + strip + "%') OR (" // NON-NLS - + SHORT_DESCRIPTION_COLUMN + " LIKE '%" + strip + "%'))"; // NON-NLS + return "((LOWER(" + MED_DESCRIPTION_COLUMN + ") LIKE LOWER('%" + strip + "%')) OR (LOWER(" // NON-NLS + + FULL_DESCRIPTION_COLUMN + ") LIKE LOWER('%" + strip + "%')) OR (LOWER(" // NON-NLS + + SHORT_DESCRIPTION_COLUMN + ") LIKE LOWER('%" + strip + "%'))"; // NON-NLS } else { return "1"; } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index 02061d5755..3701e1b228 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -677,7 +677,7 @@ public final class ImageGalleryController { */ class CopyAnalyzedFiles extends InnerTask { - final private String DRAWABLE_QUERY = "LOWER(name) LIKE '%." + StringUtils.join(ImageGalleryModule.getAllSupportedExtensions(), "' or LOWER(name) LIKE '%.") + "'"; + final private String DRAWABLE_QUERY = "LOWER(name) LIKE LOWER('%." + StringUtils.join(ImageGalleryModule.getAllSupportedExtensions(), "') or LOWER(name) LIKE LOWER('%.") + "')"; private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("populating analyzed image/video database"); @@ -779,7 +779,7 @@ public final class ImageGalleryController { * check for supported images */ // (name like '.jpg' or name like '.png' ...) - private final String DRAWABLE_QUERY = "(LOWER(name) LIKE LOWER('%." + StringUtils.join(ImageGalleryModule.getAllSupportedExtensions(), "') or LOWER(name) LIKE '%.") + "') "; + private final String DRAWABLE_QUERY = "(LOWER(name) LIKE LOWER('%." + StringUtils.join(ImageGalleryModule.getAllSupportedExtensions(), "') or LOWER(name) LIKE LOWER('%.") + "')) "; private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("prepopulating image/video database"); From 8bd43eadc719e29a7fa42b1e9541e40bedd32e5f Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Tue, 12 May 2015 11:43:17 -0400 Subject: [PATCH 2/5] even lower consistency --- Core/src/org/sleuthkit/autopsy/timeline/events/db/EventDB.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/timeline/events/db/EventDB.java b/Core/src/org/sleuthkit/autopsy/timeline/events/db/EventDB.java index 8687db0a31..f5c20036a2 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/events/db/EventDB.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/events/db/EventDB.java @@ -204,7 +204,7 @@ public class EventDB { String strip = StringUtils.strip(filter.getText()); return "((LOWER(" + MED_DESCRIPTION_COLUMN + ") LIKE LOWER('%" + strip + "%')) OR (LOWER(" // NON-NLS + FULL_DESCRIPTION_COLUMN + ") LIKE LOWER('%" + strip + "%')) OR (LOWER(" // NON-NLS - + SHORT_DESCRIPTION_COLUMN + ") LIKE LOWER('%" + strip + "%'))"; // NON-NLS + + SHORT_DESCRIPTION_COLUMN + ") LIKE LOWER('%" + strip + "%')))"; // NON-NLS } else { return "1"; } From 947e7abf91d275eddb392b52df975d56f1528e68 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Tue, 12 May 2015 13:38:14 -0400 Subject: [PATCH 3/5] Disable inactivity monitor for ActiveMQ connections --- .../sleuthkit/autopsy/events/MessageServiceConnectionInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/events/MessageServiceConnectionInfo.java b/Core/src/org/sleuthkit/autopsy/events/MessageServiceConnectionInfo.java index 517a469344..ade963447e 100644 --- a/Core/src/org/sleuthkit/autopsy/events/MessageServiceConnectionInfo.java +++ b/Core/src/org/sleuthkit/autopsy/events/MessageServiceConnectionInfo.java @@ -28,7 +28,7 @@ import javax.annotation.concurrent.Immutable; @Immutable public final class MessageServiceConnectionInfo { - private static final String MESSAGE_SERVICE_URI = "tcp://%s:%s"; + private static final String MESSAGE_SERVICE_URI = "tcp://%s:%s?wireFormat.maxInactivityDuration=0"; private final String userName; private final String password; private final String host; From d74f8606d1f87885c14d1859914f2ebe3ba23792 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Tue, 12 May 2015 15:28:21 -0400 Subject: [PATCH 4/5] Use unique case name for remote event channels --- .../autopsy/casemodule/Bundle.properties | 3 +- .../sleuthkit/autopsy/casemodule/Case.java | 19 ++++++++--- .../autopsy/ingest/Bundle.properties | 3 +- .../autopsy/ingest/IngestManager.java | 34 ++++++++----------- 4 files changed, 33 insertions(+), 26 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 906c3c2f4f..b200f207fc 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -134,7 +134,8 @@ Case.createCaseDir.exception.cantCreate=Cannot create case dir\: {0} Case.createCaseDir.exception.cantCreateCaseDir=Could not create case directory\: {0} Case.createCaseDir.exception.cantCreateModDir=Could not create modules output directory\: {0} Case.createCaseDir.exception.gen=Could not create case directory\: {0} -Case.OpenEventChannel.ErrMsg=Case opening process failed to connect to nodes collaborating on case {0}. +Case.OpenEventChannel.FailPopup.ErrMsg=Failed to connect to any other nodes that may be collaborating on this case. +Case.OpenEventChannel.FailPopup.Title=Connection Failure CaseDeleteAction.closeConfMsg.text=Are you sure want to close and delete this case? \n\ Case Name\: {0}\n\ Case Directory\: {1} diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 4a61b1ae5f..33dc4f6f08 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -70,6 +70,7 @@ import org.sleuthkit.datamodel.SleuthkitJNI.CaseDbHandle.AddImageProcess; public class Case implements SleuthkitCase.ErrorObserver { private static final String autopsyVer = Version.getVersion(); // current version of autopsy. Change it when the version is changed + private static final String EVENT_CHANNEL_NAME = "%s-Case-Events"; private static String appName = null; /** @@ -265,12 +266,22 @@ public class Case implements SleuthkitCase.ErrorObserver { RecentCases.getInstance().addRecentCase(currentCase.name, currentCase.configFilePath); // update the recent cases if (CaseType.MULTI_USER_CASE == newCase.getCaseType()) { try { - eventPublisher.openRemoteEventChannel(newCase.getName()); + /** + * Use the text index name as the remote event channel name + * prefix since it is unique, the same as the case database + * name for a multiuser case, and is readily available + * through getTextIndexName() API. + */ + eventPublisher.openRemoteEventChannel(String.format(EVENT_CHANNEL_NAME, newCase.getTextIndexName())); } catch (AutopsyEventException ex) { logger.log(Level.SEVERE, "Failed to start remote event publisher", ex); - MessageNotifyUtil.Message.error(NbBundle.getMessage(Case.class, - "Case.OpenEventChannel.ErrMsg", - newCase.getName())); + /** + * MessageNotifyUtil.Message.warn() does not work here, + * don't know why. + */ + JOptionPane.showMessageDialog(null, NbBundle.getMessage(Case.class, "Case.OpenEventChannel.FailPopup.ErrMsg"), + NbBundle.getMessage(Case.class, "Case.OpenEventChannel.FailPopup.Title"), + JOptionPane.WARNING_MESSAGE); } } eventPublisher.publishLocally(new AutopsyEvent(Events.CURRENT_CASE.toString(), null, currentCase)); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties index 29ae3ff490..258ae0fbda 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/ingest/Bundle.properties @@ -58,7 +58,8 @@ IngestManager.StartIngestJobsTask.run.startupErr.dlgMsg=Unable to start up one o IngestManager.StartIngestJobsTask.run.startupErr.dlgSolution=Please disable the failed modules or fix the errors and then restart ingest \nby right clicking on the data source and selecting Run Ingest Modules. IngestManager.StartIngestJobsTask.run.startupErr.dlgErrorList=\nErrors\: \n{0} IngestManager.StartIngestJobsTask.run.startupErr.dlgTitle=Ingest Failure -IngestManager.OpenEventChannel.ErrMsg=Analysis process failed to connect to nodes collaborating on case {0}. +IngestManager.OpenEventChannel.FailPopup.ErrMsg=Analysis process failed to connect to any other nodes that may be collaborating on case. +IngestManager.OpenEventChannel.FailPopup.Title=Connection Failure IngestJobSettings.createModuleSettingsFolder.warning=Failed to create ingest module settings folder, cannot save settings. IngestJobSettings.missingModule.warning=Previously loaded {0} module could not be found. IngestJobSettings.save.warning=Failed to save ingest job settings for {0} module. diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index fe91a1dbd8..cab78cdc25 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -47,7 +47,6 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.events.AutopsyEvent; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.events.AutopsyEventException; import org.sleuthkit.autopsy.events.AutopsyEventPublisher; import org.sleuthkit.autopsy.ingest.events.BlackboardPostEvent; @@ -298,28 +297,23 @@ public class IngestManager { this.jobCreationIsEnabled = true; clearIngestMessageBox(); try { + /** + * Use the text index name as the remote event channel name prefix + * since it is unique, the same as the case database name for a + * multiuser case, and is readily available through + * getTextIndexName() API. + */ Case openedCase = Case.getCurrentCase(); - String caseName = openedCase.getName(); + String channelPrefix = openedCase.getTextIndexName(); if (Case.CaseType.MULTI_USER_CASE == openedCase.getCaseType()) { - try { - jobEventPublisher.openRemoteEventChannel(String.format(JOB_EVENT_CHANNEL_NAME, caseName)); - } catch (AutopsyEventException ex) { - logger.log(Level.SEVERE, "Failed to open remote job events channel", ex); //NON-NLS - MessageNotifyUtil.Message.error(NbBundle.getMessage(IngestManager.class, - "IngestManager.OpenEventChannel.ErrMsg", - caseName)); - } - try { - moduleEventPublisher.openRemoteEventChannel(String.format(MODULE_EVENT_CHANNEL_NAME, caseName)); - } catch (AutopsyEventException ex) { - logger.log(Level.SEVERE, "Failed to open remote module events channel", ex); //NON-NLS - MessageNotifyUtil.Message.error(NbBundle.getMessage(IngestManager.class, - "IngestManager.OpenEventChannel.ErrMsg", - caseName)); - } + jobEventPublisher.openRemoteEventChannel(String.format(JOB_EVENT_CHANNEL_NAME, channelPrefix)); + moduleEventPublisher.openRemoteEventChannel(String.format(MODULE_EVENT_CHANNEL_NAME, channelPrefix)); } - } catch (IllegalStateException ex) { - logger.log(Level.SEVERE, "Could not get current case, failed to open remote event channels", ex); //NON-NLS + } catch (IllegalStateException | AutopsyEventException ex) { + logger.log(Level.SEVERE, "Failed to open remote module events channel", ex); //NON-NLS + JOptionPane.showMessageDialog(null, NbBundle.getMessage(IngestManager.class, "IngestManager.OpenEventChannel.FailPopup.ErrMsg"), + NbBundle.getMessage(IngestManager.class, "IngestManager.OpenEventChannel.FailPopup.Title"), + JOptionPane.WARNING_MESSAGE); } } From 80c6a47318c61070b98546af1615c77d57b2ecaf Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Tue, 12 May 2015 15:33:14 -0400 Subject: [PATCH 5/5] Modify remote event channel connection msg, comments --- Core/src/org/sleuthkit/autopsy/casemodule/Case.java | 6 +----- Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 33dc4f6f08..6467b04f60 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -270,15 +270,11 @@ public class Case implements SleuthkitCase.ErrorObserver { * Use the text index name as the remote event channel name * prefix since it is unique, the same as the case database * name for a multiuser case, and is readily available - * through getTextIndexName() API. + * through the Case.getTextIndexName() API. */ eventPublisher.openRemoteEventChannel(String.format(EVENT_CHANNEL_NAME, newCase.getTextIndexName())); } catch (AutopsyEventException ex) { logger.log(Level.SEVERE, "Failed to start remote event publisher", ex); - /** - * MessageNotifyUtil.Message.warn() does not work here, - * don't know why. - */ JOptionPane.showMessageDialog(null, NbBundle.getMessage(Case.class, "Case.OpenEventChannel.FailPopup.ErrMsg"), NbBundle.getMessage(Case.class, "Case.OpenEventChannel.FailPopup.Title"), JOptionPane.WARNING_MESSAGE); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index cab78cdc25..a3dc8dade9 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -300,8 +300,8 @@ public class IngestManager { /** * Use the text index name as the remote event channel name prefix * since it is unique, the same as the case database name for a - * multiuser case, and is readily available through - * getTextIndexName() API. + * multiuser case, and is readily available through the + * Case.getTextIndexName() API. */ Case openedCase = Case.getCurrentCase(); String channelPrefix = openedCase.getTextIndexName(); @@ -310,7 +310,7 @@ public class IngestManager { moduleEventPublisher.openRemoteEventChannel(String.format(MODULE_EVENT_CHANNEL_NAME, channelPrefix)); } } catch (IllegalStateException | AutopsyEventException ex) { - logger.log(Level.SEVERE, "Failed to open remote module events channel", ex); //NON-NLS + logger.log(Level.SEVERE, "Failed to open remote events channel", ex); //NON-NLS JOptionPane.showMessageDialog(null, NbBundle.getMessage(IngestManager.class, "IngestManager.OpenEventChannel.FailPopup.ErrMsg"), NbBundle.getMessage(IngestManager.class, "IngestManager.OpenEventChannel.FailPopup.Title"), JOptionPane.WARNING_MESSAGE);