host dao main dao

This commit is contained in:
Greg DiCristofaro 2022-02-16 15:24:14 -05:00
parent 92ec7b2e42
commit 296c7605d8
3 changed files with 137 additions and 2 deletions

View File

@ -0,0 +1,61 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2022 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> 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<? extends DAOEvent> processEvent(PropertyChangeEvent evt) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
Set<? extends DAOEvent> handleIngestComplete() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
Set<? extends TreeEvent> shouldRefreshTree() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}

View File

@ -171,7 +171,9 @@ public class MainDAO extends AbstractDAO {
private final CommAccountsDAO commAccountsDAO = CommAccountsDAO.getInstance(); private final CommAccountsDAO commAccountsDAO = CommAccountsDAO.getInstance();
private final CreditCardDAO creditCardDAO = CreditCardDAO.getInstance(); private final CreditCardDAO creditCardDAO = CreditCardDAO.getInstance();
private final EmailsDAO emailsDAO = EmailsDAO.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. // NOTE: whenever adding a new sub-dao, it should be added to this list for event updates.
private final List<AbstractDAO> allDAOs = ImmutableList.of( private final List<AbstractDAO> allDAOs = ImmutableList.of(
dataArtifactDAO, dataArtifactDAO,
@ -182,7 +184,9 @@ public class MainDAO extends AbstractDAO {
osAccountsDAO, osAccountsDAO,
commAccountsDAO, commAccountsDAO,
creditCardDAO, creditCardDAO,
emailsDAO); emailsDAO,
hostDAO,
personDAO);
/** /**
* Registers listeners with autopsy event publishers and starts internal * Registers listeners with autopsy event publishers and starts internal
@ -254,6 +258,15 @@ public class MainDAO extends AbstractDAO {
return creditCardDAO; return creditCardDAO;
} }
public HostDAO getHostDAO() {
return hostDAO;
}
public PersonDAO getPersonDAO() {
return personDAO;
}
public PropertyChangeManager getResultEventsManager() { public PropertyChangeManager getResultEventsManager() {
return this.resultEventsManager; return this.resultEventsManager;
} }

View File

@ -0,0 +1,61 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2022 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> 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<? extends DAOEvent> processEvent(PropertyChangeEvent evt) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
Set<? extends DAOEvent> handleIngestComplete() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
@Override
Set<? extends TreeEvent> shouldRefreshTree() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}