19 package org.sleuthkit.autopsy.events;
21 import java.beans.PropertyChangeListener;
22 import java.net.URISyntaxException;
24 import java.util.logging.Level;
25 import javax.annotation.concurrent.GuardedBy;
26 import javax.annotation.concurrent.ThreadSafe;
27 import javax.jms.JMSException;
57 localPublisher =
new LocalEventPublisher();
75 }
catch (URISyntaxException | JMSException ex) {
76 String message =
"Failed to open remote event channel";
77 logger.log(Level.SEVERE, message, ex);
80 String message =
"Error accessing messaging service connection info";
81 logger.log(Level.SEVERE, message, ex);
101 public void addSubscriber(Set<String> eventNames, PropertyChangeListener subscriber) {
102 localPublisher.addSubscriber(eventNames, subscriber);
111 public void addSubscriber(String eventName, PropertyChangeListener subscriber) {
112 localPublisher.addSubscriber(eventName, subscriber);
122 localPublisher.removeSubscriber(eventNames, subscriber);
132 localPublisher.removeSubscriber(eventName, subscriber);
151 localPublisher.publish(event);
161 boolean published =
false;
164 while (
false == published && tryCount <= MAX_REMOTE_EVENT_PUBLISH_TRIES) {
172 logger.log(Level.SEVERE, String.format(
"Failed to publish %s using channel %s (tryCount = %s)", event.getPropertyName(),
currentChannelName, tryCount), ex);
188 }
catch (JMSException ex) {
189 logger.log(Level.SEVERE, String.format(
"Error closing remote event publisher for channel %s",
currentChannelName), ex);
void publishLocally(AutopsyEvent event)
void publish(AutopsyEvent event)
void addSubscriber(Set< String > eventNames, PropertyChangeListener subscriber)
RemoteEventPublisher remotePublisher
synchronized void closeRemoteEventChannel()
final LocalEventPublisher localPublisher
static final Logger logger
synchronized void openRemoteEventChannel(String channelName)
static final int MAX_REMOTE_EVENT_PUBLISH_TRIES
void addSubscriber(String eventName, PropertyChangeListener subscriber)
void removeSubscriber(Set< String > eventNames, PropertyChangeListener subscriber)
String currentChannelName
synchronized void stopRemotePublisher()
synchronized static Logger getLogger(String name)
synchronized void publishRemotely(AutopsyEvent event)
void removeSubscriber(String eventName, PropertyChangeListener subscriber)
static MessageServiceConnectionInfo getMessageServiceConnectionInfo()