Merge pull request #7065 from gdicristofaro/7752-emails

7752 email paging
This commit is contained in:
Richard Cordovano 2021-06-24 13:58:12 -04:00 committed by GitHub
commit c5afa868b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -327,7 +327,7 @@ public class EmailExtracted implements AutopsyVisitableItem {
} }
@Override @Override
protected void finalize() throws Throwable{ protected void finalize() throws Throwable {
super.finalize(); super.finalize();
IngestManager.getInstance().removeIngestJobEventListener(weakPcl); IngestManager.getInstance().removeIngestJobEventListener(weakPcl);
IngestManager.getInstance().removeIngestModuleEventListener(weakPcl); IngestManager.getInstance().removeIngestModuleEventListener(weakPcl);
@ -440,6 +440,23 @@ public class EmailExtracted implements AutopsyVisitableItem {
} }
} }
/**
* Ensures that the key for the parent node and child factory is the same to
* ensure that the BaseChildFactory registered listener node name
* (BaseChildFactory.register and DataResultViewerTable.setNode with event
* registration) is the same as the factory name that will post events from
* BaseChildFactory.post called in BaseChildFactory.makeKeys. See JIRA-7752
* for more details.
*
* @param accountName The account name.
* @param folderName The folder name.
*
* @return The generated key.
*/
private static String getFolderKey(String accountName, String folderName) {
return accountName + "_" + folderName;
}
/** /**
* Node representing mail folder * Node representing mail folder
*/ */
@ -450,7 +467,7 @@ public class EmailExtracted implements AutopsyVisitableItem {
public FolderNode(String accountName, String folderName) { public FolderNode(String accountName, String folderName) {
super(Children.create(new MessageFactory(accountName, folderName), true), Lookups.singleton(accountName)); super(Children.create(new MessageFactory(accountName, folderName), true), Lookups.singleton(accountName));
super.setName(folderName); super.setName(getFolderKey(accountName, folderName));
this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/folder-icon-16.png"); //NON-NLS this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/folder-icon-16.png"); //NON-NLS
this.accountName = accountName; this.accountName = accountName;
this.folderName = folderName; this.folderName = folderName;
@ -510,7 +527,7 @@ public class EmailExtracted implements AutopsyVisitableItem {
private final String folderName; private final String folderName;
private MessageFactory(String accountName, String folderName) { private MessageFactory(String accountName, String folderName) {
super(accountName + "_" + folderName); super(getFolderKey(accountName, folderName));
this.accountName = accountName; this.accountName = accountName;
this.folderName = folderName; this.folderName = folderName;
emailResults.addObserver(this); emailResults.addObserver(this);