Sleuth Kit Java Bindings (JNI) 4.14.0
Java bindings for using The Sleuth Kit
Loading...
Searching...
No Matches
org.sleuthkit.datamodel.HostManager Class Reference

Public Member Functions

Long deleteHost (String name) throws TskCoreException
List< HostgetAllHosts () throws TskCoreException
List< DataSourcegetDataSourcesForHost (Host host) throws TskCoreException
Host getHostByDataSource (DataSource dataSource) throws TskCoreException
Optional< HostgetHostById (long id) throws TskCoreException
Optional< HostgetHostByName (String name) throws TskCoreException
void mergeHosts (Host sourceHost, Host destHost) throws TskCoreException
Host newHost (String name) throws TskCoreException
Host updateHostName (Host host, String newName) throws TskCoreException

Detailed Description

Responsible for creating/updating/retrieving Hosts.

Definition at line 41 of file HostManager.java.

Member Function Documentation

◆ deleteHost()

Long org.sleuthkit.datamodel.HostManager.deleteHost ( String name) throws TskCoreException

Delete a host. Name comparison is case-insensitive.

Parameters
nameName of the host to delete.
Returns
The id of the deleted host or null if no host was deleted.
Exceptions
TskCoreException

Definition at line 213 of file HostManager.java.

References org.sleuthkit.datamodel.SleuthkitCase.beginTransaction(), org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.commit(), and org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.rollback().

◆ getAllHosts()

List< Host > org.sleuthkit.datamodel.HostManager.getAllHosts ( ) throws TskCoreException

Get all hosts that have a status of ACTIVE.

Returns
Collection of hosts that have ACTIVE status.
Exceptions
TskCoreException

Definition at line 407 of file HostManager.java.

References org.sleuthkit.datamodel.Host.HostDbStatus.ACTIVE, and org.sleuthkit.datamodel.Host.HostDbStatus.fromID().

◆ getDataSourcesForHost()

List< DataSource > org.sleuthkit.datamodel.HostManager.getDataSourcesForHost ( Host host) throws TskCoreException

Get all data sources associated with a given host.

Parameters
hostThe host.
Returns
The list of data sources corresponding to the host.
Exceptions
TskCoreException

Definition at line 283 of file HostManager.java.

◆ getHostByDataSource()

Host org.sleuthkit.datamodel.HostManager.getHostByDataSource ( DataSource dataSource) throws TskCoreException

Get host for the given data source.

Parameters
dataSourceThe data source to look up the host for.
Returns
The host for this data source (will not be null).
Exceptions
TskCoreExceptionif no host is found or an error occurs.

Definition at line 437 of file HostManager.java.

References getHostByDataSource().

Referenced by org.sleuthkit.datamodel.Image.getHost(), org.sleuthkit.datamodel.LocalFilesDataSource.getHost(), and getHostByDataSource().

◆ getHostById()

Optional< Host > org.sleuthkit.datamodel.HostManager.getHostById ( long id) throws TskCoreException

Get host with the given id.

Parameters
idThe id of the host.
Returns
Optional with host. Optional.empty if no matching host is found.
Exceptions
TskCoreException

Definition at line 364 of file HostManager.java.

References getHostById().

Referenced by getHostById(), and updateHostName().

◆ getHostByName()

Optional< Host > org.sleuthkit.datamodel.HostManager.getHostByName ( String name) throws TskCoreException

Get active host with given name.

Parameters
nameHost name to look for.
Returns
Optional with host. Optional.empty if no matching host is found.
Exceptions
TskCoreException

Definition at line 313 of file HostManager.java.

References getHostByName().

Referenced by getHostByName().

◆ mergeHosts()

void org.sleuthkit.datamodel.HostManager.mergeHosts ( Host sourceHost,
Host destHost ) throws TskCoreException

Merge source host into destination host. When complete: - All realms will have been moved into the destination host or merged with existing realms in the destination host. - All references to the source host will be updated to reference the destination host. - The source host will be updated so that it will no longer be returned by any methods apart from get by host id.

Parameters
sourceHostThe source host.
destHostThe destination host.
Exceptions
TskCoreException

Definition at line 486 of file HostManager.java.

References org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.commit(), org.sleuthkit.datamodel.Host.HostDbStatus.MERGED, and org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.rollback().

◆ newHost()

Host org.sleuthkit.datamodel.HostManager.newHost ( String name) throws TskCoreException

Create a host with specified name. If a host already exists with the given name, it returns the existing host.

Parameters
nameHost name.
Returns
Host with the specified name.
Exceptions
TskCoreException

Definition at line 65 of file HostManager.java.

References org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.commit(), newHost(), and org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.rollback().

Referenced by org.sleuthkit.datamodel.SleuthkitCase.addImage(), org.sleuthkit.datamodel.SleuthkitCase.addLocalFilesDataSource(), and newHost().

◆ updateHostName()

Host org.sleuthkit.datamodel.HostManager.updateHostName ( Host host,
String newName ) throws TskCoreException

Updates the name of the provided host.

Parameters
hostThe host to be updated.
newNameThe new name of the host.
Returns
The updated host.
Exceptions
TskCoreException

Definition at line 164 of file HostManager.java.

References org.sleuthkit.datamodel.Host.HostDbStatus.ACTIVE, and getHostById().


The documentation for this class was generated from the following file:
  • /home/carriersleuth/repos/sleuthkit/bindings/java/src/org/sleuthkit/datamodel/HostManager.java

Copyright © 2011-2024 Brian Carrier. (carrier -at- sleuthkit -dot- org)
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.