au.gov.nehta.vendorlibrary.smd
Class TransportResponseDeliveryClient

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

public class TransportResponseDeliveryClient
extends java.lang.Object

An implementation of a Transport Response Delivery client.
Code Example:

   TransportResponseDeliveryClient trdClient = new TransportResponseDeliveryClient(sslSocketFactory);

   TransportResponseMetadataType transportResponseMetadataType = getTransportResponseMetadataType(MessageMetadataType,
 sourceOrganisation, transportResponseTime);

 DeliverStatusType deliverStatusType = trdClient.deliver(transportResponseMetadataTypeList, trdEndpointURL);

 


Nested Class Summary
static class TransportResponseDeliveryClient.ArgumentValidator
          Validates that the parameters are correct for the various operations.
 
Constructor Summary
TransportResponseDeliveryClient(javax.net.ssl.SSLSocketFactory sslSocketFactory)
          Default constructor.
 
Method Summary
 au.net.electronichealth.ns.trd.tls.v2010.DeliverStatusType deliver(java.util.List<au.net.electronichealth.ns.smd.xsd.transportresponse._2010.TransportResponseType> transportResponseTypeList, java.lang.String endpoint)
          Performs the Transport Response Delivery deliver operation.
static au.net.electronichealth.ns.smd.xsd.transportresponse._2010.DeliveryResponseType getDeliveryResponseType(byte[] digest, au.net.electronichealth.ns.smd.xsd.transportresponse._2010.ResponseClassType responseClassType, java.lang.String responseCode)
          Returns DeliveryResponseType for the provided digest and transport response artifacts.
static byte[] getDigestValueFromSealedMessage(au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType sealedMessageType, javax.security.auth.x500.X500PrivateCredential x500PrivateCredential)
          Returns the digest value of the sealedMessageType payload.
 java.lang.String getLastSoapRequest()
          Getter for lastSoapRequest.
 java.lang.String getLastSoapResponse()
          Getter for lastSoapResponse.
static au.net.electronichealth.ns.smd.xsd.transportresponse._2010.TransportResponseMetadataType getTransportResponseMetadataType(au.net.electronichealth.ns.smd.types.sealedmessage.V2010.MessageMetadataType messageMetadataType, java.lang.String sourceOrganisation, javax.xml.datatype.XMLGregorianCalendar transportResponseTime)
          Returns Transport ResponseMetadataType for the provided sealed messageMetaDataType.
static au.net.electronichealth.ns.smd.xsd.transportresponse._2010.TransportResponseType getTransportResponseType(au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType sealedMessageType, au.net.electronichealth.ns.smd.xsd.transportresponse._2010.ResponseClassType responseClassType, java.lang.String deliveryResponseCode, java.lang.String deliveryResponseMessage, javax.xml.datatype.XMLGregorianCalendar transportResponseTime, java.lang.String responseId, boolean isFinal, java.lang.String sourceOrganisation, javax.security.auth.x500.X500PrivateCredential x500PrivateCredential)
          Creates a valid TransportResponseType with the provided Sealed message and transport response attributes.
static void verifyDeliveryResponseType(au.net.electronichealth.ns.smd.xsd.transportresponse._2010.DeliveryResponseType deliveryResponseType, byte[] sealedMessageDigestValue, java.lang.String deliveryResponseMessage, java.lang.String deliveryResponseCode)
          Verifies a transport Delivery Response for the provided transport response artifacts.
static void verifyTransportResponseType(au.net.electronichealth.ns.smd.xsd.transportresponse._2010.TransportResponseType transportResponseType, au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType sealedMessageType, au.net.electronichealth.ns.smd.xsd.transportresponse._2010.ResponseClassType responseClassType, java.lang.String sourceOrganisation, javax.security.auth.x500.X500PrivateCredential x500PrivateCredential, java.lang.String deliveryResponseMessage, java.lang.String deliveryResponseCode)
          Verifies a transport response message and metadata for the provided Sealed Message Delivery and transport response attributes.
