summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main
diff options
context:
space:
mode:
authortkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:32:20 +0000
committertkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7>2013-04-10 19:32:20 +0000
commitadb1e20e3a6dc116bdb2a1785c0eefc15d00586d (patch)
tree3d9cfb65bdd8cb43ac3c32125c19e2bbb7e4f96d /pdf-over-gui/src/main
parent33c49abc111f184ac87076fa735e75877dfbeab3 (diff)
downloadpdf-over-adb1e20e3a6dc116bdb2a1785c0eefc15d00586d.tar.gz
pdf-over-adb1e20e3a6dc116bdb2a1785c0eefc15d00586d.tar.bz2
pdf-over-adb1e20e3a6dc116bdb2a1785c0eefc15d00586d.zip
Parse TAN tries
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@372 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main')
-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
*/