at.knowcenter.wag.egov.egiz.sig.connectors.bku
Class DetachedBKUConnector

java.lang.Object
  extended byat.knowcenter.wag.egov.egiz.sig.connectors.bku.DetachedBKUConnector
All Implemented Interfaces:
Connector, LocalConnector
Direct Known Subclasses:
LocRefDetachedBKUConnector, MultipartDetachedBKUConnector

public class DetachedBKUConnector
extends Object
implements Connector, LocalConnector

Connects to the BKU using the detached multipart/formdata requests.

This feature is available since BKU version 2.7.4.

Author:
wprinz

Nested Class Summary
static class DetachedBKUConnector.Environment
          Holds environment configuration information like templates.
 
Field Summary
protected  DetachedBKUConnector.Environment environment
          The environemnt configuration of this connector containing templates and other configurable elements.
protected  ConnectorParameters params
          The connector parameters.
 
Constructor Summary
DetachedBKUConnector(ConnectorParameters connectorParameters, String loc_ref_content)
          Constructor that builds the configuration environment for this connector according to the given profile.
 
Method Summary
 SignSignatureObject analyzeSignResponse(Properties response_properties)
          Analyzes the sign response xml and extracts the signature data.
 SignatureResponse analyzeVerifyResponse(Properties response_properties)
          Analyzes the verify response string.
 SignSignatureObject doSign(SignatureData data)
          Performs a sign.
 SignatureResponse doVerify(SignatureData data, SignSignatureObject so)
          Performs a verification.
static String[] parseSigIds(String sig_ids)
           
 String prepareSignRequest(SignatureData data)
          Prepares the sign request xml to be sent using the sign request template.
 String prepareVerifyRequest(SignatureData data, SignSignatureObject so)
          Prepares the verify request xml to be sent using the verify request template.
 String prepareXMLContent(SignatureData data, SignSignatureObject so)
          Prepares the XML content the holds the actual signature data.
protected  Properties sendRequest(String url, String request_string, SignatureData data)
          Sends the request and data to the given URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

params

protected ConnectorParameters params
The connector parameters.


environment

protected DetachedBKUConnector.Environment environment
The environemnt configuration of this connector containing templates and other configurable elements.

Constructor Detail

DetachedBKUConnector

public DetachedBKUConnector(ConnectorParameters connectorParameters,
                            String loc_ref_content)
                     throws ConnectorException
Constructor that builds the configuration environment for this connector according to the given profile.

If confuguration parameters are not defined on that profile, the default parameters defined in the configuration are used.

Parameters:
connectorParameters - The connectot parameters.
Throws:
ConnectorException - f.e.
Method Detail

prepareSignRequest

public String prepareSignRequest(SignatureData data)
                          throws ConnectorException
Prepares the sign request xml to be sent using the sign request template.

Specified by:
prepareSignRequest in interface LocalConnector
Parameters:
data - The SignatureData.
Returns:
Returns the sign request xml to be sent.
Throws:
ConnectorException - f.e.

analyzeSignResponse

public SignSignatureObject analyzeSignResponse(Properties response_properties)
                                        throws ConnectorException
Analyzes the sign response xml and extracts the signature data.

Specified by:
analyzeSignResponse in interface LocalConnector
Parameters:
response_properties - The response properties containing the response String and transport related information.
Returns:
Returns the extracted data encapsulated in a SignatureObject.
Throws:
ConnectorException - f.e.

parseSigIds

public static String[] parseSigIds(String sig_ids)

sendRequest

protected Properties sendRequest(String url,
                                 String request_string,
                                 SignatureData data)
                          throws ConnectorException
Sends the request and data to the given URL.

This method mainly handles communication exceptions. The actual send work is done by doPostRequestMultipart.

Parameters:
url - The URL to send the request to.
request_string - The request XML.
data - The data.
Returns:
Returns the response properties containing among others the response XML.
Throws:
ConnectorException - f.e.
See Also:
BKUPostConnection.doPostRequestMultipart(String, String, SignatureData)

doSign

public SignSignatureObject doSign(SignatureData data)
                           throws ConnectorException
Performs a sign.

Specified by:
doSign in interface Connector
Parameters:
data - The data to be signed.
Returns:
Returns the signature object containing the signature data.
Throws:
ConnectorException - f.e.

doVerify

public SignatureResponse doVerify(SignatureData data,
                                  SignSignatureObject so)
                           throws ConnectorException
Performs a verification.

Specified by:
doVerify in interface Connector
Parameters:
data - The data to be verified.
so - The signature object with the signature information.
Returns:
Returns the SignatureResponse with the result of the verification.
Throws:
ConnectorException - f.e.

prepareVerifyRequest

public String prepareVerifyRequest(SignatureData data,
                                   SignSignatureObject so)
                            throws ConnectorException
Prepares the verify request xml to be sent using the verify request template.

Specified by:
prepareVerifyRequest in interface LocalConnector
Parameters:
data - The SignatureData.
so - The signature information object.
Returns:
Returns the verify request xml to be sent.
Throws:
ConnectorException - f.e.

prepareXMLContent

public String prepareXMLContent(SignatureData data,
                                SignSignatureObject so)
                         throws ConnectorException
Prepares the XML content the holds the actual signature data.

This strongly rebuilds the XML content as retuned from a sign request.

Parameters:
data - The data.
so - The signature object containing the signature information.
Returns:
Returns the XML content.
Throws:
ConnectorException - f.e.

analyzeVerifyResponse

public SignatureResponse analyzeVerifyResponse(Properties response_properties)
                                        throws ConnectorException
Analyzes the verify response string.

Specified by:
analyzeVerifyResponse in interface LocalConnector
Parameters:
response_properties - The response properties containing the response XML.
Returns:
Returns the SignatureResponse containing the verification result.
Throws:
ConnectorException - f.e.


Copyright © 2006-2010. All Rights Reserved.