From b1c8641a63a67e3c64d948f9e8dce5c01e11e2dd Mon Sep 17 00:00:00 2001 From: mcentner Date: Wed, 5 May 2010 15:29:01 +0000 Subject: Merged feature branch mocca-1.2.13-id@r724 back to trunk. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@725 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../gv/egiz/bku/pin/gui/AbstractPINProvider.java | 11 +++++----- .../java/at/gv/egiz/bku/pin/gui/SignPINGUI.java | 24 +++++++++++----------- .../at/gv/egiz/bku/pin/gui/SignPINProvider.java | 20 +++++++++--------- .../java/at/gv/egiz/bku/pin/gui/VerifyPINGUI.java | 14 +++++-------- .../at/gv/egiz/bku/pin/gui/VerifyPINProvider.java | 21 +++++++++---------- 5 files changed, 42 insertions(+), 48 deletions(-) (limited to 'smccSTAL/src/main/java/at/gv/egiz/bku/pin') diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/AbstractPINProvider.java b/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/AbstractPINProvider.java index 00738188..05f9c176 100644 --- a/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/AbstractPINProvider.java +++ b/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/AbstractPINProvider.java @@ -17,11 +17,10 @@ package at.gv.egiz.bku.pin.gui; -import at.gv.egiz.smcc.pin.gui.PINProvider; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * common super class providing action listener for all PIN GUIs @@ -29,7 +28,7 @@ import org.apache.commons.logging.LogFactory; */ public abstract class AbstractPINProvider implements ActionListener { - protected static final Log log = LogFactory.getLog(AbstractPINProvider.class); + private final Logger log = LoggerFactory.getLogger(AbstractPINProvider.class); protected String action; protected boolean actionPerformed; @@ -40,7 +39,7 @@ public abstract class AbstractPINProvider implements ActionListener { this.wait(); } } catch (InterruptedException e) { - log.error("[" + Thread.currentThread().getName() + "] interrupt in waitForAction"); + log.error("[{}] interrupt in waitForAction.", Thread.currentThread().getName()); throw e; } actionPerformed = false; @@ -53,7 +52,7 @@ public abstract class AbstractPINProvider implements ActionListener { @Override public void actionPerformed(ActionEvent e) { - log.debug("[" + Thread.currentThread().getName() + "] action performed - " + e.getActionCommand()); + log.debug("[{}] action performed - {}", Thread.currentThread().getName(), e.getActionCommand()); action = e.getActionCommand(); actionPerformed(); } diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/SignPINGUI.java b/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/SignPINGUI.java index 81db0e90..0199dab0 100644 --- a/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/SignPINGUI.java +++ b/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/SignPINGUI.java @@ -19,12 +19,12 @@ package at.gv.egiz.bku.pin.gui; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.smccstal.SecureViewer; import at.gv.egiz.smcc.CancelledException; -import at.gv.egiz.smcc.PINSpec; +import at.gv.egiz.smcc.PinInfo; import at.gv.egiz.smcc.pin.gui.PINGUI; import at.gv.egiz.stal.signedinfo.SignedInfoType; import java.security.DigestException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The number of retries is not fixed and there is no way (?) to obtain this value. @@ -39,7 +39,7 @@ import org.apache.commons.logging.LogFactory; */ public class SignPINGUI extends SignPINProvider implements PINGUI { - protected static final Log log = LogFactory.getLog(SignPINGUI.class); + private final Logger log = LoggerFactory.getLogger(SignPINGUI.class); private boolean retry = false; @@ -48,7 +48,7 @@ public class SignPINGUI extends SignPINProvider implements PINGUI { } @Override - public void enterPINDirect(PINSpec spec, int retries) + public void enterPINDirect(PinInfo spec, int retries) throws CancelledException, InterruptedException { if (retry) { gui.showEnterPINDirect(spec, retries); @@ -60,7 +60,7 @@ public class SignPINGUI extends SignPINProvider implements PINGUI { } @Override - public void enterPIN(PINSpec spec, int retries) + public void enterPIN(PinInfo spec, int retries) throws CancelledException, InterruptedException { if (retry) { gui.showEnterPIN(spec, retries); @@ -71,7 +71,7 @@ public class SignPINGUI extends SignPINProvider implements PINGUI { } } - private void showSignatureData(PINSpec spec) + private void showSignatureData(PinInfo spec) throws CancelledException, InterruptedException { gui.showSignatureDataDialog(spec, @@ -80,20 +80,20 @@ public class SignPINGUI extends SignPINProvider implements PINGUI { this, "secureViewer"); do { - log.trace("[" + Thread.currentThread().getName() + "] wait for action"); + log.trace("[{}] wait for action.", Thread.currentThread().getName()); waitForAction(); - log.trace("[" + Thread.currentThread().getName() + "] received action " + action); + log.trace("[{}] received action {}.", Thread.currentThread().getName(), action); if ("secureViewer".equals(action)) { try { viewer.displayDataToBeSigned(signedInfo, this, "signatureData"); } catch (DigestException ex) { - log.error("Bad digest value: " + ex.getMessage()); + log.error("Bad digest value: {}", ex.getMessage()); gui.showErrorDialog(BKUGUIFacade.ERR_INVALID_HASH, new Object[]{ex.getMessage()}, this, "error"); } catch (Exception ex) { - log.error("Could not display hashdata inputs: " + + log.error("Could not display hashdata inputs: {}.", ex.getMessage()); gui.showErrorDialog(BKUGUIFacade.ERR_DISPLAY_HASHDATA, new Object[]{ex.getMessage()}, @@ -113,7 +113,7 @@ public class SignPINGUI extends SignPINProvider implements PINGUI { throw new CancelledException(spec.getLocalizedName() + " entry cancelled"); } else { - log.error("unknown action command " + action); + log.error("Unknown action command {}.", action); } } while (true); } diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/SignPINProvider.java b/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/SignPINProvider.java index fc1d39af..d09eebb9 100644 --- a/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/SignPINProvider.java +++ b/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/SignPINProvider.java @@ -19,12 +19,12 @@ package at.gv.egiz.bku.pin.gui; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.smccstal.SecureViewer; import at.gv.egiz.smcc.CancelledException; -import at.gv.egiz.smcc.PINSpec; +import at.gv.egiz.smcc.PinInfo; import at.gv.egiz.smcc.pin.gui.PINProvider; import at.gv.egiz.stal.signedinfo.SignedInfoType; import java.security.DigestException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The number of retries is not fixed and there is no way (?) to obtain this value. @@ -39,7 +39,7 @@ import org.apache.commons.logging.LogFactory; */ public class SignPINProvider extends AbstractPINProvider implements PINProvider { - protected static final Log log = LogFactory.getLog(SignPINProvider.class); + private final Logger log = LoggerFactory.getLogger(SignPINProvider.class); protected BKUGUIFacade gui; protected SecureViewer viewer; @@ -53,7 +53,7 @@ public class SignPINProvider extends AbstractPINProvider implements PINProvider } @Override - public char[] providePIN(PINSpec spec, int retries) + public char[] providePIN(PinInfo spec, int retries) throws CancelledException, InterruptedException { gui.showSignaturePINDialog(spec, (retry) ? retries : -1, @@ -62,20 +62,20 @@ public class SignPINProvider extends AbstractPINProvider implements PINProvider this, "secureViewer"); do { - log.trace("[" + Thread.currentThread().getName() + "] wait for action"); + log.trace("[{}] wait for action.", Thread.currentThread().getName()); waitForAction(); - log.trace("[" + Thread.currentThread().getName() + "] received action " + action); + log.trace("[{}] received action {}.", Thread.currentThread().getName(), action); if ("secureViewer".equals(action)) { try { viewer.displayDataToBeSigned(signedInfo, this, "pinEntry"); } catch (DigestException ex) { - log.error("Bad digest value: " + ex.getMessage()); + log.error("Bad digest value: {}", ex.getMessage()); gui.showErrorDialog(BKUGUIFacade.ERR_INVALID_HASH, new Object[]{ex.getMessage()}, this, "error"); } catch (Exception ex) { - log.error("Could not display hashdata inputs: " + + log.error("Could not display hashdata inputs: {}", ex.getMessage()); gui.showErrorDialog(BKUGUIFacade.ERR_DISPLAY_HASHDATA, new Object[]{ex.getMessage()}, @@ -98,7 +98,7 @@ public class SignPINProvider extends AbstractPINProvider implements PINProvider throw new CancelledException(spec.getLocalizedName() + " entry cancelled"); } else { - log.error("unknown action command " + action); + log.error("Unknown action command {}.", action); } } while (true); } diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/VerifyPINGUI.java b/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/VerifyPINGUI.java index dc21492e..89ab1e21 100644 --- a/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/VerifyPINGUI.java +++ b/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/VerifyPINGUI.java @@ -18,10 +18,8 @@ package at.gv.egiz.bku.pin.gui; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.smcc.CancelledException; -import at.gv.egiz.smcc.PINSpec; +import at.gv.egiz.smcc.PinInfo; import at.gv.egiz.smcc.pin.gui.PINGUI; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; /** * The number of retries is not fixed and there is no way (?) to obtain this value. @@ -36,8 +34,6 @@ import org.apache.commons.logging.LogFactory; */ public class VerifyPINGUI extends VerifyPINProvider implements PINGUI { - protected static final Log log = LogFactory.getLog(VerifyPINGUI.class); - private boolean retry = false; public VerifyPINGUI(BKUGUIFacade gui) { @@ -45,15 +41,15 @@ public class VerifyPINGUI extends VerifyPINProvider implements PINGUI { } @Override - public void enterPINDirect(PINSpec spec, int retries) + public void enterPINDirect(PinInfo pinInfo, int retries) throws CancelledException, InterruptedException { - gui.showEnterPINDirect(spec, (retry) ? retries : -1); + gui.showEnterPINDirect(pinInfo, (retry) ? retries : -1); retry = true; } @Override - public void enterPIN(PINSpec spec, int retries) { - gui.showEnterPIN(spec, (retry) ? retries : -1); + public void enterPIN(PinInfo pinInfo, int retries) { + gui.showEnterPIN(pinInfo, (retry) ? retries : -1); retry = true; } diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/VerifyPINProvider.java b/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/VerifyPINProvider.java index fda1e402..f9300932 100644 --- a/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/VerifyPINProvider.java +++ b/smccSTAL/src/main/java/at/gv/egiz/bku/pin/gui/VerifyPINProvider.java @@ -18,10 +18,10 @@ package at.gv.egiz.bku.pin.gui; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.smcc.CancelledException; -import at.gv.egiz.smcc.PINSpec; +import at.gv.egiz.smcc.PinInfo; import at.gv.egiz.smcc.pin.gui.PINProvider; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The number of retries is not fixed and there is no way (?) to obtain this value. @@ -36,7 +36,7 @@ import org.apache.commons.logging.LogFactory; */ public class VerifyPINProvider extends AbstractPINProvider implements PINProvider { - protected static final Log log = LogFactory.getLog(VerifyPINProvider.class); + private final Logger log = LoggerFactory.getLogger(VerifyPINProvider.class); protected BKUGUIFacade gui; private boolean retry = false; @@ -46,26 +46,25 @@ public class VerifyPINProvider extends AbstractPINProvider implements PINProvide } @Override - public char[] providePIN(PINSpec spec, int retries) + public char[] providePIN(PinInfo spec, int retries) throws CancelledException, InterruptedException { gui.showVerifyPINDialog(spec, (retry) ? retries : -1, this, "verify", this, "cancel"); - log.trace("[" + Thread.currentThread().getName() + "] wait for action"); + log.trace("[{}] wait for action.", Thread.currentThread().getName()); waitForAction(); - log.trace("[" + Thread.currentThread().getName() + "] received action " + action); + log.trace("[{}] received action {}.", Thread.currentThread().getName(), action); + + gui.showMessageDialog(BKUGUIFacade.TITLE_WAIT, + BKUGUIFacade.MESSAGE_WAIT); if ("cancel".equals(action)) { - gui.showMessageDialog(BKUGUIFacade.TITLE_WAIT, - BKUGUIFacade.MESSAGE_WAIT); throw new CancelledException(spec.getLocalizedName() + " entry cancelled"); } - gui.showMessageDialog(BKUGUIFacade.TITLE_WAIT, - BKUGUIFacade.MESSAGE_WAIT); retry = true; return gui.getPin(); } -- cgit v1.2.3