From bd1390671db15547b52f6af4d9f32181e1b56f6c Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Mon, 11 Sep 2017 13:25:12 -0400 Subject: [PATCH] 2831 refactor names of variables and methods used for correlation engine enabling to be more clear --- .../eventlisteners/CaseEventListener.java | 2 +- .../eventlisteners/IngestEventsListener.java | 36 +++++++++---------- .../ingestmodule/IngestModule.java | 4 +-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java index 048796431d..d7020132e6 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/CaseEventListener.java @@ -194,7 +194,7 @@ public class CaseEventListener implements PropertyChangeListener { */ if ((null == evt.getOldValue()) && (evt.getNewValue() instanceof Case)) { Case curCase = (Case) evt.getNewValue(); - IngestEventsListener.resetIngestJobCounter(); + IngestEventsListener.resetCeModuleInstanceCount(); try { // only add default evidence tag if case is open and it doesn't already exist in the tags list. if (Case.isCaseOpen() diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java index 7add3964c1..65d95cdd41 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java @@ -52,7 +52,7 @@ public class IngestEventsListener { private static final Logger LOGGER = Logger.getLogger(EamArtifact.class.getName()); final Collection addedCeArtifactTrackerSet = new LinkedHashSet<>(); - private static long ingestJobCounter = 0; + private static long ceModuleInstanceCount = 0; private final PropertyChangeListener pcl1 = new IngestModuleEventListener(); private final PropertyChangeListener pcl2 = new IngestJobEventListener(); @@ -73,47 +73,47 @@ public class IngestEventsListener { } /** - * Enable this IngestEventsListener to add contents to the Central - * Repository. + * Enable this IngestEventsListener to add contents to the Correlation + * Engine. * */ - public synchronized static void enableCentralRepositoryModule() { - ingestJobCounter++; //Should be called once in the central repository module's startup method. + public synchronized static void enableCorrelationEngineModule() { + ceModuleInstanceCount++; //Should be called once in the Correlation Engine module's startup method. } /** - * Disable this IngestEventsListener from adding contents to the Central - * Repository. + * Disable this IngestEventsListener from adding contents to the Correlation + * Engine. */ - public synchronized static void disableCentralRepositoryModule() { - if (isCentralRepositoryModuleEnabled()) { //prevent it ingestJobCounter from going negative - ingestJobCounter--; //Should be called once in the central repository module's shutdown method. + public synchronized static void disableCorrelationEngineModule() { + if (isCorrelationEngineModuleEnabled()) { //prevent it ingestJobCounter from going negative + ceModuleInstanceCount--; //Should be called once in the Correlation Engine module's shutdown method. } } /** - * Reset the counter which keeps track of if the Central Repository Module + * Reset the counter which keeps track of if the Correlation Engine Module * is being run during injest to 0. */ - synchronized static void resetIngestJobCounter() { - ingestJobCounter = 0; //called when a case is opened in case for some reason counter was not reset + synchronized static void resetCeModuleInstanceCount() { + ceModuleInstanceCount = 0; //called when a case is opened in case for some reason counter was not reset } /** - * Wether or not the Central Repository Module is enabled for any of the + * Wether or not the Correlation Engine Module is enabled for any of the * currently running ingest jobs. * - * @return boolean True for Central Repo enabled, False for disabled + * @return boolean True for Correlation Engine enabled, False for disabled */ - private synchronized static boolean isCentralRepositoryModuleEnabled() { - return ingestJobCounter > 0; + private synchronized static boolean isCorrelationEngineModuleEnabled() { + return ceModuleInstanceCount > 0; } private class IngestModuleEventListener implements PropertyChangeListener { @Override public void propertyChange(PropertyChangeEvent evt) { - if (isCentralRepositoryModuleEnabled()) { + if (isCorrelationEngineModuleEnabled()) { EamDb dbManager; try { dbManager = EamDb.getInstance(); diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java index 59285ef37e..31caf61168 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/ingestmodule/IngestModule.java @@ -156,7 +156,7 @@ class IngestModule implements FileIngestModule { @Override public void shutDown() { - IngestEventsListener.disableCentralRepositoryModule(); + IngestEventsListener.disableCorrelationEngineModule(); if (EamDb.isEnabled() == false) { /* * Not signaling an error for now. This is a workaround for the way @@ -197,7 +197,7 @@ class IngestModule implements FileIngestModule { }) @Override public void startUp(IngestJobContext context) throws IngestModuleException { - IngestEventsListener.enableCentralRepositoryModule(); + IngestEventsListener.enableCorrelationEngineModule(); if (EamDb.isEnabled() == false) { /* * Not throwing the customary exception for now. This is a