Autopsy  4.19.3
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.sleuthkit.autopsy.coordinationservice.CoordinationService Class Reference

Classes

enum  CategoryNode
 
class  CoordinationServiceException
 
class  Lock
 

Public Member Functions

void deleteNode (CategoryNode category, String nodePath) throws CoordinationServiceException, InterruptedException
 
byte[] getNodeData (CategoryNode category, String nodePath) throws CoordinationServiceException, InterruptedException
 
List< String > getNodeList (CategoryNode category) throws CoordinationServiceException, InterruptedException
 
void setNodeData (CategoryNode category, String nodePath, byte[] data) throws CoordinationServiceException, InterruptedException
 
Lock tryGetExclusiveLock (CategoryNode category, String nodePath, int timeOut, TimeUnit timeUnit) throws CoordinationServiceException, InterruptedException
 
Lock tryGetExclusiveLock (CategoryNode category, String nodePath) throws CoordinationServiceException
 
Lock tryGetSharedLock (CategoryNode category, String nodePath, int timeOut, TimeUnit timeUnit) throws CoordinationServiceException, InterruptedException
 
Lock tryGetSharedLock (CategoryNode category, String nodePath) throws CoordinationServiceException
 

Static Public Member Functions

static synchronized CoordinationService getInstance () throws CoordinationServiceException
 

Private Member Functions

 CoordinationService (String rootNodeName) throws InterruptedException, IOException, KeeperException, CoordinationServiceException
 
String getFullyQualifiedNodePath (CategoryNode category, String nodePath)
 
String upsertNodePath (CategoryNode category, String nodePath) throws CoordinationServiceException
 

Private Attributes

final Map< String, String > categoryNodeToPath
 
final CuratorFramework curator
 

Static Private Attributes

static final int CONNECTION_TIMEOUT_MILLISECONDS = 300000
 
static final String DEFAULT_NAMESPACE_ROOT = "autopsy"
 
static CoordinationService instance
 
static final int PORT_OFFSET = 1000
 
static final int SESSION_TIMEOUT_MILLISECONDS = 300000
 

Detailed Description

A coordination service for maintaining configuration information and providing distributed synchronization using a shared hierarchical namespace of nodes.

Definition at line 51 of file CoordinationService.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.coordinationservice.CoordinationService.CoordinationService ( String  rootNodeName) throws InterruptedException, IOException, KeeperException, CoordinationServiceException
private

Member Function Documentation

void org.sleuthkit.autopsy.coordinationservice.CoordinationService.deleteNode ( CategoryNode  category,
String  nodePath 
) throws CoordinationServiceException, InterruptedException

Deletes a specified node.

Parameters
categoryThe desired category in the namespace.
nodePathThe node to be deleted.
Exceptions
CoordinationServiceExceptionIf there is an error deleting the node.
java.lang.InterruptedExceptionIf a thread interrupt occurs while blocked waiting for the operation to complete.

Definition at line 395 of file CoordinationService.java.

References org.sleuthkit.autopsy.coordinationservice.CoordinationService.curator, and org.sleuthkit.autopsy.coordinationservice.CoordinationService.getFullyQualifiedNodePath().

Referenced by org.sleuthkit.autopsy.casemodule.Case.deleteMultiUserCase().

String org.sleuthkit.autopsy.coordinationservice.CoordinationService.getFullyQualifiedNodePath ( CategoryNode  category,
String  nodePath 
)
private
static synchronized CoordinationService org.sleuthkit.autopsy.coordinationservice.CoordinationService.getInstance ( ) throws CoordinationServiceException
static
byte [] org.sleuthkit.autopsy.coordinationservice.CoordinationService.getNodeData ( CategoryNode  category,
String  nodePath 
) throws CoordinationServiceException, InterruptedException

Retrieve the data associated with the specified node.

Parameters
categoryThe desired category in the namespace.
nodePathThe node to retrieve the data for.
Returns
The data associated with the node, if any, or null if the node has not been created yet.
Exceptions
CoordinationServiceExceptionIf there is an error setting the node data.
InterruptedExceptionIf interrupted while blocked during setting of node data.

