Autopsy  4.7.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static 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

byte[] getNodeData (CategoryNode category, String nodePath) throws CoordinationServiceException, InterruptedException
 
List< String > getNodeList (CategoryNode category) throws CoordinationServiceException
 
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)
 

Static Private Member Functions

static boolean isZooKeeperAccessible () throws InterruptedException, IOException
 

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
 
static final int ZOOKEEPER_CONNECTION_TIMEOUT_MILLIS = 15000
 
static final int ZOOKEEPER_SESSION_TIMEOUT_MILLIS = 3000
 

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

Constructs an instance of the coordination service for a specific namespace.

Parameters
rootNodeNameThe name of the root node that defines the namespace.
Exceptions
Exception(calls Curator methods that throw Exception instead of more specific exceptions)

Definition at line 133 of file CoordinationService.java.

References org.sleuthkit.autopsy.coordinationservice.CoordinationService.categoryNodeToPath, org.sleuthkit.autopsy.coordinationservice.CoordinationService.curator, org.sleuthkit.autopsy.core.UserPreferences.getIndexingServerHost(), org.sleuthkit.autopsy.core.UserPreferences.getIndexingServerPort(), and org.sleuthkit.autopsy.coordinationservice.CoordinationService.isZooKeeperAccessible().

Referenced by org.sleuthkit.autopsy.coordinationservice.CoordinationService.getInstance().

Member Function Documentation

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 320 of file CoordinationService.java.

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

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

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.

Definition at line 370 of file CoordinationService.java.

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

Referenced by org.sleuthkit.autopsy.casemodule.CaseBrowser.LoadCaseListWorker.getCases().

static boolean org.sleuthkit.autopsy.coordinationservice.CoordinationService.isZooKeeperAccessible ( ) throws InterruptedException, IOException
staticprivate

Determines if ZooKeeper is accessible with the current settings. Closes the connection prior to returning.

Returns
true if a connection was achieved, false otherwise
Exceptions
InterruptedException
IOException

Definition at line 74 of file CoordinationService.java.

References org.sleuthkit.autopsy.core.UserPreferences.getIndexingServerHost(), and org.sleuthkit.autopsy.core.UserPreferences.getIndexingServerPort().

Referenced by org.sleuthkit.autopsy.coordinationservice.CoordinationService.CoordinationService().

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 347 of file CoordinationService.java.

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

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 192 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.acquireExclusiveCaseResourcesLock(), org.sleuthkit.autopsy.casemodule.Case.deleteCase(), and org.sleuthkit.autopsy.healthmonitor.EnterpriseHealthMonitor.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 226 of file CoordinationService.java.

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

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 259 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.acquireSharedCaseDirLock(), and org.sleuthkit.autopsy.healthmonitor.EnterpriseHealthMonitor.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 293 of file CoordinationService.java.

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

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 57 of file CoordinationService.java.

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

Definition at line 53 of file CoordinationService.java.

final int org.sleuthkit.autopsy.coordinationservice.CoordinationService.ZOOKEEPER_CONNECTION_TIMEOUT_MILLIS = 15000
staticprivate

Definition at line 56 of file CoordinationService.java.

final int org.sleuthkit.autopsy.coordinationservice.CoordinationService.ZOOKEEPER_SESSION_TIMEOUT_MILLIS = 3000
staticprivate

Definition at line 55 of file CoordinationService.java.


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

Copyright © 2012-2016 Basis Technology. Generated on: Mon Jun 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.