au.gov.nehta.vendorlibrary.smd
Class SealedMessageRetrievalClient

java.lang.Object
  extended by au.gov.nehta.vendorlibrary.smd.SealedMessageRetrievalClient

public class SealedMessageRetrievalClient
extends java.lang.Object

An implementation of a Sealed Message Retrieval client.


Constructor Summary
SealedMessageRetrievalClient(javax.net.ssl.SSLSocketFactory sslSocketFactory)
          Default constructor.
 
Method Summary
static org.w3c.dom.Document getDecryptedSignedPayload(au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType sealedMessage, javax.security.auth.x500.X500PrivateCredential privateCredential)
          Obtains the decrypted signed payload data from a Sealed Message.
 java.lang.String getLastSoapRequest()
          Getter for lastSoapRequest.
 java.lang.String getLastSoapResponse()
          Getter for lastSoapResponse.
static org.w3c.dom.Document getPayload(org.w3c.dom.Document decryptedSignedPayload)
          Obtains payload data from a decrypted signed payload.
 au.net.electronichealth.ns.smr.tls.v2010.MessageListType list(java.lang.String receiverOrganisation, boolean allAvailable, int limit, java.lang.String endpoint)
          Performs the Sealed Message Retrieval list operation.
 java.util.List<au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType> retrieve(java.lang.String receiverOrganisation, java.util.List<java.lang.String> invocationIdentifiers, java.lang.String endpoint)
          Performs the Sealed Message Retrieval retrieve operation.
static boolean verifyPayloadSignature(org.w3c.dom.Document decryptedSignedPayload, au.gov.nehta.xsp.CertificateVerifier certificateVerifier)
          Verifies the signature of a decrypted payload.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SealedMessageRetrievalClient

public SealedMessageRetrievalClient(javax.net.ssl.SSLSocketFactory sslSocketFactory)
Default constructor.

Parameters:
sslSocketFactory - the SSL Socket Factory to be used when connecting to the Web Service provider (Mandatory)
Method Detail

retrieve

public final java.util.List<au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType> retrieve(java.lang.String receiverOrganisation,
                                                                                                                 java.util.List<java.lang.String> invocationIdentifiers,
                                                                                                                 java.lang.String endpoint)
                                                                                                          throws au.net.electronichealth.ns.smr.tls.v2010.RetrieveErrorMsg,
                                                                                                                 au.net.electronichealth.ns.smr.tls.v2010.StandardErrorMsg
Performs the Sealed Message Retrieval retrieve operation.

Parameters:
receiverOrganisation - the receiver organisation. (Mandatory)
invocationIdentifiers - the list of invocation identifiers to retrieve. (Mandatory)
endpoint - the Sealed Message Delivery (SMD) endpoint. (Mandatory)
Returns:
List the list of Sealed Messages being retrieved.
Throws:
au.net.electronichealth.ns.smr.tls.v2010.StandardErrorMsg - if the web service invocation fails due to a standard error
au.net.electronichealth.ns.smr.tls.v2010.RetrieveErrorMsg - if the web service invocation fails due to a retrieve error

list

public final au.net.electronichealth.ns.smr.tls.v2010.MessageListType list(java.lang.String receiverOrganisation,
                                                                           boolean allAvailable,
                                                                           int limit,
                                                                           java.lang.String endpoint)
                                                                    throws au.net.electronichealth.ns.smr.tls.v2010.ListErrorMsg,
                                                                           au.net.electronichealth.ns.smr.tls.v2010.StandardErrorMsg
Performs the Sealed Message Retrieval list operation.

Parameters:
receiverOrganisation - the receiver organisation (Mandatory)
allAvailable - whether or not to list all Sealed Messages which are available (Mandatory)
limit - limit the number of Sealed Messages in the list (Mandatory)
endpoint - the Sealed Message Delivery (SMD) endpoint (Mandatory)
Returns:
MessageListType the list of messages available for retrieval.
Throws:
au.net.electronichealth.ns.smr.tls.v2010.StandardErrorMsg - if the web service invocation fails due to a standard error
au.net.electronichealth.ns.smr.tls.v2010.ListErrorMsg - if the web service invocation fails due to a list error

getDecryptedSignedPayload

public static org.w3c.dom.Document getDecryptedSignedPayload(au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType sealedMessage,
                                                             javax.security.auth.x500.X500PrivateCredential privateCredential)
                                                      throws au.gov.nehta.xsp.XspException
Obtains the decrypted signed payload data from a Sealed Message.

Parameters:
sealedMessage - the sealed message containing the encrypted payload (Mandatory)
privateCredential - the private credentials (private key and certificate) required to decrypt the sealed message's encrypted payload (Mandatory)
Returns:
the payload
Throws:
au.gov.nehta.xsp.XspException - if an XSP error occurs while trying to decrypt the payload.

getPayload

public static org.w3c.dom.Document getPayload(org.w3c.dom.Document decryptedSignedPayload)
                                       throws au.gov.nehta.xsp.XspException
Obtains payload data from a decrypted signed payload.

Parameters:
decryptedSignedPayload - the decrypted signed payload from the received sealed message (Mandatory)
Returns:
the payload
Throws:
au.gov.nehta.xsp.XspException - if an XSP error occurs while trying to decrypt the payload.

verifyPayloadSignature

public static boolean verifyPayloadSignature(org.w3c.dom.Document decryptedSignedPayload,
                                             au.gov.nehta.xsp.CertificateVerifier certificateVerifier)
                                      throws au.gov.nehta.xsp.XspException,
                                             au.gov.nehta.xsp.SignatureValidationException,
                                             au.gov.nehta.xsp.CertificateVerificationException
Verifies the signature of a decrypted payload.

Parameters:
decryptedSignedPayload - the decrypted signed payload from the received sealed message (Mandatory)
certificateVerifier - the CertificateVerifier implementation which should be used to verify the certificate used to verify the signature (Mandatory)
Returns:
validSignature true if the signature is valid, otherwise false
Throws:
au.gov.nehta.xsp.XspException - if an XSP error occurs while trying to obtain the signature of the payload.
au.gov.nehta.xsp.SignatureValidationException - if a Signature Validation exception error occurs while trying to obtain the signature of the payload.
au.gov.nehta.xsp.CertificateVerificationException - if a Certificate Verifier exception error occurs

getLastSoapResponse

public final java.lang.String getLastSoapResponse()
Getter for lastSoapResponse.

Returns:
lastSoapResponse the lastSoapResponse instance variable

getLastSoapRequest

public final java.lang.String getLastSoapRequest()
Getter for lastSoapRequest.

Returns:
lastSoapRequest the lastSoapRequest instance variable (Mandatory)