From 3d982813b34f6f230baf4a467cdc37ec92a77595 Mon Sep 17 00:00:00 2001 From: netconomy Date: Fri, 17 Aug 2007 06:10:56 +0000 Subject: Performance git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@167 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../egov/egiz/sig/connectors/ConnectorChooser.java | 154 +++++++++++---------- 1 file changed, 78 insertions(+), 76 deletions(-) (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/ConnectorChooser.java') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/ConnectorChooser.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/ConnectorChooser.java index 4dcd1b5..dd22b1d 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/ConnectorChooser.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/ConnectorChooser.java @@ -21,6 +21,8 @@ import at.knowcenter.wag.egov.egiz.sig.sigid.HotfixIdFormatter; * Helper class that provides static methods that help the application to * "choose" the right connector for a given task. * + * @deprecated functionality split to ConnectorChooser implementations in framework commandline and web + * * @author wprinz */ public final class ConnectorChooser @@ -62,28 +64,28 @@ public final class ConnectorChooser return new DetachedLocRefMOAConnector(profile, loc_ref_url); } - public static Connector chooseCommandlineConnectorForSign(String connector, - String profile) throws ConnectorException - { - log.debug("Choosing Connector for commandline signation..."); - - log.debug("connector type = " + connector); - - if (connector.equals(BKU)) - { - log.debug("sig_app is BKU ==> MultipartDetachedBKUConnector"); //$NON-NLS-1$ - - return new MultipartDetachedBKUConnector(profile); - } - if (connector.equals(MOA)) - { - // TODO MOA detached signing is not allowed at the commandline - log.warn("Detached MOA is not supported on the commandline. -> choosing Base64 temporarily."); - return new EnvelopingBase64MOAConnector(profile); - } - - throw new ConnectorException(300, "Unknown connector type '" + connector + "' specified."); - } +// public static Connector chooseCommandlineConnectorForSign(String connector, +// String profile) throws ConnectorException +// { +// log.debug("Choosing Connector for commandline signation..."); +// +// log.debug("connector type = " + connector); +// +// if (connector.equals(BKU)) +// { +// log.debug("sig_app is BKU ==> MultipartDetachedBKUConnector"); //$NON-NLS-1$ +// +// return new MultipartDetachedBKUConnector(profile); +// } +// if (connector.equals(MOA)) +// { +// // TODO MOA detached signing is not allowed at the commandline +// log.warn("Detached MOA is not supported on the commandline. -> choosing Base64 temporarily."); +// return new EnvelopingBase64MOAConnector(profile); +// } +// +// throw new ConnectorException(300, "Unknown connector type '" + connector + "' specified."); +// } public static LocalConnector chooseLocalConnectorForVerify(String connector, PdfASID sig_kz, String sig_id, String profile, String loc_ref_url) throws ConnectorException @@ -177,60 +179,60 @@ public final class ConnectorChooser throw new ConnectorException(310, "The SIG_KZ version '" + sig_kz.getVersion() + "' is unknown."); } - public static Connector chooseCommandlineConnectorForVerify(String connector, - PdfASID sig_kz, String sig_id, String profile) throws ConnectorException - { - log.debug("Choosing Connector for Commandline verification..."); - - log.debug("connector type = " + connector); - log.debug("sig_kz = " + sig_kz); //$NON-NLS-1$ - log.debug("sig_id = " + sig_id); //$NON-NLS-1$ - - if (sig_kz == null) - { - log.debug("sig_kz is null -> chose an old enveloped base64 connector"); //$NON-NLS-1$ - - return chooseEnvelopedBase64ConnectorOld(profile, connector); - } - - log.debug("sig_kz is not null -> one of the newer signatures"); - - if (sig_kz.getVersion().equals(SignatorFactory.VERSION_1_0_0)) - { - log.debug("Version is 1.0.0 -> Base64 Signatur (old or Hotfix)."); - - if (sig_id == null) - { - log.debug("sig_id is null, which means that it is a MOA signature -> choose a hotfix base64 connector (thus it is moa - it doesn't matter)."); - - return chooseEnvelopedBase64ConnectorHotfix(profile, connector); - } - - String[] sig_id_parts = sig_id.split("@"); - if (sig_id_parts.length == 2) - { - log.debug("sig_id has 2 @-separated parts -> choosing old base64 connector"); - - return chooseEnvelopedBase64ConnectorOld(profile, connector); - } - if (sig_id_parts[0].equals(HotfixIdFormatter.SIG_ID_PREFIX)) - { - log.debug("sig_id prefix is hotfix -> choosing hotfix base64 connector"); - - return chooseEnvelopedBase64ConnectorHotfix(profile, connector); - } - - throw new ConnectorException(300, "The SIG_KZ version is 1.0.0, but SIG_ID is neither MOA nor Old base64 nor Hotfix base64 ???'"); - } - if (sig_kz.getVersion().equals(SignatorFactory.VERSION_1_1_0)) - { - log.debug("Version is 1.1.0 -> chose a detached connector."); - - return chooseDetachedMultipartConnector(profile, connector); - } - - throw new ConnectorException(310, "The SIG_KZ version '" + sig_kz.getVersion() + "' is unknown."); - } +// public static Connector chooseCommandlineConnectorForVerify(String connector, +// PdfASID sig_kz, String sig_id, String profile) throws ConnectorException +// { +// log.debug("Choosing Connector for Commandline verification..."); +// +// log.debug("connector type = " + connector); +// log.debug("sig_kz = " + sig_kz); //$NON-NLS-1$ +// log.debug("sig_id = " + sig_id); //$NON-NLS-1$ +// +// if (sig_kz == null) +// { +// log.debug("sig_kz is null -> chose an old enveloped base64 connector"); //$NON-NLS-1$ +// +// return chooseEnvelopedBase64ConnectorOld(profile, connector); +// } +// +// log.debug("sig_kz is not null -> one of the newer signatures"); +// +// if (sig_kz.getVersion().equals(SignatorFactory.VERSION_1_0_0)) +// { +// log.debug("Version is 1.0.0 -> Base64 Signatur (old or Hotfix)."); +// +// if (sig_id == null) +// { +// log.debug("sig_id is null, which means that it is a MOA signature -> choose a hotfix base64 connector (thus it is moa - it doesn't matter)."); +// +// return chooseEnvelopedBase64ConnectorHotfix(profile, connector); +// } +// +// String[] sig_id_parts = sig_id.split("@"); +// if (sig_id_parts.length == 2) +// { +// log.debug("sig_id has 2 @-separated parts -> choosing old base64 connector"); +// +// return chooseEnvelopedBase64ConnectorOld(profile, connector); +// } +// if (sig_id_parts[0].equals(HotfixIdFormatter.SIG_ID_PREFIX)) +// { +// log.debug("sig_id prefix is hotfix -> choosing hotfix base64 connector"); +// +// return chooseEnvelopedBase64ConnectorHotfix(profile, connector); +// } +// +// throw new ConnectorException(300, "The SIG_KZ version is 1.0.0, but SIG_ID is neither MOA nor Old base64 nor Hotfix base64 ???'"); +// } +// if (sig_kz.getVersion().equals(SignatorFactory.VERSION_1_1_0)) +// { +// log.debug("Version is 1.1.0 -> chose a detached connector."); +// +// return chooseDetachedMultipartConnector(profile, connector); +// } +// +// throw new ConnectorException(310, "The SIG_KZ version '" + sig_kz.getVersion() + "' is unknown."); +// } protected static final String BKU = "bku"; //$NON-NLS-1$ -- cgit v1.2.3