From ad18f4df9d4aa4cbe2458080e015814118c0d260 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 17 Jan 2019 10:26:17 +0100 Subject: calling the right handler --- .../at/asit/pdfover/gui/bku/MobileBKUConnector.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'pdf-over-gui/src/main/java') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java index 7941a8ec..e739e7dd 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java @@ -15,6 +15,9 @@ */ package at.asit.pdfover.gui.bku; +import java.net.URL; + +import org.apache.commons.httpclient.util.HttpURLConnection; // Imports import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -88,10 +91,18 @@ public class MobileBKUConnector implements BkuSlConnector { try { String responseData = handler.postCredentials(); - // Now we have received some data lets check it: - log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$ - - handler.handleCredentialsResponse(responseData); + if (responseData.contains("page_undecided")) { //$NON-NLS-1$ + + // handle polling + handler.handlePolling(responseData); + + } else { + + // Now we have received some data lets check it: + log.trace("Response from mobile BKU: " + responseData); //$NON-NLS-1$ + handler.handleCredentialsResponse(responseData); + } + } catch (Exception ex) { log.error("Error in PostCredentialsThread", ex); //$NON-NLS-1$ this.state.setThreadException(ex); -- cgit v1.2.3