diff --git a/Core/src/org/sleuthkit/autopsy/mainui/datamodel/HostDAO.java b/Core/src/org/sleuthkit/autopsy/mainui/datamodel/HostDAO.java new file mode 100644 index 0000000000..366501acfb --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/mainui/datamodel/HostDAO.java @@ -0,0 +1,61 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2022 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.mainui.datamodel; + +import java.beans.PropertyChangeEvent; +import java.util.Set; +import org.sleuthkit.autopsy.mainui.datamodel.events.DAOEvent; +import org.sleuthkit.autopsy.mainui.datamodel.events.TreeEvent; + +/** + * + * Dao for hosts. + */ +public class HostDAO extends AbstractDAO { + + private static HostDAO instance = null; + + public static HostDAO getInstance() { + if (instance == null) { + instance = new HostDAO(); + } + return instance; + } + + @Override + void clearCaches() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + Set processEvent(PropertyChangeEvent evt) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + Set handleIngestComplete() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + Set shouldRefreshTree() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +} diff --git a/Core/src/org/sleuthkit/autopsy/mainui/datamodel/MainDAO.java b/Core/src/org/sleuthkit/autopsy/mainui/datamodel/MainDAO.java index 54ba5179dc..51b4bdaba1 100644 --- a/Core/src/org/sleuthkit/autopsy/mainui/datamodel/MainDAO.java +++ b/Core/src/org/sleuthkit/autopsy/mainui/datamodel/MainDAO.java @@ -171,7 +171,9 @@ public class MainDAO extends AbstractDAO { private final CommAccountsDAO commAccountsDAO = CommAccountsDAO.getInstance(); private final CreditCardDAO creditCardDAO = CreditCardDAO.getInstance(); private final EmailsDAO emailsDAO = EmailsDAO.getInstance(); - + private final HostDAO hostDAO = HostDAO.getInstance(); + private final PersonDAO personDAO = PersonDAO.getInstance(); + // NOTE: whenever adding a new sub-dao, it should be added to this list for event updates. private final List allDAOs = ImmutableList.of( dataArtifactDAO, @@ -182,7 +184,9 @@ public class MainDAO extends AbstractDAO { osAccountsDAO, commAccountsDAO, creditCardDAO, - emailsDAO); + emailsDAO, + hostDAO, + personDAO); /** * Registers listeners with autopsy event publishers and starts internal @@ -254,6 +258,15 @@ public class MainDAO extends AbstractDAO { return creditCardDAO; } + public HostDAO getHostDAO() { + return hostDAO; + } + + public PersonDAO getPersonDAO() { + return personDAO; + } + + public PropertyChangeManager getResultEventsManager() { return this.resultEventsManager; } diff --git a/Core/src/org/sleuthkit/autopsy/mainui/datamodel/PersonDAO.java b/Core/src/org/sleuthkit/autopsy/mainui/datamodel/PersonDAO.java new file mode 100644 index 0000000000..a62e404d60 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/mainui/datamodel/PersonDAO.java @@ -0,0 +1,61 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2022 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.mainui.datamodel; + +import java.beans.PropertyChangeEvent; +import java.util.Set; +import org.sleuthkit.autopsy.mainui.datamodel.events.DAOEvent; +import org.sleuthkit.autopsy.mainui.datamodel.events.TreeEvent; + +/** + * + * Dao for hosts. + */ +public class PersonDAO extends AbstractDAO { + + private static HostDAO instance = null; + + public static PersonDAO getInstance() { + if (instance == null) { + instance = new PersonDAO(); + } + return instance; + } + + @Override + void clearCaches() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + Set processEvent(PropertyChangeEvent evt) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + Set handleIngestComplete() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + Set shouldRefreshTree() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +}