Sleuth Kit Java Bindings (JNI)  4.11.0
Java bindings for using The Sleuth Kit
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

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().

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.SleuthkitCase.acquireSingleUserCaseReadLock(), and org.sleuthkit.datamodel.SleuthkitCase.releaseSingleUserCaseReadLock().

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.

References org.sleuthkit.datamodel.SleuthkitCase.acquireSingleUserCaseReadLock(), org.sleuthkit.datamodel.SleuthkitCase.getDataSource(), and org.sleuthkit.datamodel.SleuthkitCase.releaseSingleUserCaseReadLock().

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.

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

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.

Referenced by org.sleuthkit.datamodel.HostManager.updateHostName().

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.

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.beginTransaction(), org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.commit(), org.sleuthkit.datamodel.SleuthkitCase.getOsAccountRealmManager(), and org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.rollback().

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.beginTransaction(), org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.commit(), and org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction.rollback().

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

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.SleuthkitCase.acquireSingleUserCaseWriteLock(), org.sleuthkit.datamodel.HostManager.getHostById(), and org.sleuthkit.datamodel.SleuthkitCase.releaseSingleUserCaseWriteLock().


The documentation for this class was generated from the following file:

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