mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 08:26:15 +00:00
Ingest Service now keeps track of current Keyword Lists
This commit is contained in:
parent
81c9b92f27
commit
d3f5b054ec
@ -64,6 +64,7 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
private volatile boolean commitIndex = false; //whether to commit index next time
|
private volatile boolean commitIndex = false; //whether to commit index next time
|
||||||
private volatile boolean runTimer = false;
|
private volatile boolean runTimer = false;
|
||||||
private List<Keyword> keywords; //keywords to search
|
private List<Keyword> keywords; //keywords to search
|
||||||
|
private List<KeywordSearchList> keywordLists; // lists currently being searched
|
||||||
//private final Object lock = new Object();
|
//private final Object lock = new Object();
|
||||||
private Thread timer;
|
private Thread timer;
|
||||||
private Indexer indexer;
|
private Indexer indexer;
|
||||||
@ -188,6 +189,7 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
reportedHits = new HashMap<String, List<FsContent>>();
|
reportedHits = new HashMap<String, List<FsContent>>();
|
||||||
|
|
||||||
keywords = new ArrayList<Keyword>();
|
keywords = new ArrayList<Keyword>();
|
||||||
|
keywordLists = new ArrayList<KeywordSearchList>();
|
||||||
|
|
||||||
updateKeywords();
|
updateKeywords();
|
||||||
|
|
||||||
@ -277,17 +279,32 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the updated keyword search lists from the XML loader
|
||||||
|
*/
|
||||||
private void updateKeywords() {
|
private void updateKeywords() {
|
||||||
KeywordSearchListsXML loader = KeywordSearchListsXML.getCurrent();
|
KeywordSearchListsXML loader = KeywordSearchListsXML.getCurrent();
|
||||||
|
|
||||||
keywords.clear();
|
keywords.clear();
|
||||||
|
keywordLists.clear();
|
||||||
|
|
||||||
for(KeywordSearchList list : loader.getListsL()){
|
for(KeywordSearchList list : loader.getListsL()){
|
||||||
if(list.getUseForIngest())
|
if(list.getUseForIngest())
|
||||||
|
keywordLists.add(list);
|
||||||
keywords.addAll(list.getKeywords());
|
keywords.addAll(list.getKeywords());
|
||||||
}
|
}
|
||||||
logger.info(keywords.size()+"");
|
logger.info(keywords.size()+"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> getKeywordLists() {
|
||||||
|
List<String> ret = new ArrayList<String>();
|
||||||
|
if(keywordLists == null)
|
||||||
|
return ret;
|
||||||
|
for(KeywordSearchList list : keywordLists) {
|
||||||
|
ret.add(list.getName());
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
//CommitTimer wakes up every interval ms
|
//CommitTimer wakes up every interval ms
|
||||||
//and sets a flag for indexer to commit after indexing next file
|
//and sets a flag for indexer to commit after indexing next file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user