static void verifyTransportResponseWithSealedMessage(au.net.electronichealth.ns.smd.xsd.transportresponse._2010.TransportResponseType transportResponseType, au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType sealedMessageType, java.lang.String sourceOrganisation)
          Verifies a transport response with the provided Sealed Message Delivery.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransportResponseDeliveryClient

public TransportResponseDeliveryClient(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

getTransportResponseType

public static au.net.electronichealth.ns.smd.xsd.transportresponse._2010.TransportResponseType getTransportResponseType(au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType sealedMessageType,
                                                                                                                        au.net.electronichealth.ns.smd.xsd.transportresponse._2010.ResponseClassType responseClassType,
                                                                                                                        java.lang.String deliveryResponseCode,
                                                                                                                        java.lang.String deliveryResponseMessage,
                                                                                                                        javax.xml.datatype.XMLGregorianCalendar transportResponseTime,
                                                                                                                        java.lang.String responseId,
                                                                                                                        boolean isFinal,
                                                                                                                        java.lang.String sourceOrganisation,
                                                                                                                        javax.security.auth.x500.X500PrivateCredential x500PrivateCredential)
                                                                                                                 throws au.gov.nehta.xsp.XspException
Creates a valid TransportResponseType with the provided Sealed message and transport response attributes.

Parameters:
sealedMessageType - the sealed Message from corresponding Sealed Message (Mandatory)
responseClassType - the transport response responseClass type (Mandatory)
deliveryResponseCode - the transport response responseCode (Mandatory)
deliveryResponseMessage - the transport response sensitive payload (Mandatory)
transportResponseTime - the transport response timestamp (Mandatory)
responseId - the the transport response responseId (Mandatory)
isFinal - boolean flag to indicate final transport response (Mandatory)
sourceOrganisation - the transport response source organisation (Mandatory)
x500PrivateCredential - the Sealed message payload decrypting credentials(Mandatory)
Returns:
TransportResponseType instance.
Throws:
au.gov.nehta.xsp.XspException - if the provided Sealed message payload / decrypting credentials are invalid

verifyTransportResponseType

public static void verifyTransportResponseType(au.net.electronichealth.ns.smd.xsd.transportresponse._2010.TransportResponseType transportResponseType,
                                               au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType sealedMessageType,
                                               au.net.electronichealth.ns.smd.xsd.transportresponse._2010.ResponseClassType responseClassType,
                                               java.lang.String sourceOrganisation,
                                               javax.security.auth.x500.X500PrivateCredential x500PrivateCredential,
                                               java.lang.String deliveryResponseMessage,
                                               java.lang.String deliveryResponseCode)
                                        throws au.gov.nehta.xsp.XspException
Verifies a transport response message and metadata for the provided Sealed Message Delivery and transport response attributes.

Parameters:
transportResponseType - the transport response to be verified (Mandatory)
sealedMessageType - the sealed message type from the corresponding Sealed Message (Mandatory)
responseClassType - the transport response responseClass type (Mandatory)
sourceOrganisation - the transport response source organisation (Mandatory)
x500PrivateCredential - the Sealed message payload decrypting credentials(Mandatory)
deliveryResponseMessage - the transport response message (Mandatory)
deliveryResponseCode - the transport response code (Mandatory)
Throws:
au.gov.nehta.xsp.XspException - if the provided Sealed message payload / decrypting credentials are invalid

getDigestValueFromSealedMessage

public static byte[] getDigestValueFromSealedMessage(au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType sealedMessageType,
                                                     javax.security.auth.x500.X500PrivateCredential x500PrivateCredential)
                                              throws au.gov.nehta.xsp.XspException
Returns the digest value of the sealedMessageType payload.

Parameters:
sealedMessageType - the sealed message instance (Mandatory)
x500PrivateCredential - the Sealed message payload decrypting credentials(Mandatory)
Returns:
digest value from the sealedMessageType XSP payload
Throws:
au.gov.nehta.xsp.XspException - if the provided Sealed message payload / decrypting credentials are invalid

verifyTransportResponseWithSealedMessage

public static void verifyTransportResponseWithSealedMessage(au.net.electronichealth.ns.smd.xsd.transportresponse._2010.TransportResponseType transportResponseType,
                                                            au.net.electronichealth.ns.smd.types.sealedmessage.V2010.SealedMessageType sealedMessageType,
                                                            java.lang.String sourceOrganisation)
Verifies a transport response with the provided Sealed Message Delivery.

Parameters:
transportResponseType - the transport response to be verified (Mandatory)
sealedMessageType - the sealed message type from the corresponding Sealed Message (Mandatory)
sourceOrganisation - the transport response source organisation (Mandatory)

verifyDeliveryResponseType

public static void verifyDeliveryResponseType(au.net.electronichealth.ns.smd.xsd.transportresponse._2010.DeliveryResponseType deliveryResponseType,
                                              byte[] sealedMessageDigestValue,
                                              java.lang.String deliveryResponseMessage,
                                              java.lang.String deliveryResponseCode)
Verifies a transport Delivery Response for the provided transport response artifacts.

Parameters:
deliveryResponseType - the transport delivery response to be verified (Mandatory)
sealedMessageDigestValue - the digest value from the corresponding sealed message (Mandatory)
deliveryResponseMessage - the transport delivery response message to check against deliveryResponseType (Mandatory)
deliveryResponseCode - the transport response code to check against deliveryResponseCode (Mandatory)

getTransportResponseMetadataType

public static au.net.electronichealth.ns.smd.xsd.transportresponse._2010.TransportResponseMetadataType getTransportResponseMetadataType(au.net.electronichealth.ns.smd.types.sealedmessage.V2010.MessageMetadataType messageMetadataType,
                                                                                                                                        java.lang.String sourceOrganisation,
                                                                                                                                        javax.xml.datatype.XMLGregorianCalendar transportResponseTime)
Returns Transport ResponseMetadataType for the provided sealed messageMetaDataType.

Parameters:
messageMetadataType - the sealed messageMetadataType instance from the Sealed Message (Mandatory)
sourceOrganisation - the transport response source organisation (Mandatory)
transportResponseTime - the transport response timestamp (Mandatory)
Returns:
TransportResponseMetadataType instance

getDeliveryResponseType

public static au.net.electronichealth.ns.smd.xsd.transportresponse._2010.DeliveryResponseType getDeliveryResponseType(byte[] digest,
                                                                                                                      au.net.electronichealth.ns.smd.xsd.transportresponse._2010.ResponseClassType responseClassType,
                                                                                                                      java.lang.String responseCode)
Returns DeliveryResponseType for the provided digest and transport response artifacts.

Parameters:
digest - the SealedMessage digest value (Mandatory)
responseClassType - the ResponseClassType to be in the transport response (Mandatory)
responseCode - the response code to the transport response (Mandatory)
Returns:
DeliveryResponseType instance

deliver

public final au.net.electronichealth.ns.trd.tls.v2010.DeliverStatusType deliver(java.util.List<au.net.electronichealth.ns.smd.xsd.transportresponse._2010.TransportResponseType> transportResponseTypeList,
                                                                                java.lang.String endpoint)
                                                                         throws au.net.electronichealth.ns.trd.tls.v2010.StandardErrorMsg,
                                                                                au.net.electronichealth.ns.trd.tls.v2010.DeliverErrorMsg
Performs the Transport Response Delivery deliver operation.

Parameters:
transportResponseTypeList - the list of Transport Response to be delivered (Mandatory)
endpoint - the Transport Response Delivery (TRD) endpoint (Mandatory)
Returns:
DeliverStatusType if the web service invocation is successful.
Throws:
au.net.electronichealth.ns.trd.tls.v2010.StandardErrorMsg - if the web service invocation fails due to a standard error.
au.net.electronichealth.ns.trd.tls.v2010.DeliverErrorMsg - if the web service invocation fails due to a deliver error.

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)