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.core.ServicesMonitor Class Reference

Classes

enum  Service
 
class  ServicesMonitorException
 
class  ServicesMonitoringTask
 
enum  ServiceStatus
 

Public Member Functions

void addSubscriber (PropertyChangeListener subscriber)
 
void addSubscriber (Set< String > services, PropertyChangeListener subscriber)
 
void addSubscriber (String service, PropertyChangeListener subscriber)
 
String getServiceStatus (String service) throws ServicesMonitorException
 
void removeSubscriber (PropertyChangeListener subscriber)
 
void removeSubscriber (Set< String > services, PropertyChangeListener subscriber)
 
void removeSubscriber (String service, PropertyChangeListener subscriber)
 
void setServiceStatus (String service, String status, String details)
 

Static Public Member Functions

static synchronized ServicesMonitor getInstance ()
 

Private Member Functions

 ServicesMonitor ()
 
void checkAllServices ()
 
void checkDatabaseConnectionStatus ()
 
void checkKeywordSearchServerConnectionStatus ()
 
void checkMessagingServerConnectionStatus ()
 
void checkServiceStatus (String service)
 

Private Attributes

final AutopsyEventPublisher eventPublisher
 
final ScheduledThreadPoolExecutor periodicTasksExecutor
 
final ConcurrentHashMap< String, String > statusByService
 

Static Private Attributes

static final Set< String > coreServices = Stream.of(ServicesMonitor.Service.values()).map(Service::toString).collect(Collectors.toSet())
 
static final long CRASH_DETECTION_INTERVAL_MINUTES = 15
 
static final Logger logger = Logger.getLogger(ServicesMonitor.class.getName())
 
static final int NUMBER_OF_PERIODIC_TASK_THREADS = 1
 
static final String PERIODIC_TASK_THREAD_NAME = "services-monitor-periodic-task-%d"
 
static ServicesMonitor servicesMonitor = new ServicesMonitor()
 

Detailed Description

Monitors the status of services and publishes events and user notifications when the status of a service changes. The database server, keyword search server, and messaging service are considered to be core services in a collaborative, multi-user case environment. Additional services can provide current status by calling the setServiceStatus() method.

Definition at line 51 of file ServicesMonitor.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.core.ServicesMonitor.ServicesMonitor ( )
private

Constructs a services monitor that monitors the status of services and publishes events and user notifications when the status of a service changes.

Start a periodic task to do ongoing service status checks.

Definition at line 112 of file ServicesMonitor.java.

References org.sleuthkit.autopsy.core.ServicesMonitor.checkAllServices().

Referenced by org.sleuthkit.autopsy.core.ServicesMonitor.getInstance().

Member Function Documentation

void org.sleuthkit.autopsy.core.ServicesMonitor.addSubscriber ( PropertyChangeListener  subscriber)

Adds a subscriber to service status events for the core services.

Parameters
subscriberThe subscriber to add.

Definition at line 208 of file ServicesMonitor.java.

References org.sleuthkit.autopsy.events.AutopsyEventPublisher.addSubscriber().

Referenced by org.sleuthkit.autopsy.ingest.IngestManager.subscribeToServiceMonitorEvents().

void org.sleuthkit.autopsy.core.ServicesMonitor.addSubscriber ( Set< String >  services,
PropertyChangeListener  subscriber 
)

Adds a subscriber to service status events for a subset of the services known to the services monitor.

Parameters
servicesThe services the subscriber is interested in.
subscriberThe subscriber to add.

Definition at line 219 of file ServicesMonitor.java.

References org.sleuthkit.autopsy.events.AutopsyEventPublisher.addSubscriber().

void org.sleuthkit.autopsy.core.ServicesMonitor.addSubscriber ( String  service,
PropertyChangeListener  subscriber 
)

Adds a subscriber to service status events for a specific service known to the services monitor.

Parameters
serviceThe service the subscriber is interested in.
subscriberThe subscriber to add.

Definition at line 230 of file ServicesMonitor.java.

References org.sleuthkit.autopsy.events.AutopsyEventPublisher.addSubscriber().

void org.sleuthkit.autopsy.core.ServicesMonitor.checkAllServices ( )
private

Checks the status of the core services in a collaborative, multi-user case environment: the database server, the keyword search server and the messaging service. Publishes a service event and user notification if the status of a service has changed since the last check.

Definition at line 271 of file ServicesMonitor.java.

References org.sleuthkit.autopsy.core.ServicesMonitor.checkServiceStatus(), and org.sleuthkit.autopsy.core.UserPreferences.getIsMultiUserModeEnabled().

Referenced by org.sleuthkit.autopsy.core.ServicesMonitor.ServicesMonitoringTask.run(), and org.sleuthkit.autopsy.core.ServicesMonitor.ServicesMonitor().

