From adb1e20e3a6dc116bdb2a1785c0eefc15d00586d Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:32:20 +0000 Subject: Parse TAN tries git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@372 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../pdfover/gui/workflow/states/mobilebku/ATrustHandler.java | 8 +++++++- .../gui/workflow/states/mobilebku/MobileBKUStatus.java | 12 +++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'pdf-over-gui/src') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java index 4093102b..cb98aea3 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java @@ -122,7 +122,13 @@ public class ATrustHandler extends MobileBKUHandler { new SLResponse(responseData, getStatus().getServer(), null, null)); getState().setCommunicationState(MobileBKUCommunicationState.FINAL); } else { - getStatus().decreaseTanTries(); + try { + String tries = MobileBKUHelper.extractTag( + responseData, "Sie haben noch", "Versuch"); //$NON-NLS-1$ //$NON-NLS-2$ + getStatus().setTanTries(Integer.parseInt(tries.trim())); + } catch (Exception e) { + log.debug("Error parsing TAN response", e); //$NON-NLS-1$ + } if (getStatus().getTanTries() <= 0) { // move to POST_REQUEST diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java index 3066f683..01e10e1d 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java @@ -59,19 +59,21 @@ public class MobileBKUStatus { } /** - * @return the tanTries + * Get number of TAN tries left + * @return the number of TAN tries left */ public int getTanTries() { return this.tanTries; } /** - * Decreases the TAN Tries! + * Set number of TAN tries left + * @param tries the number of TAN tries left */ - public void decreaseTanTries() { - this.tanTries--; + public void setTanTries(int tries) { + this.tanTries = tries; } - + /** * @return the tan */ -- cgit v1.2.3