summaryrefslogtreecommitdiff
path: root/pdf-over-gui/src/main/java/at
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2019-11-04 17:30:37 +0100
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2019-11-04 17:30:37 +0100
commit02bae5a8841e77f4409778576ffcebf3ab582d5e (patch)
treef0eba6e5bb2ae1d8d2f34509531d118129ba8023 /pdf-over-gui/src/main/java/at
parent4c3803be61dab135fbc7892c3feb915113477ef6 (diff)
downloadpdf-over-02bae5a8841e77f4409778576ffcebf3ab582d5e.tar.gz
pdf-over-02bae5a8841e77f4409778576ffcebf3ab582d5e.tar.bz2
pdf-over-02bae5a8841e77f4409778576ffcebf3ab582d5e.zip
refactoring in handleSLcommand
Diffstat (limited to 'pdf-over-gui/src/main/java/at')
-rw-r--r--pdf-over-gui/src/main/java/at/asit/pdfover/gui/bku/MobileBKUConnector.java15
1 files changed, 14 insertions, 1 deletions
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 762b9316..891ff9f4 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
@@ -96,7 +96,7 @@ public class MobileBKUConnector implements BkuSlConnector {
ATrustHandler aHandler = (ATrustHandler) handler;
String response = aHandler.postSMSRequest();
aHandler.handleCredentialsResponse(response);
- } else if (((ATrustStatus) this.state.getStatus()).getErrorMessage().equals("cancel")) { //$NON-NLS-1$
+ } else if (handleErrorMessage()) {
throw new SignatureException(new IllegalStateException());
} else {
handler.handlePolling(responseData);
@@ -212,4 +212,17 @@ public class MobileBKUConnector implements BkuSlConnector {
return signingState.getSignatureResponse();
}
+ private boolean handleErrorMessage() {
+
+ if (this.state.getStatus() instanceof ATrustStatus) {
+ ATrustStatus aStatus = (ATrustStatus)this.state.getStatus() ;
+ if (aStatus.getErrorMessage() != null &&
+ aStatus.getErrorMessage().equals("cancel")) { //$NON-NLS-1$
+ ((ATrustStatus)this.state.getStatus()).setErrorMessage(null);
+ return true;
+ }
+ }
+ return false;
+ }
+
}