void org.sleuthkit.autopsy.core.ServicesMonitor.checkDatabaseConnectionStatus ( )
private
void org.sleuthkit.autopsy.core.ServicesMonitor.checkKeywordSearchServerConnectionStatus ( )
private
void org.sleuthkit.autopsy.core.ServicesMonitor.checkMessagingServerConnectionStatus ( )
private
void org.sleuthkit.autopsy.core.ServicesMonitor.checkServiceStatus ( String  service)
private
static synchronized ServicesMonitor org.sleuthkit.autopsy.core.ServicesMonitor.getInstance ( )
static

Gets the services monitor that monitors the status of services and publishes events and user notifications when the status of a service changes.

Returns
The services monitor singleton.

Definition at line 100 of file ServicesMonitor.java.

References org.sleuthkit.autopsy.core.ServicesMonitor.servicesMonitor, and org.sleuthkit.autopsy.core.ServicesMonitor.ServicesMonitor().

String org.sleuthkit.autopsy.core.ServicesMonitor.getServiceStatus ( String  service) throws ServicesMonitorException

Get last recorded status for a service.

Parameters
serviceName of the service.
Returns
ServiceStatus Status for the service.
Exceptions
ServicesMonitorExceptionIf the service name is unknown to the services monitor.

Definition at line 182 of file ServicesMonitor.java.

References org.sleuthkit.autopsy.core.ServicesMonitor.checkServiceStatus().

void org.sleuthkit.autopsy.core.ServicesMonitor.removeSubscriber ( PropertyChangeListener  subscriber)

Removes a subscriber to service status events for the core services.

Parameters
subscriberThe subscriber to remove.

Definition at line 239 of file ServicesMonitor.java.

References org.sleuthkit.autopsy.events.AutopsyEventPublisher.removeSubscriber().

void org.sleuthkit.autopsy.core.ServicesMonitor.removeSubscriber ( Set< String >  services,
PropertyChangeListener  subscriber 
)

Removes a subscriber to service status events for a subset of the services known to the services monitor.

Parameters
servicesThe services the subscriber is no longer interested in.
subscriberThe subscriber to remove.

Definition at line 250 of file ServicesMonitor.java.

References org.sleuthkit.autopsy.events.AutopsyEventPublisher.removeSubscriber().

void org.sleuthkit.autopsy.core.ServicesMonitor.removeSubscriber ( String  service,
PropertyChangeListener  subscriber 
)

Adds a subscriber to service status events for a specific service known to the services monitor.

Parameters
serviceThe service the subscriber is no longer interested in.
subscriberThe subscriber to remove.

Definition at line 261 of file ServicesMonitor.java.

References org.sleuthkit.autopsy.events.AutopsyEventPublisher.removeSubscriber().

void org.sleuthkit.autopsy.core.ServicesMonitor.setServiceStatus ( String  service,
String  status,
String  details 
)

Member Data Documentation

final Set<String> org.sleuthkit.autopsy.core.ServicesMonitor.coreServices = Stream.of(ServicesMonitor.Service.values()).map(Service::toString).collect(Collectors.toSet())
staticprivate

Definition at line 87 of file ServicesMonitor.java.

final long org.sleuthkit.autopsy.core.ServicesMonitor.CRASH_DETECTION_INTERVAL_MINUTES = 15
staticprivate

Definition at line 86 of file ServicesMonitor.java.

final AutopsyEventPublisher org.sleuthkit.autopsy.core.ServicesMonitor.eventPublisher
private

Definition at line 91 of file ServicesMonitor.java.

final Logger org.sleuthkit.autopsy.core.ServicesMonitor.logger = Logger.getLogger(ServicesMonitor.class.getName())
staticprivate

Definition at line 83 of file ServicesMonitor.java.

final int org.sleuthkit.autopsy.core.ServicesMonitor.NUMBER_OF_PERIODIC_TASK_THREADS = 1
staticprivate

Definition at line 85 of file ServicesMonitor.java.

final String org.sleuthkit.autopsy.core.ServicesMonitor.PERIODIC_TASK_THREAD_NAME = "services-monitor-periodic-task-%d"
staticprivate

Definition at line 84 of file ServicesMonitor.java.

final ScheduledThreadPoolExecutor org.sleuthkit.autopsy.core.ServicesMonitor.periodicTasksExecutor
private

Definition at line 89 of file ServicesMonitor.java.

ServicesMonitor org.sleuthkit.autopsy.core.ServicesMonitor.servicesMonitor = new ServicesMonitor()
staticprivate
final ConcurrentHashMap<String, String> org.sleuthkit.autopsy.core.ServicesMonitor.statusByService
private

Definition at line 90 of file ServicesMonitor.java.


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

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