+ /**
+ * Notifies the web interface that a new Sone version was found.
+ *
+ * @param updateFoundEvent
+ * The event
+ */
+ @Subscribe
+ public void updateFound(UpdateFoundEvent updateFoundEvent) {
+ newVersionNotification.getTemplateContext().set("latestVersion", updateFoundEvent.version());
+ newVersionNotification.getTemplateContext().set("latestEdition", updateFoundEvent.latestEdition());
+ newVersionNotification.getTemplateContext().set("releaseTime", updateFoundEvent.releaseTime());
+ notificationManager.addNotification(newVersionNotification);
+ }
+
+ /**
+ * Notifies the web interface that an image insert was started
+ *
+ * @param imageInsertStartedEvent
+ * The event
+ */
+ @Subscribe
+ public void imageInsertStarted(ImageInsertStartedEvent imageInsertStartedEvent) {
+ insertingImagesNotification.add(imageInsertStartedEvent.image());
+ notificationManager.addNotification(insertingImagesNotification);
+ }
+
+ /**
+ * Notifies the web interface that an {@link Image} insert was aborted.
+ *
+ * @param imageInsertAbortedEvent
+ * The event
+ */
+ @Subscribe
+ public void imageInsertAborted(ImageInsertAbortedEvent imageInsertAbortedEvent) {
+ insertingImagesNotification.remove(imageInsertAbortedEvent.image());
+ }
+
+ /**
+ * Notifies the web interface that an {@link Image} insert is finished.
+ *
+ * @param imageInsertFinishedEvent
+ * The event
+ */
+ @Subscribe
+ public void imageInsertFinished(ImageInsertFinishedEvent imageInsertFinishedEvent) {
+ insertingImagesNotification.remove(imageInsertFinishedEvent.image());
+ insertedImagesNotification.add(imageInsertFinishedEvent.image());
+ notificationManager.addNotification(insertedImagesNotification);
+ }
+
+ /**
+ * Notifies the web interface that an {@link Image} insert has failed.
+ *
+ * @param imageInsertFailedEvent
+ * The event
+ */
+ @Subscribe
+ public void imageInsertFailed(ImageInsertFailedEvent imageInsertFailedEvent) {
+ insertingImagesNotification.remove(imageInsertFailedEvent.image());
+ imageInsertFailedNotification.add(imageInsertFailedEvent.image());
+ notificationManager.addNotification(imageInsertFailedNotification);