- @Override
- public void soneUnlocked(Sone sone) {
- lockedSonesNotification.remove(sone);
- Ticker.getInstance().deregisterEvent(lockedSonesTickerObjects.remove(sone));
+ @Subscribe
+ public void soneUnlocked(SoneUnlockedEvent soneUnlockedEvent) {
+ lockedSonesNotification.remove(soneUnlockedEvent.sone());
+ Ticker.getInstance().deregisterEvent(lockedSonesTickerObjects.remove(soneUnlockedEvent.sone()));
+ }
+
+ /**
+ * Notifies the web interface that a {@link Sone} is being inserted.
+ *
+ * @param soneInsertingEvent
+ * The event
+ */
+ @Subscribe
+ public void soneInserting(SoneInsertingEvent soneInsertingEvent) {
+ TemplateNotification soneInsertNotification = getSoneInsertNotification(soneInsertingEvent.sone());
+ soneInsertNotification.set("soneStatus", "inserting");
+ if (soneInsertingEvent.sone().getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) {
+ notificationManager.addNotification(soneInsertNotification);
+ }
+ }
+
+ /**
+ * Notifies the web interface that a {@link Sone} was inserted.
+ *
+ * @param soneInsertedEvent
+ * The event
+ */
+ @Subscribe
+ public void soneInserted(SoneInsertedEvent soneInsertedEvent) {
+ TemplateNotification soneInsertNotification = getSoneInsertNotification(soneInsertedEvent.sone());
+ soneInsertNotification.set("soneStatus", "inserted");
+ soneInsertNotification.set("insertDuration", soneInsertedEvent.insertDuration() / 1000);
+ if (soneInsertedEvent.sone().getOptions().getBooleanOption("EnableSoneInsertNotifications").get()) {
+ notificationManager.addNotification(soneInsertNotification);
+ }