diff options
author | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:32:27 +0000 |
---|---|---|
committer | tkellner <tkellner@174cde9d-5d70-4d2a-aa98-46368bc2aaf7> | 2013-04-10 19:32:27 +0000 |
commit | 10488f89a0c8992b951f340cea92a8e00af2dec7 (patch) | |
tree | bcf6b3323f1742abde59d38bf18a864da872c693 /pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java | |
parent | adb1e20e3a6dc116bdb2a1785c0eefc15d00586d (diff) | |
download | pdf-over-10488f89a0c8992b951f340cea92a8e00af2dec7.tar.gz pdf-over-10488f89a0c8992b951f340cea92a8e00af2dec7.tar.bz2 pdf-over-10488f89a0c8992b951f340cea92a8e00af2dec7.zip |
split mobile BKU status
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@373 174cde9d-5d70-4d2a-aa98-46368bc2aaf7
Diffstat (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java')
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java | 52 |
1 files changed, 5 insertions, 47 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java index 3cef5edf..1193ffcd 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/MobileBKUHandler.java @@ -147,29 +147,9 @@ public abstract class MobileBKUHandler { /** * Post the credentials * @return the response - * @throws IOException IO error - * @throws HttpException HTTP error + * @throws Exception Error during posting */ - public String postCredentials() throws HttpException, IOException { - MobileBKUStatus status = getStatus(); - - Protocol.registerProtocol("https", //$NON-NLS-1$ - new Protocol("https", new TrustedSocketFactory(), 443)); //$NON-NLS-1$ - - HttpClient client = new HttpClient(); - client.getParams().setParameter("http.useragent", //$NON-NLS-1$ - LocalBKUState.PDF_OVER_USER_AGENT_STRING); - - PostMethod post = new PostMethod(status.getBaseURL() + "/identification.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$ - post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$ - post.addParameter("__VIEWSTATE", status.getViewstate()); //$NON-NLS-1$ - post.addParameter("__EVENTVALIDATION", status.getEventvalidation()); //$NON-NLS-1$ - post.addParameter("handynummer", status.getPhoneNumber()); //$NON-NLS-1$ - post.addParameter("signaturpasswort", status.getMobilePassword()); //$NON-NLS-1$ - post.addParameter("Button_Identification", "Identifizieren"); //$NON-NLS-1$ //$NON-NLS-2$ - - return executePost(client, post); - } + public abstract String postCredentials() throws Exception; /** * Handle the response to credentials post @@ -181,31 +161,9 @@ public abstract class MobileBKUHandler { /** * Post the TAN * @return the response - * @throws IOException IO error - * @throws HttpException HTTP error + * @throws Exception Error during posting */ - public String postTAN() throws HttpException, IOException { - MobileBKUStatus status = this.state.getStatus(); - - Protocol.registerProtocol("https", //$NON-NLS-1$ - new Protocol("https", new TrustedSocketFactory(), 443)); //$NON-NLS-1$ - - HttpClient client = new HttpClient(); - client.getParams().setParameter("http.useragent", //$NON-NLS-1$ - LocalBKUState.PDF_OVER_USER_AGENT_STRING); - - PostMethod post = new PostMethod(status.getBaseURL() - + "/signature.aspx?sid=" + status.getSessionID()); //$NON-NLS-1$ - post.getParams().setContentCharset("utf-8"); //$NON-NLS-1$ - post.addParameter("__VIEWSTATE", status.getViewstate()); //$NON-NLS-1$ - post.addParameter( - "__EVENTVALIDATION", status.getEventvalidation()); //$NON-NLS-1$ - post.addParameter("input_tan", status.getTan()); //$NON-NLS-1$ - post.addParameter("SignButton", "Signieren"); //$NON-NLS-1$ //$NON-NLS-2$ - post.addParameter("Button1", "Identifizieren"); //$NON-NLS-1$ //$NON-NLS-2$ - - return executePost(client, post); - } + public abstract String postTAN() throws Exception; /** * Handle the response to TAN post @@ -253,7 +211,7 @@ public abstract class MobileBKUHandler { * @return the response * @throws IOException IO error */ - private String executePost(HttpClient client, PostMethod post) throws IOException { + protected String executePost(HttpClient client, PostMethod post) throws IOException { int returnCode = client.executeMethod(post); String redirectLocation = null; |