mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Merge branch 'develop' of github.com:sleuthkit/autopsy into develop
This commit is contained in:
commit
c7ead95530
@ -61,47 +61,7 @@ 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 autopsyVer = Version.getVersion(); // current version of autopsy. Change it when the version is changed
|
||||||
private static String appName = null;
|
private static String appName = null;
|
||||||
/**
|
|
||||||
* Property name that indicates the name of the current case has changed.
|
|
||||||
* When a case is opened, "old name" is empty string and "new name" is the name.
|
|
||||||
* When a case is closed, "old name" is the case name and "new name" is empty string.
|
|
||||||
* When a case is renamed, "old name" has the original name and "new name" has the new name.
|
|
||||||
*/
|
|
||||||
public static final String CASE_NAME = "caseName";
|
|
||||||
/**
|
|
||||||
* Property name that indicates the number of the current case has changed.
|
|
||||||
* Fired with the case number is changed. The value is an int: the number of
|
|
||||||
* the case. -1 is used for no case number set.
|
|
||||||
*/
|
|
||||||
public static final String CASE_NUMBER = "caseNumber";
|
|
||||||
/**
|
|
||||||
* Property name that indicates the examiner of the current case has
|
|
||||||
* changed. Fired with the case examiner is changed. The value is a String:
|
|
||||||
* the name of the examiner. The empty string ("") is used for no examiner
|
|
||||||
* set.
|
|
||||||
*/
|
|
||||||
public static final String CASE_EXAMINER = "caseExaminer";
|
|
||||||
/**
|
|
||||||
* Property name that indicates a new data source (image, disk or local
|
|
||||||
* file) has been added to the current case. The new value is the
|
|
||||||
* newly-added instance of the new data source, and the old value is always
|
|
||||||
* null.
|
|
||||||
*/
|
|
||||||
public static final String CASE_ADD_DATA_SOURCE = "addDataSource";
|
|
||||||
/**
|
|
||||||
* Property name that indicates a data source has been removed from the
|
|
||||||
* current case. The "old value" is the (int) content ID of the data source
|
|
||||||
* that was removed, the new value is the instance of the data source.
|
|
||||||
*/
|
|
||||||
public static final String CASE_DEL_DATA_SOURCE = "removeDataSource";
|
|
||||||
/**
|
|
||||||
* Property name that indicates the currently open case has changed.
|
|
||||||
* When a case is opened, the "new value" will be an instance of the opened
|
|
||||||
* Case object and the "old value" will be null.
|
|
||||||
* When a case is closed, the "new value" will be null and the "old value"
|
|
||||||
* will be the instance of the Case object being closed.
|
|
||||||
*/
|
|
||||||
public static final String CASE_CURRENT_CASE = "currentCase";
|
|
||||||
/**
|
/**
|
||||||
* Name for the property that determines whether to show the dialog at
|
* Name for the property that determines whether to show the dialog at
|
||||||
* startup
|
* startup
|
||||||
@ -114,69 +74,53 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
* Events that the case module will fire. Event listeners can get the event
|
* Events that the case module will fire. Event listeners can get the event
|
||||||
* name by using String returned by toString() method on a specific event.
|
* name by using String returned by toString() method on a specific event.
|
||||||
*/
|
*/
|
||||||
/* @@@ BC: I added this as a place holder for what I want this to be, but
|
public enum Events {
|
||||||
* this is not the time to change it. We'll start using this at a major release
|
|
||||||
* version.
|
|
||||||
*/
|
|
||||||
private enum CaseModuleEvent_DoNotUse {
|
|
||||||
/**
|
|
||||||
* Property name that indicates the name of the current case has changed.
|
|
||||||
* Fired with the case is renamed, and when the current case is
|
|
||||||
* opened/closed/changed. The value is a String: the name of the case. The
|
|
||||||
* empty string ("") is used for no open case.
|
|
||||||
*/
|
|
||||||
// @@@ BC: I propose that this is no longer called for case open/close.
|
|
||||||
CASE_NAME("caseName"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Property name that indicates the number of the current case has changed.
|
|
||||||
* Fired with the case number is changed. The value is an int: the number of
|
|
||||||
* the case. -1 is used for no case number set.
|
|
||||||
*/
|
|
||||||
CASE_NUMBER("caseNumber"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Property name that indicates the examiner of the current case has
|
|
||||||
* changed. Fired with the case examiner is changed. The value is a String:
|
|
||||||
* the name of the examiner. The empty string ("") is used for no examiner
|
|
||||||
* set.
|
|
||||||
*/
|
|
||||||
CASE_EXAMINER("caseExaminer"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Property name that indicates a new data source (image, disk or local
|
|
||||||
* file) has been added to the current case. The new value is the
|
|
||||||
* newly-added instance of the new data source, and the old value is always
|
|
||||||
* null.
|
|
||||||
*/
|
|
||||||
CASE_ADD_DATA_SOURCE("addDataSource"),
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Property name that indicates a data source has been removed from the
|
|
||||||
* current case. The "old value" is the (int) content ID of the data source
|
|
||||||
* that was removed, the new value is the instance of the data source.
|
|
||||||
*/
|
|
||||||
CASE_DEL_DATA_SOURCE("removeDataSource"),
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property name that indicates the currently open case has changed. The new
|
* Property name that indicates the name of the current case has
|
||||||
* value is the instance of the opened Case, or null if there is no open
|
* changed. When a case is opened, "old name" is empty string and "new
|
||||||
* case. The old value is the instance of the closed Case, or null if there
|
* name" is the name. When a case is closed, "old name" is the case name
|
||||||
* was no open case.
|
* and "new name" is empty string. When a case is renamed, "old name"
|
||||||
|
* has the original name and "new name" has the new name.
|
||||||
*/
|
*/
|
||||||
CASE_CURRENT_CASE("currentCase");
|
// @@@ BC: I propose that this is no longer called for case open/close.
|
||||||
|
NAME,
|
||||||
private String name;
|
/**
|
||||||
CaseModuleEvent_DoNotUse(String name) {
|
* Property name that indicates the number of the current case has
|
||||||
this.name = name;
|
* changed. Fired with the case number is changed. The value is an int:
|
||||||
}
|
* the number of the case. -1 is used for no case number set.
|
||||||
|
*/
|
||||||
public String getName() {
|
NUMBER,
|
||||||
return this.name;
|
/**
|
||||||
}
|
* Property name that indicates the examiner of the current case has
|
||||||
|
* changed. Fired with the case examiner is changed. The value is a
|
||||||
|
* String: the name of the examiner. The empty string ("") is used for
|
||||||
|
* no examiner set.
|
||||||
|
*/
|
||||||
|
EXAMINER,
|
||||||
|
/**
|
||||||
|
* Property name that indicates a new data source (image, disk or local
|
||||||
|
* file) has been added to the current case. The new value is the
|
||||||
|
* newly-added instance of the new data source, and the old value is
|
||||||
|
* always null.
|
||||||
|
*/
|
||||||
|
DATA_SOURCE_ADDED,
|
||||||
|
/**
|
||||||
|
* Property name that indicates a data source has been removed from the
|
||||||
|
* current case. The "old value" is the (int) content ID of the data
|
||||||
|
* source that was removed, the new value is the instance of the data
|
||||||
|
* source.
|
||||||
|
*/
|
||||||
|
DATA_SOURCE_DELETED,
|
||||||
|
/**
|
||||||
|
* Property name that indicates the currently open case has changed.
|
||||||
|
* When a case is opened, the "new value" will be an instance of the
|
||||||
|
* opened Case object and the "old value" will be null. When a case is
|
||||||
|
* closed, the "new value" will be null and the "old value" will be the
|
||||||
|
* instance of the Case object being closed.
|
||||||
|
*/
|
||||||
|
CURRENT_CASE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private String number;
|
private String number;
|
||||||
private String examiner;
|
private String examiner;
|
||||||
@ -244,7 +188,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
doCaseChange(null); //closes windows, etc
|
doCaseChange(null); //closes windows, etc
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pcs.firePropertyChange(CASE_CURRENT_CASE, oldCase, null);
|
pcs.firePropertyChange(Events.CURRENT_CASE.toString(), oldCase, null);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
||||||
@ -253,7 +197,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
doCaseNameChange("");
|
doCaseNameChange("");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pcs.firePropertyChange(CASE_NAME, oldCase.name, "");
|
pcs.firePropertyChange(Events.NAME.toString(), oldCase.name, "");
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
||||||
@ -266,7 +210,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pcs.firePropertyChange(CASE_CURRENT_CASE, null, currentCase);
|
pcs.firePropertyChange(Events.CURRENT_CASE.toString(), null, currentCase);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
||||||
@ -276,7 +220,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pcs.firePropertyChange(CASE_NAME, "", currentCase.name);
|
pcs.firePropertyChange(Events.NAME.toString(), "", currentCase.name);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, "Case threw exception", e);
|
logger.log(Level.SEVERE, "Case threw exception", e);
|
||||||
@ -441,7 +385,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
Image newImage = db.getImageById(imgId);
|
Image newImage = db.getImageById(imgId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pcs.firePropertyChange(CASE_ADD_DATA_SOURCE, null, newImage); // the new value is the instance of the image
|
pcs.firePropertyChange(Events.DATA_SOURCE_ADDED.toString(), null, newImage); // the new value is the instance of the image
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
||||||
@ -475,7 +419,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
void notifyNewDataSource(Content newDataSource) {
|
void notifyNewDataSource(Content newDataSource) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pcs.firePropertyChange(CASE_ADD_DATA_SOURCE, null, newDataSource);
|
pcs.firePropertyChange(Events.DATA_SOURCE_ADDED.toString(), null, newDataSource);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, "Case threw exception", e);
|
logger.log(Level.SEVERE, "Case threw exception", e);
|
||||||
@ -556,7 +500,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
name = newCaseName; // change the local value
|
name = newCaseName; // change the local value
|
||||||
RecentCases.getInstance().updateRecentCase(oldCaseName, oldPath, newCaseName, newPath); // update the recent case
|
RecentCases.getInstance().updateRecentCase(oldCaseName, oldPath, newCaseName, newPath); // update the recent case
|
||||||
try {
|
try {
|
||||||
pcs.firePropertyChange(CASE_NAME, oldCaseName, newCaseName);
|
pcs.firePropertyChange(Events.NAME.toString(), oldCaseName, newCaseName);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
||||||
@ -580,7 +524,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
xmlcm.setCaseExaminer(newExaminer); // set the examiner
|
xmlcm.setCaseExaminer(newExaminer); // set the examiner
|
||||||
examiner = newExaminer;
|
examiner = newExaminer;
|
||||||
try {
|
try {
|
||||||
pcs.firePropertyChange(CASE_EXAMINER, oldExaminer, newExaminer);
|
pcs.firePropertyChange(Events.EXAMINER.toString(), oldExaminer, newExaminer);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
||||||
@ -603,7 +547,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
|
|||||||
number = newCaseNumber;
|
number = newCaseNumber;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
pcs.firePropertyChange(CASE_NUMBER, oldCaseNumber, newCaseNumber);
|
pcs.firePropertyChange(Events.NUMBER.toString(), oldCaseNumber, newCaseNumber);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
logger.log(Level.SEVERE, "Case listener threw exception", e);
|
||||||
|
@ -236,6 +236,10 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Thread note: Make sure to run this in the EDT as it causes GUI operations.
|
||||||
|
* @param selectedNode
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setNode(Node selectedNode) {
|
public void setNode(Node selectedNode) {
|
||||||
// change the cursor to "waiting cursor" for this operation
|
// change the cursor to "waiting cursor" for this operation
|
||||||
|
@ -516,7 +516,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
|||||||
Object newValue = evt.getNewValue();
|
Object newValue = evt.getNewValue();
|
||||||
|
|
||||||
// change in the case name
|
// change in the case name
|
||||||
if (changed.equals(Case.CASE_NAME)) {
|
if (changed.equals(Case.Events.NAME.toString())) {
|
||||||
// set the main title of the window
|
// set the main title of the window
|
||||||
String oldCaseName = oldValue.toString();
|
String oldCaseName = oldValue.toString();
|
||||||
String newCaseName = newValue.toString();
|
String newCaseName = newValue.toString();
|
||||||
@ -529,7 +529,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
|||||||
em.getRootContext().setDisplayName(newCaseName);
|
em.getRootContext().setDisplayName(newCaseName);
|
||||||
}
|
}
|
||||||
} // changed current case
|
} // changed current case
|
||||||
else if (changed.equals(Case.CASE_CURRENT_CASE)) {
|
else if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
// When a case is closed, the old value of this property is the
|
// When a case is closed, the old value of this property is the
|
||||||
// closed Case object and the new value is null. When a case is
|
// closed Case object and the new value is null. When a case is
|
||||||
// opened, the old value is null and the new value is the new Case
|
// opened, the old value is null and the new value is the new Case
|
||||||
@ -553,7 +553,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|
|||||||
resetHistory();
|
resetHistory();
|
||||||
}
|
}
|
||||||
} // if the image is added to the case
|
} // if the image is added to the case
|
||||||
else if (changed.equals(Case.CASE_ADD_DATA_SOURCE)) {
|
else if (changed.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
|
||||||
componentOpened();
|
componentOpened();
|
||||||
// Image img = (Image)newValue;
|
// Image img = (Image)newValue;
|
||||||
//
|
//
|
||||||
|
@ -239,7 +239,7 @@ class DateSearchFilter extends AbstractFileSearchFilter<DateSearchPanel> {
|
|||||||
Object oldValue = evt.getOldValue();
|
Object oldValue = evt.getOldValue();
|
||||||
Object newValue = evt.getNewValue();
|
Object newValue = evt.getNewValue();
|
||||||
|
|
||||||
if (changed.equals(Case.CASE_CURRENT_CASE)) {
|
if (changed.equals(Case.Events.CURRENT_CASE.toString().toString())) {
|
||||||
// create or open a case
|
// create or open a case
|
||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
DateSearchFilter.this.updateTimeZoneList();
|
DateSearchFilter.this.updateTimeZoneList();
|
||||||
@ -247,12 +247,12 @@ class DateSearchFilter extends AbstractFileSearchFilter<DateSearchPanel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if the image is added to the case
|
// if the image is added to the case
|
||||||
if (changed.equals(Case.CASE_ADD_DATA_SOURCE)) {
|
if (changed.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
|
||||||
DateSearchFilter.this.updateTimeZoneList();
|
DateSearchFilter.this.updateTimeZoneList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the image is removed from the case
|
// if the image is removed from the case
|
||||||
if (changed.equals(Case.CASE_DEL_DATA_SOURCE)) {
|
if (changed.equals(Case.Events.DATA_SOURCE_DELETED.toString())) {
|
||||||
DateSearchFilter.this.updateTimeZoneList();
|
DateSearchFilter.this.updateTimeZoneList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ import org.sleuthkit.autopsy.directorytree.FileSearchProvider;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
if(evt.getPropertyName().equals(Case.CASE_CURRENT_CASE)){
|
if(evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())){
|
||||||
setEnabled(evt.getNewValue() != null);
|
setEnabled(evt.getNewValue() != null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ import org.sleuthkit.datamodel.Content;
|
|||||||
Case.addPropertyChangeListener(new PropertyChangeListener() {
|
Case.addPropertyChangeListener(new PropertyChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
if (evt.getPropertyName().equals(Case.CASE_CURRENT_CASE)) {
|
if (evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
Case oldCase = (Case) evt.getOldValue();
|
Case oldCase = (Case) evt.getOldValue();
|
||||||
if (oldCase == null) //nothing to do, new case had been opened
|
if (oldCase == null) //nothing to do, new case had been opened
|
||||||
{
|
{
|
||||||
|
@ -143,7 +143,7 @@ import org.sleuthkit.autopsy.casemodule.Case;
|
|||||||
Case.addPropertyChangeListener(new PropertyChangeListener() {
|
Case.addPropertyChangeListener(new PropertyChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
if (evt.getPropertyName().equals(Case.CASE_CURRENT_CASE)) {
|
if (evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
setEnabled(evt.getNewValue() != null);
|
setEnabled(evt.getNewValue() != null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
|||||||
String changed = evt.getPropertyName();
|
String changed = evt.getPropertyName();
|
||||||
Object newValue = evt.getNewValue();
|
Object newValue = evt.getNewValue();
|
||||||
|
|
||||||
if (changed.equals(Case.CASE_CURRENT_CASE)) {
|
if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
setMonitorDir();
|
setMonitorDir();
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ import org.sleuthkit.autopsy.casemodule.Case;
|
|||||||
Object oldValue = evt.getOldValue();
|
Object oldValue = evt.getOldValue();
|
||||||
Object newValue = evt.getNewValue();
|
Object newValue = evt.getNewValue();
|
||||||
|
|
||||||
if (changed.equals(Case.CASE_CURRENT_CASE)) {
|
if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
// enable all menus when a case is created / opened
|
// enable all menus when a case is created / opened
|
||||||
int totalMenus = menu.getItemCount();
|
int totalMenus = menu.getItemCount();
|
||||||
|
@ -83,7 +83,7 @@ public final class ReportWizardAction extends CallableSystemAction implements P
|
|||||||
Case.addPropertyChangeListener(new PropertyChangeListener() {
|
Case.addPropertyChangeListener(new PropertyChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
if (evt.getPropertyName().equals(Case.CASE_CURRENT_CASE)) {
|
if (evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
Case newCase = (Case) evt.getNewValue();
|
Case newCase = (Case) evt.getNewValue();
|
||||||
setEnabled(newCase != null);
|
setEnabled(newCase != null);
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class HashDbPanelSearchAction extends CallableSystemAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
if(evt.getPropertyName().equals(Case.CASE_CURRENT_CASE)){
|
if(evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())){
|
||||||
setEnabled(evt.getNewValue() != null);
|
setEnabled(evt.getNewValue() != null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,9 +66,9 @@ class Installer extends ModuleInstall {
|
|||||||
int serverStopPort = server.getCurrentSolrStopPort();
|
int serverStopPort = server.getCurrentSolrStopPort();
|
||||||
logger.log(Level.SEVERE, "There's already a server running on "
|
logger.log(Level.SEVERE, "There's already a server running on "
|
||||||
+ serverPort + " port that can't be shutdown.");
|
+ serverPort + " port that can't be shutdown.");
|
||||||
if (!Server.available(serverPort)) {
|
if (!Server.isPortAvailable(serverPort)) {
|
||||||
reportPortError(serverPort);
|
reportPortError(serverPort);
|
||||||
} else if (!Server.available(serverStopPort)) {
|
} else if (!Server.isPortAvailable(serverStopPort)) {
|
||||||
reportStopPortError(serverStopPort);
|
reportStopPortError(serverStopPort);
|
||||||
} else {
|
} else {
|
||||||
//some other reason
|
//some other reason
|
||||||
@ -95,7 +95,7 @@ class Installer extends ModuleInstall {
|
|||||||
//TODO move some of this logic to Server class
|
//TODO move some of this logic to Server class
|
||||||
for (int i = 0; i <= 3; i++) {
|
for (int i = 0; i <= 3; i++) {
|
||||||
logger.log(Level.INFO, "Checking if port available.");
|
logger.log(Level.INFO, "Checking if port available.");
|
||||||
if (Server.available(server.getCurrentSolrServerPort())) {
|
if (Server.isPortAvailable(server.getCurrentSolrServerPort())) {
|
||||||
logger.log(Level.INFO, "Port available, trying to start server.");
|
logger.log(Level.INFO, "Port available, trying to start server.");
|
||||||
server.start();
|
server.start();
|
||||||
break;
|
break;
|
||||||
@ -165,9 +165,9 @@ class Installer extends ModuleInstall {
|
|||||||
//check if port is taken or some other reason
|
//check if port is taken or some other reason
|
||||||
int serverPort = server.getCurrentSolrServerPort();
|
int serverPort = server.getCurrentSolrServerPort();
|
||||||
int serverStopPort = server.getCurrentSolrStopPort();
|
int serverStopPort = server.getCurrentSolrStopPort();
|
||||||
if (!Server.available(serverPort)) {
|
if (!Server.isPortAvailable(serverPort)) {
|
||||||
reportPortError(serverPort);
|
reportPortError(serverPort);
|
||||||
} else if (!Server.available(serverStopPort)) {
|
} else if (!Server.isPortAvailable(serverStopPort)) {
|
||||||
reportStopPortError(serverStopPort);
|
reportStopPortError(serverStopPort);
|
||||||
} else {
|
} else {
|
||||||
//some other reason
|
//some other reason
|
||||||
|
@ -126,7 +126,7 @@ public class KeywordSearch {
|
|||||||
Object newValue = evt.getNewValue();
|
Object newValue = evt.getNewValue();
|
||||||
|
|
||||||
final Logger logger = Logger.getLogger(CaseChangeListener.class.getName());
|
final Logger logger = Logger.getLogger(CaseChangeListener.class.getName());
|
||||||
if (changed.equals(Case.CASE_CURRENT_CASE)) {
|
if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
// new case is open
|
// new case is open
|
||||||
try {
|
try {
|
||||||
|
@ -44,6 +44,7 @@ import org.netbeans.api.progress.aggregate.AggregateProgressFactory;
|
|||||||
import org.netbeans.api.progress.aggregate.AggregateProgressHandle;
|
import org.netbeans.api.progress.aggregate.AggregateProgressHandle;
|
||||||
import org.netbeans.api.progress.aggregate.ProgressContributor;
|
import org.netbeans.api.progress.aggregate.ProgressContributor;
|
||||||
import org.openide.util.Cancellable;
|
import org.openide.util.Cancellable;
|
||||||
|
import org.openide.util.Exceptions;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
@ -361,8 +362,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAbstractFile {
|
|||||||
logger.log(Level.SEVERE, msg);
|
logger.log(Level.SEVERE, msg);
|
||||||
String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg);
|
String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg);
|
||||||
services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details));
|
services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details));
|
||||||
return;
|
throw new IngestModuleException(msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (KeywordSearchModuleException ex) {
|
} catch (KeywordSearchModuleException ex) {
|
||||||
logger.log(Level.WARNING, "Error checking if Solr server is running while initializing ingest", ex);
|
logger.log(Level.WARNING, "Error checking if Solr server is running while initializing ingest", ex);
|
||||||
@ -370,9 +370,15 @@ public final class KeywordSearchIngestModule extends IngestModuleAbstractFile {
|
|||||||
String msg = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.badInitMsg");
|
String msg = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.badInitMsg");
|
||||||
String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg);
|
String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg);
|
||||||
services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details));
|
services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details));
|
||||||
return;
|
throw new IngestModuleException(msg);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// make an actual query to verify that server is responding
|
||||||
|
// we had cases where getStatus was OK, but the connection resulted in a 404
|
||||||
|
server.queryNumIndexedDocuments();
|
||||||
|
} catch (KeywordSearchModuleException | NoOpenCoreException ex) {
|
||||||
|
throw new IngestModuleException("Error connecting to SOLR server: " + ex.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//initialize extractors
|
//initialize extractors
|
||||||
stringExtractor = new AbstractFileStringExtract();
|
stringExtractor = new AbstractFileStringExtract();
|
||||||
|
@ -395,7 +395,7 @@ class KeywordSearchPanel extends AbstractKeywordSearchPerformer {
|
|||||||
Object oldValue = evt.getOldValue();
|
Object oldValue = evt.getOldValue();
|
||||||
Object newValue = evt.getNewValue();
|
Object newValue = evt.getNewValue();
|
||||||
|
|
||||||
if (changed.equals(Case.CASE_CURRENT_CASE)) {
|
if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
resetSearchBox();
|
resetSearchBox();
|
||||||
if (newValue == null) {
|
if (newValue == null) {
|
||||||
setFields(false);
|
setFields(false);
|
||||||
|
@ -350,7 +350,7 @@ public class Server {
|
|||||||
*/
|
*/
|
||||||
void start() throws KeywordSearchModuleException, SolrServerNoPortException {
|
void start() throws KeywordSearchModuleException, SolrServerNoPortException {
|
||||||
logger.log(Level.INFO, "Starting Solr server from: " + solrFolder.getAbsolutePath());
|
logger.log(Level.INFO, "Starting Solr server from: " + solrFolder.getAbsolutePath());
|
||||||
if (available(currentSolrServerPort)) {
|
if (isPortAvailable(currentSolrServerPort)) {
|
||||||
logger.log(Level.INFO, "Port [" + currentSolrServerPort + "] available, starting Solr");
|
logger.log(Level.INFO, "Port [" + currentSolrServerPort + "] available, starting Solr");
|
||||||
try {
|
try {
|
||||||
final String MAX_SOLR_MEM_MB_PAR = "-Xmx" + Integer.toString(MAX_SOLR_MEM_MB) + "m";
|
final String MAX_SOLR_MEM_MB_PAR = "-Xmx" + Integer.toString(MAX_SOLR_MEM_MB) + "m";
|
||||||
@ -419,7 +419,7 @@ public class Server {
|
|||||||
*
|
*
|
||||||
* @param port the port to check for availability
|
* @param port the port to check for availability
|
||||||
*/
|
*/
|
||||||
static boolean available(int port) {
|
static boolean isPortAvailable(int port) {
|
||||||
ServerSocket ss = null;
|
ServerSocket ss = null;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@ -524,6 +524,7 @@ public class Server {
|
|||||||
|
|
||||||
//TODO handle timeout in cases when some other type of server on that port
|
//TODO handle timeout in cases when some other type of server on that port
|
||||||
CoreAdminRequest.getStatus(null, solrServer);
|
CoreAdminRequest.getStatus(null, solrServer);
|
||||||
|
|
||||||
logger.log(Level.INFO, "Solr server is running");
|
logger.log(Level.INFO, "Solr server is running");
|
||||||
} catch (SolrServerException ex) {
|
} catch (SolrServerException ex) {
|
||||||
|
|
||||||
|
@ -613,7 +613,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
|||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
String prop = evt.getPropertyName();
|
String prop = evt.getPropertyName();
|
||||||
if (prop.equals(Case.CASE_ADD_DATA_SOURCE)) {
|
if (prop.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
|
||||||
if (mainFrame != null && !mainFrame.isVisible()) {
|
if (mainFrame != null && !mainFrame.isVisible()) {
|
||||||
// change the lastObjectId to trigger a reparse of mactime barData
|
// change the lastObjectId to trigger a reparse of mactime barData
|
||||||
++lastObjectId;
|
++lastObjectId;
|
||||||
@ -629,7 +629,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
|
|||||||
|
|
||||||
// call performAction as if the user selected 'Make Timeline' from the menu
|
// call performAction as if the user selected 'Make Timeline' from the menu
|
||||||
performAction();
|
performAction();
|
||||||
} else if (prop.equals(Case.CASE_CURRENT_CASE)) {
|
} else if (prop.equals(Case.Events.CURRENT_CASE.toString())) {
|
||||||
if (mainFrame != null && mainFrame.isVisible()) {
|
if (mainFrame != null && mainFrame.isVisible()) {
|
||||||
mainFrame.dispose();
|
mainFrame.dispose();
|
||||||
mainFrame = null;
|
mainFrame = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user