Merge pull request #6841 from kellykelly3/7454-refactor-TskEvent

7454 - Updated TskEvent names
This commit is contained in:
Richard Cordovano 2021-04-08 09:11:33 -04:00 committed by GitHub
commit 678f9d7731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 50 deletions

View File

@ -87,10 +87,10 @@ import org.sleuthkit.autopsy.casemodule.events.HostsChangedEvent;
import org.sleuthkit.autopsy.casemodule.events.HostsRemovedEvent; import org.sleuthkit.autopsy.casemodule.events.HostsRemovedEvent;
import org.sleuthkit.autopsy.casemodule.events.OsAccountAddedEvent; import org.sleuthkit.autopsy.casemodule.events.OsAccountAddedEvent;
import org.sleuthkit.autopsy.casemodule.events.OsAccountChangedEvent; import org.sleuthkit.autopsy.casemodule.events.OsAccountChangedEvent;
import org.sleuthkit.autopsy.casemodule.events.OsAccountRemovedEvent; import org.sleuthkit.autopsy.casemodule.events.OsAccountDeletedEvent;
import org.sleuthkit.autopsy.casemodule.events.PersonsAddedEvent; import org.sleuthkit.autopsy.casemodule.events.PersonsAddedEvent;
import org.sleuthkit.autopsy.casemodule.events.PersonsChangedEvent; import org.sleuthkit.autopsy.casemodule.events.PersonsChangedEvent;
import org.sleuthkit.autopsy.casemodule.events.PersonsRemovedEvent; import org.sleuthkit.autopsy.casemodule.events.PersonsDeletedEvent;
import org.sleuthkit.autopsy.casemodule.events.ReportAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ReportAddedEvent;
import org.sleuthkit.autopsy.casemodule.multiusercases.CaseNodeData.CaseNodeDataException; import org.sleuthkit.autopsy.casemodule.multiusercases.CaseNodeData.CaseNodeDataException;
import org.sleuthkit.autopsy.casemodule.multiusercases.CoordinationServiceUtils; import org.sleuthkit.autopsy.casemodule.multiusercases.CoordinationServiceUtils;
@ -140,24 +140,16 @@ import org.sleuthkit.datamodel.ContentTag;
import org.sleuthkit.datamodel.DataSource; import org.sleuthkit.datamodel.DataSource;
import org.sleuthkit.datamodel.FileSystem; import org.sleuthkit.datamodel.FileSystem;
import org.sleuthkit.datamodel.Host; import org.sleuthkit.datamodel.Host;
import org.sleuthkit.datamodel.HostManager.HostsCreationEvent;
import org.sleuthkit.datamodel.HostManager.HostsUpdateEvent;
import org.sleuthkit.datamodel.HostManager.HostsDeletionEvent;
import org.sleuthkit.datamodel.Image; import org.sleuthkit.datamodel.Image;
import org.sleuthkit.datamodel.OsAccount; import org.sleuthkit.datamodel.OsAccount;
import org.sleuthkit.datamodel.OsAccountManager.OsAccountsCreationEvent;
import org.sleuthkit.datamodel.OsAccountManager.OsAccountsDeleteEvent;
import org.sleuthkit.datamodel.OsAccountManager.OsAccountsUpdateEvent;
import org.sleuthkit.datamodel.Person; import org.sleuthkit.datamodel.Person;
import org.sleuthkit.datamodel.PersonManager.PersonsCreationEvent;
import org.sleuthkit.datamodel.PersonManager.PersonsUpdateEvent;
import org.sleuthkit.datamodel.PersonManager.PersonsDeletionEvent;
import org.sleuthkit.datamodel.Report; import org.sleuthkit.datamodel.Report;
import org.sleuthkit.datamodel.SleuthkitCase; import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TimelineManager; import org.sleuthkit.datamodel.TimelineManager;
import org.sleuthkit.datamodel.SleuthkitCaseAdminUtil; import org.sleuthkit.datamodel.SleuthkitCaseAdminUtil;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.TskDataException; import org.sleuthkit.datamodel.TskDataException;
import org.sleuthkit.datamodel.TskEvent;
import org.sleuthkit.datamodel.TskUnsupportedSchemaVersionException; import org.sleuthkit.datamodel.TskUnsupportedSchemaVersionException;
/** /**
@ -504,36 +496,36 @@ public class Case {
event.getArtifacts(artifactType))); event.getArtifacts(artifactType)));
} }
} }
@Subscribe @Subscribe
public void publishOsAccountAddedEvent(OsAccountsCreationEvent event) { public void publishOsAccountAddedEvent(TskEvent.OsAccountsAddedTskEvent event) {
for (OsAccount account : event.getOsAcounts()) { for(OsAccount account: event.getOsAcounts()) {
eventPublisher.publish(new OsAccountAddedEvent(account)); eventPublisher.publish(new OsAccountAddedEvent(account));
} }
} }
@Subscribe @Subscribe
public void publishOsAccountChangedEvent(OsAccountsUpdateEvent event) { public void publishOsAccountChangedEvent(TskEvent.OsAccountsChangedTskEvent event) {
for (OsAccount account : event.getOsAcounts()) { for(OsAccount account: event.getOsAcounts()) {
eventPublisher.publish(new OsAccountChangedEvent(account)); eventPublisher.publish(new OsAccountChangedEvent(account));
} }
} }
@Subscribe @Subscribe
public void publishOsAccountDeletedEvent(OsAccountsDeleteEvent event) { public void publishOsAccountDeletedEvent(TskEvent.OsAccountsDeletedTskEvent event) {
for (Long accountId : event.getOsAcountObjectIds()) { for(Long accountId: event.getOsAcountObjectIds()) {
eventPublisher.publish(new OsAccountRemovedEvent(accountId)); eventPublisher.publish(new OsAccountDeletedEvent(accountId));
} }
} }
/** /**
* Publishes an autopsy event from the sleuthkit HostCreationEvent * Publishes an autopsy event from the sleuthkit HostAddedEvent
* indicating that hosts have been created. * indicating that hosts have been created.
* *
* @param event The sleuthkit event for the creation of hosts. * @param event The sleuthkit event for the creation of hosts.
*/ */
@Subscribe @Subscribe
public void publishHostsAddedEvent(HostsCreationEvent event) { public void publishHostsAddedEvent(TskEvent.HostsAddedTskEvent event) {
eventPublisher.publish(new HostsAddedEvent( eventPublisher.publish(new HostsAddedEvent(
event == null ? Collections.emptyList() : event.getHosts())); event == null ? Collections.emptyList() : event.getHosts()));
} }
@ -543,9 +535,9 @@ public class Case {
* indicating that hosts have been updated. * indicating that hosts have been updated.
* *
* @param event The sleuthkit event for the updating of hosts. * @param event The sleuthkit event for the updating of hosts.
*/ */
@Subscribe @Subscribe
public void publishHostsChangedEvent(HostsUpdateEvent event) { public void publishHostsChangedEvent(TskEvent.HostsChangedTskEvent event) {
eventPublisher.publish(new HostsChangedEvent( eventPublisher.publish(new HostsChangedEvent(
event == null ? Collections.emptyList() : event.getHosts())); event == null ? Collections.emptyList() : event.getHosts()));
} }
@ -555,33 +547,33 @@ public class Case {
* indicating that hosts have been deleted. * indicating that hosts have been deleted.
* *
* @param event The sleuthkit event for the deleting of hosts. * @param event The sleuthkit event for the deleting of hosts.
*/ */
@Subscribe @Subscribe
public void publishHostsDeletedEvent(HostsDeletionEvent event) { public void publishHostsDeletedEvent(TskEvent.HostsDeletedTskEvent event) {
eventPublisher.publish(new HostsRemovedEvent( eventPublisher.publish(new HostsRemovedEvent(
event == null ? Collections.emptyList() : event.getHosts())); event == null ? Collections.emptyList() : event.getHosts()));
} }
/** /**
* Publishes an autopsy event from the sleuthkit PersonCreationEvent * Publishes an autopsy event from the sleuthkit PersonAddedEvent
* indicating that persons have been created. * indicating that persons have been created.
* *
* @param event The sleuthkit event for the creation of persons. * @param event The sleuthkit event for the creation of persons.
*/ */
@Subscribe @Subscribe
public void publishPersonsAddedEvent(PersonsCreationEvent event) { public void publishPersonsAddedEvent(TskEvent.PersonsAddedTskEvent event) {
eventPublisher.publish(new PersonsAddedEvent( eventPublisher.publish(new PersonsAddedEvent(
event == null ? Collections.emptyList() : event.getPersons())); event == null ? Collections.emptyList() : event.getPersons()));
} }
/** /**
* Publishes an autopsy event from the sleuthkit PersonUpdateEvent * Publishes an autopsy event from the sleuthkit PersonChangedEvent
* indicating that persons have been updated. * indicating that persons have been updated.
* *
* @param event The sleuthkit event for the updating of persons. * @param event The sleuthkit event for the updating of persons.
*/ */
@Subscribe @Subscribe
public void publishPersonsChangedEvent(PersonsUpdateEvent event) { public void publishPersonsChangedEvent(TskEvent.PersonsChangedTskEvent event) {
eventPublisher.publish(new PersonsChangedEvent( eventPublisher.publish(new PersonsChangedEvent(
event == null ? Collections.emptyList() : event.getPersons())); event == null ? Collections.emptyList() : event.getPersons()));
} }
@ -591,10 +583,10 @@ public class Case {
* indicating that persons have been deleted. * indicating that persons have been deleted.
* *
* @param event The sleuthkit event for the deleting of persons. * @param event The sleuthkit event for the deleting of persons.
*/ */
@Subscribe @Subscribe
public void publishPersonsDeletedEvent(PersonsDeletionEvent event) { public void publishPersonsDeletedEvent(TskEvent.PersonsDeletedTskEvent event) {
eventPublisher.publish(new PersonsRemovedEvent( eventPublisher.publish(new PersonsDeletedEvent(
event == null ? Collections.emptyList() : event.getPersons())); event == null ? Collections.emptyList() : event.getPersons()));
} }
} }
@ -1796,7 +1788,7 @@ public class Case {
} }
public void notifyOsAccountRemoved(Long osAccountObjectId) { public void notifyOsAccountRemoved(Long osAccountObjectId) {
eventPublisher.publish(new OsAccountRemovedEvent(osAccountObjectId)); eventPublisher.publish(new OsAccountDeletedEvent(osAccountObjectId));
} }
/** /**
@ -1850,7 +1842,7 @@ public class Case {
* @param person The person that has been deleted. * @param person The person that has been deleted.
*/ */
public void notifyPersonDeleted(Person person) { public void notifyPersonDeleted(Person person) {
eventPublisher.publish(new PersonsRemovedEvent(Collections.singletonList(person))); eventPublisher.publish(new PersonsDeletedEvent(Collections.singletonList(person)));
} }
/** /**

View File

@ -33,6 +33,8 @@ import org.sleuthkit.datamodel.TskCoreException;
*/ */
public class HostsEvent extends TskDataModelChangeEvent<Host> { public class HostsEvent extends TskDataModelChangeEvent<Host> {
private static final long serialVersionUID = 1L;
/** /**
* Retrieves a list of ids from a list of hosts. * Retrieves a list of ids from a list of hosts.
* *

View File

@ -27,11 +27,11 @@ import org.sleuthkit.autopsy.events.AutopsyEvent;
* oldValue will contain the objectId of the account that was removed. newValue * oldValue will contain the objectId of the account that was removed. newValue
* will be null. * will be null.
*/ */
public final class OsAccountRemovedEvent extends AutopsyEvent { public final class OsAccountDeletedEvent extends AutopsyEvent {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public OsAccountRemovedEvent(Long osAccountObjectId) { public OsAccountDeletedEvent(Long osAccountObjectId) {
super(Case.Events.OS_ACCOUNT_REMOVED.toString(), osAccountObjectId, null); super(Case.Events.OS_ACCOUNT_REMOVED.toString(), osAccountObjectId, null);
} }
} }

View File

@ -25,7 +25,7 @@ import org.sleuthkit.datamodel.Person;
/** /**
* Event fired when persons are removed. * Event fired when persons are removed.
*/ */
public class PersonsRemovedEvent extends PersonsEvent { public class PersonsDeletedEvent extends PersonsEvent {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -33,7 +33,7 @@ public class PersonsRemovedEvent extends PersonsEvent {
* Main constructor. * Main constructor.
* @param dataModelObjects The list of persons that have been deleted. * @param dataModelObjects The list of persons that have been deleted.
*/ */
public PersonsRemovedEvent(List<Person> dataModelObjects) { public PersonsDeletedEvent(List<Person> dataModelObjects) {
super(Case.Events.PERSONS_DELETED.name(), dataModelObjects); super(Case.Events.PERSONS_DELETED.name(), dataModelObjects);
} }
} }