mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
Remove exception firewall from AutopsyEventPublisher
This commit is contained in:
parent
0808079290
commit
38ea8d1df4
@ -86,24 +86,8 @@ public final class AutopsyEventPublisher {
|
|||||||
* events from other Autopsy nodes.
|
* events from other Autopsy nodes.
|
||||||
*/
|
*/
|
||||||
public void closeRemoteEventChannel() {
|
public void closeRemoteEventChannel() {
|
||||||
currentChannelName = null;
|
|
||||||
stopRemotePublisher();
|
stopRemotePublisher();
|
||||||
}
|
currentChannelName = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* Stops remote event publisher, causing it to disconnect from the message
|
|
||||||
* service. As opposed to closeRemoteEventChannel(), this method allows for
|
|
||||||
* the current remote event channel to be re-opened later.
|
|
||||||
*/
|
|
||||||
private void stopRemotePublisher() {
|
|
||||||
if (null != remotePublisher) {
|
|
||||||
try {
|
|
||||||
remotePublisher.stop();
|
|
||||||
} catch (JMSException ex) {
|
|
||||||
logger.log(Level.SEVERE, "Error closing remote event channel", ex); //NON-NLS
|
|
||||||
}
|
|
||||||
remotePublisher = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -171,9 +155,6 @@ public final class AutopsyEventPublisher {
|
|||||||
* @param event The event to publish.
|
* @param event The event to publish.
|
||||||
*/
|
*/
|
||||||
public void publishRemotely(AutopsyEvent event) {
|
public void publishRemotely(AutopsyEvent event) {
|
||||||
/*
|
|
||||||
* This is a no-op if a remote channel has not been opened.
|
|
||||||
*/
|
|
||||||
if (null != currentChannelName) {
|
if (null != currentChannelName) {
|
||||||
boolean published = false;
|
boolean published = false;
|
||||||
int tryCount = 1;
|
int tryCount = 1;
|
||||||
@ -185,19 +166,28 @@ public final class AutopsyEventPublisher {
|
|||||||
}
|
}
|
||||||
remotePublisher.publish(event);
|
remotePublisher.publish(event);
|
||||||
published = true;
|
published = true;
|
||||||
} catch (JMSException ex) {
|
} catch (AutopsyEventException | JMSException ex) {
|
||||||
logger.log(Level.SEVERE, String.format("Failed to publish %s using channel %s (tryCount = %s)", event.getPropertyName(), currentChannelName, tryCount), ex); //NON-NLS
|
logger.log(Level.SEVERE, String.format("Failed to publish %s using channel %s (tryCount = %s)", event.getPropertyName(), currentChannelName, tryCount), ex); //NON-NLS
|
||||||
stopRemotePublisher();
|
stopRemotePublisher();
|
||||||
++tryCount;
|
++tryCount;
|
||||||
} catch (AutopsyEventException ex) {
|
|
||||||
logger.log(Level.SEVERE, String.format("Failed to reopen channel %s to publish %s event (tryCount = %s)", currentChannelName, event.getPropertyName(), tryCount), ex); //NON-NLS
|
|
||||||
++tryCount;
|
|
||||||
} catch (Exception ex) {
|
|
||||||
logger.log(Level.SEVERE, String.format("Unexpected exception! Failed to to publish %s event on channel %s (tryCount = %s)", event.getPropertyName(), currentChannelName, tryCount), ex); //NON-NLS
|
|
||||||
++tryCount;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops the remote event publisher, but does not reset the current channel
|
||||||
|
* name.
|
||||||
|
*/
|
||||||
|
private void stopRemotePublisher() {
|
||||||
|
if (null != remotePublisher) {
|
||||||
|
try {
|
||||||
|
remotePublisher.stop();
|
||||||
|
} catch (JMSException ex) {
|
||||||
|
logger.log(Level.SEVERE, String.format("Error closing remote event publisher for channel %s", currentChannelName), ex); //NON-NLS
|
||||||
|
}
|
||||||
|
remotePublisher = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user