Definition at line 339 of file CoordinationService.java.

References org.sleuthkit.autopsy.coordinationservice.CoordinationService.curator, and org.sleuthkit.autopsy.coordinationservice.CoordinationService.upsertNodePath().

Referenced by org.sleuthkit.autopsy.casemodule.multiusercases.CaseNodeData.readCaseNodeData().

List<String> org.sleuthkit.autopsy.coordinationservice.CoordinationService.getNodeList ( CategoryNode  category) throws CoordinationServiceException, InterruptedException

Gets a list of the child nodes of a category in the namespace.

Parameters
categoryThe desired category in the namespace.
Returns
A list of child node names.
Exceptions
CoordinationServiceExceptionIf there is an error getting the node list.
java.lang.InterruptedExceptionIf a thread interrupt occurs while blocked waiting for the operation to complete.

Definition at line 421 of file CoordinationService.java.

References org.sleuthkit.autopsy.coordinationservice.CoordinationService.categoryNodeToPath, and org.sleuthkit.autopsy.coordinationservice.CoordinationService.curator.

Referenced by org.sleuthkit.autopsy.casemodule.multiusercases.CaseNodeDataCollector.getNodeData().

void org.sleuthkit.autopsy.coordinationservice.CoordinationService.setNodeData ( CategoryNode  category,
String  nodePath,
byte[]  data 
) throws CoordinationServiceException, InterruptedException

Store the given data with the specified node.

Parameters
categoryThe desired category in the namespace.
nodePathThe node to associate the data with.
dataThe data to store with the node.
Exceptions
CoordinationServiceExceptionIf there is an error setting the node data.
InterruptedExceptionIf interrupted while blocked during setting of node data.

Definition at line 370 of file CoordinationService.java.

References org.sleuthkit.autopsy.coordinationservice.CoordinationService.curator, and org.sleuthkit.autopsy.coordinationservice.CoordinationService.getFullyQualifiedNodePath().

Referenced by org.sleuthkit.autopsy.casemodule.multiusercases.CaseNodeData.createCaseNodeData(), and org.sleuthkit.autopsy.casemodule.multiusercases.CaseNodeData.writeCaseNodeData().

Lock org.sleuthkit.autopsy.coordinationservice.CoordinationService.tryGetExclusiveLock ( CategoryNode  category,
String  nodePath,
int  timeOut,
TimeUnit  timeUnit 
) throws CoordinationServiceException, InterruptedException

Tries to get an exclusive lock on a node path appended to a category path in the namespace managed by this coordination service. Blocks until the lock is obtained or the time out expires.

IMPORTANT: The lock needs to be released in the same thread in which it is acquired.

Parameters
categoryThe desired category in the namespace.
nodePathThe node path to use as the basis for the lock.
timeOutLength of the time out.
timeUnitTime unit for the time out.
Returns
The lock, or null if lock acquisition timed out.
Exceptions
CoordinationServiceExceptionIf there is an error during lock acquisition.
InterruptedExceptionIf interrupted while blocked during lock acquisition.

Definition at line 203 of file CoordinationService.java.

References org.sleuthkit.autopsy.coordinationservice.CoordinationService.curator, and org.sleuthkit.autopsy.coordinationservice.CoordinationService.upsertNodePath().

Referenced by org.sleuthkit.autopsy.casemodule.Case.acquireCaseLock(), org.sleuthkit.autopsy.casemodule.Case.acquireCaseResourcesLock(), org.sleuthkit.autopsy.casemodule.Case.deleteMultiUserCase(), and org.sleuthkit.autopsy.healthmonitor.HealthMonitor.getExclusiveDbLock().

Lock org.sleuthkit.autopsy.coordinationservice.CoordinationService.tryGetExclusiveLock ( CategoryNode  category,
String  nodePath 
) throws CoordinationServiceException

Tries to get an exclusive lock on a node path appended to a category path in the namespace managed by this coordination service. Returns immediately if the lock can not be acquired.

