+ private void fireClientConnected() {
+ for (HighLevelClientListener highLevelClientListener : highLevelClientListeners) {
+ highLevelClientListener.clientConnected(this);
+ }
+ }
+
+ /**
+ * Notifies all listeners that a client has disconnected.
+ *
+ * @param throwable
+ * The exception that caused the disconnect, or <code>null</code>
+ * if there was no exception
+ */
+ private void fireClientDisconnected(Throwable throwable) {
+ for (HighLevelClientListener highLevelClientListener : highLevelClientListeners) {
+ highLevelClientListener.clientDisconnected(this, throwable);
+ }
+ }
+
+ /**
+ * Adds a high-level progress listener.
+ *
+ * @param highLevelProgressListener
+ * The high-level progress listener to add
+ */
+ public void addHighLevelProgressListener(HighLevelProgressListener highLevelProgressListener) {
+ highLevelProgressListeners.add(highLevelProgressListener);
+ }
+
+ /**
+ * Removes a high-level progress listener.
+ *
+ * @param highLevelProgressListener
+ * The high-level progress listener to remove
+ */
+ public void removeHighLevelProgressListener(HighLevelProgressListener highLevelProgressListener) {
+ highLevelProgressListeners.remove(highLevelProgressListener);
+ }
+
+ /**
+ * Notifies all listeners that the request with the given identifier made
+ * some progress.
+ *
+ * @param identifier
+ * The identifier of the request
+ * @param highLevelProgress
+ * The progress of the request
+ */
+ private void fireProgressReceived(String identifier, HighLevelProgress highLevelProgress) {
+ for (HighLevelProgressListener highLevelProgressListener : highLevelProgressListeners) {
+ highLevelProgressListener.progressReceived(this, identifier, highLevelProgress);
+ }