}
}
+ /**
+ * Notifies all listeners that a request was removed.
+ *
+ * @param request
+ * The request that was removed
+ */
+ private void fireRequestRemoved(Request request) {
+ for (CoreListener coreListener: coreListeners) {
+ coreListener.requestRemoved(request);
+ }
+ }
+
//
// ACCESSORS
//
* @see net.pterodactylus.jsite.core.RequestListener#requestRemoved(net.pterodactylus.jsite.core.Request)
*/
public void requestRemoved(Request request) {
- /* TODO */
+ fireRequestRemoved(request);
}
}
*/
public void requestProgressed(Request request);
+ /**
+ * Notifies a listener that a request was removed.
+ *
+ * @param request
+ * The request that was removed
+ */
+ public void requestRemoved(Request request);
+
}
}
}
- // TODO - fireRequestRemoved
+ /**
+ * Notifies all listeners that a request was removed.
+ *
+ * @param request
+ * The request that was removed
+ */
+ private void fireRequestRemoved(Request request) {
+ for (RequestListener requestListener: requestListeners) {
+ requestListener.requestRemoved(request);
+ }
+ }
//
// ACCESSORS
* {@inheritDoc}
*/
public void nodeDisconnected(Node node, Throwable throwable) {
- HighLevelClient highLevelClient = nodeManager.getHighLevelClient(node);
- if (highLevelClient == null) {
- logger.warning("got nodeDisconnected from node without high-level client: " + node);
+ Map<String, Request> identifierRequests = nodeRequests.get(node);
+ if (identifierRequests == null) {
+ logger.warning("got node without request map: " + node);
return;
}
+ for (Request request: identifierRequests.values()) {
+ fireRequestRemoved(request);
+ }
+ identifierRequests.clear();
}
//
/* TODO - update table model */
}
+ /**
+ * @see net.pterodactylus.jsite.core.CoreListener#requestRemoved(net.pterodactylus.jsite.core.Request)
+ */
+ public void requestRemoved(Request request) {
+ requestTableModel.removeRequest(request);
+ }
+
//
// INTERFACE LoggingListener
//