diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectHostVisual.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectHostVisual.java index 4ab37d01b5..07eaf84104 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectHostVisual.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardSelectHostVisual.java @@ -166,7 +166,7 @@ class AddImageWizardSelectHostVisual extends javax.swing.JPanel { if (specifyNewHostRadio.isSelected() && StringUtils.isNotEmpty(specifyNewHostTextField.getText())) { String newHostName = specifyNewHostTextField.getText(); try { - return Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().createHost(newHostName); + return Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().newHost(newHostName); } catch (NoCurrentCaseException | TskCoreException ex) { logger.log(Level.WARNING, String.format("Unable to create host '%s'.", newHostName), ex); return null; @@ -186,7 +186,7 @@ class AddImageWizardSelectHostVisual extends javax.swing.JPanel { */ private void loadHostData() { try { - Collection hosts = Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().getHosts(); + Collection hosts = Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().getAllHosts(); sanitizedHostSet = HostNameValidator.getSanitizedHostNames(hosts); Vector hostListItems = hosts.stream() diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/events/HostsEvent.java b/Core/src/org/sleuthkit/autopsy/casemodule/events/HostsEvent.java index f37a159125..efa60c8b47 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/events/HostsEvent.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/events/HostsEvent.java @@ -76,7 +76,7 @@ public class HostsEvent extends TskDataModelChangeEvent { continue; } - Optional thisHostOpt = hostManager.getHost(id); + Optional thisHostOpt = hostManager.getHostById(id); thisHostOpt.ifPresent((h) -> toRet.add(h)); } } diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/osaccount/OsAccountDataPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/osaccount/OsAccountDataPanel.java index c1966cb067..a9bd423a78 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/osaccount/OsAccountDataPanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/osaccount/OsAccountDataPanel.java @@ -390,7 +390,7 @@ public class OsAccountDataPanel extends JPanel { account = osAccountManager.getOsAccountByObjectId(accountId); } - OsAccountRealm realm = skCase.getOsAccountRealmManager().getRealmById(account.getRealmId()); + OsAccountRealm realm = skCase.getOsAccountRealmManager().getRealmByRealmId(account.getRealmId()); List hosts = osAccountManager.getHosts(account); List attributeList = account.getOsAccountAttributes(); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/AutopsyTreeChildFactory.java b/Core/src/org/sleuthkit/autopsy/datamodel/AutopsyTreeChildFactory.java index c909ddaad3..22b340d5f1 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/AutopsyTreeChildFactory.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/AutopsyTreeChildFactory.java @@ -115,7 +115,7 @@ public final class AutopsyTreeChildFactory extends ChildFactory.Detachable toPopulate) { try { - Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().getHosts().stream() + Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().getAllHosts().stream() .map(HostDataSources::new) .sorted() .forEach(toPopulate::add); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/OsAccounts.java b/Core/src/org/sleuthkit/autopsy/datamodel/OsAccounts.java index 556b247164..4b2588c6bb 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/OsAccounts.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/OsAccounts.java @@ -146,7 +146,7 @@ public final class OsAccounts implements AutopsyVisitableItem { if (filteringDSObjId == 0) { list.addAll(skCase.getOsAccountManager().getOsAccounts()); } else { - Host host = skCase.getHostManager().getHost(skCase.getDataSource(filteringDSObjId)); + Host host = skCase.getHostManager().getHostByDataSource(skCase.getDataSource(filteringDSObjId)); list.addAll(skCase.getOsAccountManager().getOsAccounts(host)); } } catch (TskCoreException | TskDataException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/hosts/AssociateNewPersonAction.java b/Core/src/org/sleuthkit/autopsy/datamodel/hosts/AssociateNewPersonAction.java index bea7f7b372..2cb89995c6 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/hosts/AssociateNewPersonAction.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/hosts/AssociateNewPersonAction.java @@ -65,7 +65,7 @@ public class AssociateNewPersonAction extends AbstractAction { try { newPersonName = getAddDialogName(); if (StringUtils.isNotBlank(newPersonName)) { - Person person = Case.getCurrentCaseThrows().getSleuthkitCase().getPersonManager().createPerson(newPersonName); + Person person = Case.getCurrentCaseThrows().getSleuthkitCase().getPersonManager().newPerson(newPersonName); Case.getCurrentCaseThrows().getSleuthkitCase().getPersonManager().setPerson(host, person); } } catch (NoCurrentCaseException | TskCoreException ex) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/hosts/ManageHostsDialog.java b/Core/src/org/sleuthkit/autopsy/datamodel/hosts/ManageHostsDialog.java index 7d4d521b51..9e55b96c9d 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/hosts/ManageHostsDialog.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/hosts/ManageHostsDialog.java @@ -166,7 +166,7 @@ public class ManageHostsDialog extends javax.swing.JDialog { if (newHostName != null) { Long selectedId = null; try { - Host newHost = Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().createHost(newHostName); + Host newHost = Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().newHost(newHostName); selectedId = newHost == null ? null : newHost.getHostId(); } catch (NoCurrentCaseException | TskCoreException e) { logger.log(Level.WARNING, String.format("Unable to add new host '%s' at this time.", newHostName), e); @@ -322,7 +322,7 @@ public class ManageHostsDialog extends javax.swing.JDialog { Map> hostMapping = new HashMap<>(); try { SleuthkitCase curCase = Case.getCurrentCaseThrows().getSleuthkitCase(); - List hosts = curCase.getHostManager().getHosts(); + List hosts = curCase.getHostManager().getAllHosts(); List dataSources = curCase.getDataSources(); if (dataSources != null) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/hosts/MergeHostMenuAction.java b/Core/src/org/sleuthkit/autopsy/datamodel/hosts/MergeHostMenuAction.java index 8b8ddc3f23..5517687434 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/hosts/MergeHostMenuAction.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/hosts/MergeHostMenuAction.java @@ -67,7 +67,7 @@ public class MergeHostMenuAction extends AbstractAction implements Presenter.Pop // Get a list of all other hosts List otherHosts = Collections.emptyList(); try { - otherHosts = Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().getHosts(); + otherHosts = Case.getCurrentCaseThrows().getSleuthkitCase().getHostManager().getAllHosts(); otherHosts.remove(sourceHost); } catch (NoCurrentCaseException | TskCoreException ex) { logger.log(Level.WARNING, "Error getting hosts for case.", ex); diff --git a/Core/src/org/sleuthkit/autopsy/report/modules/portablecase/PortableCaseReportModule.java b/Core/src/org/sleuthkit/autopsy/report/modules/portablecase/PortableCaseReportModule.java index 56bb8e9133..f8dbebe224 100644 --- a/Core/src/org/sleuthkit/autopsy/report/modules/portablecase/PortableCaseReportModule.java +++ b/Core/src/org/sleuthkit/autopsy/report/modules/portablecase/PortableCaseReportModule.java @@ -1085,7 +1085,7 @@ public class PortableCaseReportModule implements ReportModule { Host newHost = null; if (content instanceof DataSource) { Host oldHost = ((DataSource)content).getHost(); - newHost = portableSkCase.getHostManager().createHost(oldHost.getName()); + newHost = portableSkCase.getHostManager().newHost(oldHost.getName()); } CaseDbTransaction trans = portableSkCase.beginTransaction(); diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java index 0c5cd988db..98f5bb9fee 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/ExtractRegistry.java @@ -1079,7 +1079,7 @@ class ExtractRegistry extends Extract { // New OsAccount Code OsAccountManager accountMgr = tskCase.getOsAccountManager(); HostManager hostMrg = tskCase.getHostManager(); - Host host = hostMrg.getHost((DataSource)dataSource); + Host host = hostMrg.getHostByDataSource((DataSource)dataSource); List existingAccounts = accountMgr.getOsAccounts(host); for(OsAccount osAccount: existingAccounts) { @@ -1097,8 +1097,8 @@ class ExtractRegistry extends Extract { //add remaining userinfos as accounts; for (Map userInfo : userInfoMap.values()) { - OsAccount osAccount = accountMgr.createWindowsOsAccount(userInfo.get(SID_KEY), null, null, host, OsAccountRealm.RealmScope.UNKNOWN); - accountMgr.createOsAccountInstance(osAccount, (DataSource)dataSource, OsAccountInstance.OsAccountInstanceType.LAUNCHED); + OsAccount osAccount = accountMgr.newWindowsOsAccount(userInfo.get(SID_KEY), null, null, host, OsAccountRealm.RealmScope.UNKNOWN); + accountMgr.newOsAccountInstance(osAccount, (DataSource)dataSource, OsAccountInstance.OsAccountInstanceType.LAUNCHED); updateOsAccount(osAccount, userInfo, groupMap.get(userInfo.get(SID_KEY)), regAbstractFile); } @@ -1967,13 +1967,13 @@ class ExtractRegistry extends Extract { private void createOrUpdateOsAccount(AbstractFile file, String sid, String userName, String homeDir) throws TskCoreException, TskDataException, NotUserSIDException { OsAccountManager accountMgr = tskCase.getOsAccountManager(); HostManager hostMrg = tskCase.getHostManager(); - Host host = hostMrg.getHost((DataSource)dataSource); + Host host = hostMrg.getHostByDataSource((DataSource)dataSource); Optional optional = accountMgr.getWindowsOsAccount(sid, null, null, host); OsAccount osAccount; if (!optional.isPresent()) { - osAccount = accountMgr.createWindowsOsAccount(sid, userName != null && userName.isEmpty() ? null : userName, null, host, OsAccountRealm.RealmScope.UNKNOWN); - accountMgr.createOsAccountInstance(osAccount, (DataSource)dataSource, OsAccountInstance.OsAccountInstanceType.LAUNCHED); + osAccount = accountMgr.newWindowsOsAccount(sid, userName != null && userName.isEmpty() ? null : userName, null, host, OsAccountRealm.RealmScope.UNKNOWN); + accountMgr.newOsAccountInstance(osAccount, (DataSource)dataSource, OsAccountInstance.OsAccountInstanceType.LAUNCHED); } else { osAccount = optional.get(); if (userName != null && !userName.isEmpty()) {