summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-over-gui/src/main/java')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ATrustHandler.java8
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUStatus.java12
2 files changed, 14 insertions, 6 deletions
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
*/