nl.nikhef.slcshttps.gui
Class SURFCAPopupComm

java.lang.Object
  extended by nl.nikhef.slcshttps.gui.SURFCAPopupComm
All Implemented Interfaces:
SURFCAHttps.SURFCACommunicator

public class SURFCAPopupComm
extends Object
implements SURFCAHttps.SURFCACommunicator

Implementation of a SURFCAHttps.SURFCACommunicator using popup windows instead of the default SURFCAHttps.StdioComm. See SURFCAHttps for details how this implementation is/can be used by setting the right system property, by choosing the right constructor or set using method SURFCAHttps.setCommunicator(String).

Version:
0.1
Author:
Mischa Sallé
See Also:
SURFCAHttps.SURFCACommunicator, SURFCAHttps.SURFCAHttps(SURFCACommunicator)

Field Summary
private  String DOWNLOADTEXT
          Text shown when the user is about to download his certificate.
 
Constructor Summary
SURFCAPopupComm()
           
 
Method Summary
 void error(String text, Exception e)
          Called upon error, it opens an error popup window with an error message using the text and Throwable.getMessage() from e (if non-null).
 void postBrowse()
          Called just after the webbrowser is started, prints a text in a popup window and waits until the user confirms he is ready with the webbrowser.
 void preBrowse()
          Called just before the webbrowser is started, prints an informative text in a popup window and waits until the user confirms he is ready to start the browser.
 boolean retry(String text, Exception e)
          Identical to error(String,Exception) except that it is called when an error occurs that might be fixed by the user.
 void success(String text)
          It is called when interaction has been successful and the certificate stored, when SURFCAHttps.getShowSuccess() equals true, it will then show a confirmation popup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOWNLOADTEXT

private final String DOWNLOADTEXT
Text shown when the user is about to download his certificate.

See Also:
Constant Field Values
Constructor Detail

SURFCAPopupComm

public SURFCAPopupComm()
Method Detail

preBrowse

public void preBrowse()
               throws IOException
Called just before the webbrowser is started, prints an informative text in a popup window and waits until the user confirms he is ready to start the browser.

Specified by:
preBrowse in interface SURFCAHttps.SURFCACommunicator
Throws:
IOException - when poup window is closed prematurely.

postBrowse

public void postBrowse()
                throws IOException
Called just after the webbrowser is started, prints a text in a popup window and waits until the user confirms he is ready with the webbrowser.

Specified by:
postBrowse in interface SURFCAHttps.SURFCACommunicator
Throws:
IOException - when popup window is closed prematurely.

error

public void error(String text,
                  Exception e)
Called upon error, it opens an error popup window with an error message using the text and Throwable.getMessage() from e (if non-null).

Specified by:
error in interface SURFCAHttps.SURFCACommunicator
Parameters:
text - String - some descriptive text.
e - Exception that caused the error (if any).
See Also:
GraphTools.errorPopup(String,Exception)

retry

public boolean retry(String text,
                     Exception e)
Identical to error(String,Exception) except that it is called when an error occurs that might be fixed by the user. (S)He can then choose to retry.

Specified by:
retry in interface SURFCAHttps.SURFCACommunicator
Parameters:
text - String - some text.
e - Exception that caused the error (if any).
Returns:
boolean whether or not the user wishes to retry.
See Also:
error(String,Exception), GraphTools.retryPopup(String,Exception)

success

public void success(String text)
It is called when interaction has been successful and the certificate stored, when SURFCAHttps.getShowSuccess() equals true, it will then show a confirmation popup.

Specified by:
success in interface SURFCAHttps.SURFCACommunicator
Parameters:
text - String - text describing the certificate subject.
See Also:
GraphTools.successPopup(String)


nl.nikhef.slcshttps Mischa Sallé - msalle(AT)nikhef.nl