IMPORTANT: The lock needs to be released in the same thread in which it is acquired.

Parameters
categoryThe desired category in the namespace.
nodePathThe node path to use as the basis for the lock.
Returns
The lock, or null if the lock could not be obtained.
Exceptions
CoordinationServiceExceptionIf there is an error during lock acquisition.

Definition at line 239 of file CoordinationService.java.

References org.sleuthkit.autopsy.coordinationservice.CoordinationService.curator, and org.sleuthkit.autopsy.coordinationservice.CoordinationService.upsertNodePath().

Lock org.sleuthkit.autopsy.coordinationservice.CoordinationService.tryGetSharedLock ( CategoryNode  category,
String  nodePath,
int  timeOut,
TimeUnit  timeUnit 
) throws CoordinationServiceException, InterruptedException

Tries to get a shared lock on a node path appended to a category path in the namespace managed by this coordination service. Blocks until the lock is obtained or the time out expires.

IMPORTANT: The lock needs to be released in the same thread in which it is acquired.

Parameters
categoryThe desired category in the namespace.
nodePathThe node path to use as the basis for the lock.
timeOutLength of the time out.
timeUnitTime unit for the time out.
Returns
The lock, or null if lock acquisition timed out.
Exceptions
CoordinationServiceExceptionIf there is an error during lock acquisition.
InterruptedExceptionIf interrupted while blocked during lock acquisition.

Definition at line 274 of file CoordinationService.java.

References org.sleuthkit.autopsy.coordinationservice.CoordinationService.curator, and org.sleuthkit.autopsy.coordinationservice.CoordinationService.upsertNodePath().

Referenced by org.sleuthkit.autopsy.casemodule.Case.acquireCaseLock(), and org.sleuthkit.autopsy.healthmonitor.HealthMonitor.getSharedDbLock().

Lock org.sleuthkit.autopsy.coordinationservice.CoordinationService.tryGetSharedLock ( CategoryNode  category,
String  nodePath 
) throws CoordinationServiceException

Tries to get a shared lock on a node path appended to a category path in the namespace managed by this coordination service. Returns immediately if the lock can not be acquired.

IMPORTANT: The lock needs to be released in the same thread in which it is acquired.

Parameters
categoryThe desired category in the namespace.
nodePathThe node path to use as the basis for the lock.
Returns
The lock, or null if the lock could not be obtained.
Exceptions
CoordinationServiceExceptionIf there is an error during lock acquisition.

Definition at line 310 of file CoordinationService.java.

References org.sleuthkit.autopsy.coordinationservice.CoordinationService.curator, and org.sleuthkit.autopsy.coordinationservice.CoordinationService.upsertNodePath().

String org.sleuthkit.autopsy.coordinationservice.CoordinationService.upsertNodePath ( CategoryNode  category,
String  nodePath 
) throws CoordinationServiceException
private

Member Data Documentation

final Map<String, String> org.sleuthkit.autopsy.coordinationservice.CoordinationService.categoryNodeToPath
private
final int org.sleuthkit.autopsy.coordinationservice.CoordinationService.CONNECTION_TIMEOUT_MILLISECONDS = 300000
staticprivate

Definition at line 54 of file CoordinationService.java.

final CuratorFramework org.sleuthkit.autopsy.coordinationservice.CoordinationService.curator
private
final String org.sleuthkit.autopsy.coordinationservice.CoordinationService.DEFAULT_NAMESPACE_ROOT = "autopsy"
staticprivate
CoordinationService org.sleuthkit.autopsy.coordinationservice.CoordinationService.instance
staticprivate
final int org.sleuthkit.autopsy.coordinationservice.CoordinationService.PORT_OFFSET = 1000
staticprivate

Definition at line 55 of file CoordinationService.java.

final int org.sleuthkit.autopsy.coordinationservice.CoordinationService.SESSION_TIMEOUT_MILLISECONDS = 300000
staticprivate

Definition at line 53 of file CoordinationService.java.


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

Copyright © 2012-2022 Basis Technology. Generated on: Fri Sep 30 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.