au.gov.nehta.vendorlibrary.hi.handler.security
Class HISecurityHandler

java.lang.Object
  extended by au.gov.nehta.vendorlibrary.hi.handler.security.HISecurityHandler
All Implemented Interfaces:
javax.xml.ws.handler.Handler<javax.xml.ws.handler.soap.SOAPMessageContext>, javax.xml.ws.handler.soap.SOAPHandler<javax.xml.ws.handler.soap.SOAPMessageContext>

public class HISecurityHandler
extends java.lang.Object
implements javax.xml.ws.handler.soap.SOAPHandler<javax.xml.ws.handler.soap.SOAPMessageContext>

This SOAP handler constructs the Medicare HI security header elements in the outgoing SOAP requests and verifies incoming SOAP Response from HI service to ensure conformance to HI guidelines. If a SOAP handler is specified in the handler chain of a JAX-WS client or service, JAX-WS will call the SOAP handler before a SOAP message is sent and after a SOAP message has been received.


Field Summary
static java.lang.String COMMON_COREELEMENTS_NS
          Medicare HI header UHI audit XML element namespace.
static java.lang.String DIG_NS
          Digital Signature namespace .
static au.gov.nehta.xsp.CertificateVerifier NULL_CERTIFICATE_VERIFIER
          CertificateVerifier instance to sign/verify incoming and outgoing SOAP messages.
static java.lang.String PRODUCT
          Medicare HI header product XML element local name.
static java.lang.String SIGNATURE_ELEM
          Medicare HI header Signature XML element local name.
static java.lang.String TIMESTAMP
          Medicare HI header timestamp XML element local name.
static java.lang.String USER
          Medicare HI header User XML element local name .
 
Constructor Summary
HISecurityHandler(java.security.cert.X509Certificate x509Certificate, java.security.PrivateKey privateKey)
          Default constructor.
 
Method Summary
 void close(javax.xml.ws.handler.MessageContext context)
          Does nothing
Not utilised for dumping SOAP message.
 java.util.Set<javax.xml.namespace.QName> getHeaders()
          Does nothing returns null.
Ignore processing of SOAP header as the primary intention is just to 'Dump' the SOAP message
 boolean handleFault(javax.xml.ws.handler.soap.SOAPMessageContext context)
          Ignore Fault and continues with processing logical handling of message.
 boolean handleMessage(javax.xml.ws.handler.soap.SOAPMessageContext context)
          Updates the SOAP headers in outgoing SOAP requests to ensure conformance to NEHTA's guidelines.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRODUCT

public static final java.lang.String PRODUCT
Medicare HI header product XML element local name.

See Also:
Constant Field Values

TIMESTAMP

public static final java.lang.String TIMESTAMP
Medicare HI header timestamp XML element local name.

See Also:
Constant Field Values

USER

public static final java.lang.String USER
Medicare HI header User XML element local name .

See Also:
Constant Field Values

COMMON_COREELEMENTS_NS

public static final java.lang.String COMMON_COREELEMENTS_NS
Medicare HI header UHI audit XML element namespace.

See Also:
Constant Field Values

DIG_NS

public static final java.lang.String DIG_NS
Digital Signature namespace .

See Also:
Constant Field Values

SIGNATURE_ELEM

public static final java.lang.String SIGNATURE_ELEM
Medicare HI header Signature XML element local name.

See Also:
Constant Field Values

NULL_CERTIFICATE_VERIFIER

public static final au.gov.nehta.xsp.CertificateVerifier NULL_CERTIFICATE_VERIFIER
CertificateVerifier instance to sign/verify incoming and outgoing SOAP messages. Validation ignored with an assumption that the certificates under test are valid. Must include validation code for production purpose

Constructor Detail

HISecurityHandler

public HISecurityHandler(java.security.cert.X509Certificate x509Certificate,
                         java.security.PrivateKey privateKey)
Default constructor.

Parameters:
x509Certificate - the certificate key to be used for signing (Mandatory)
privateKey - the private key to be used for signing (Mandatory)
Method Detail

handleMessage

public final boolean handleMessage(javax.xml.ws.handler.soap.SOAPMessageContext context)
Updates the SOAP headers in outgoing SOAP requests to ensure conformance to NEHTA's guidelines.

Specified by:
handleMessage in interface javax.xml.ws.handler.Handler<javax.xml.ws.handler.soap.SOAPMessageContext>
Parameters:
context - the incoming / outgoing soap message context
Returns:
true Always returns true.
See Also:
Handler.handleMessage(javax.xml.ws.handler.MessageContext)

handleFault

public final boolean handleFault(javax.xml.ws.handler.soap.SOAPMessageContext context)
Ignore Fault and continues with processing logical handling of message.

Specified by:
handleFault in interface javax.xml.ws.handler.Handler<javax.xml.ws.handler.soap.SOAPMessageContext>
Parameters:
context - the incoming / outgoing soap message context
Returns:
true if the handle signature check is successful.
See Also:
Handler.handleFault(javax.xml.ws.handler.MessageContext)

getHeaders

public final java.util.Set<javax.xml.namespace.QName> getHeaders()
Does nothing returns null.
Ignore processing of SOAP header as the primary intention is just to 'Dump' the SOAP message

Specified by:
getHeaders in interface javax.xml.ws.handler.soap.SOAPHandler<javax.xml.ws.handler.soap.SOAPMessageContext>
Returns:
@see javax.xml.ws.handler.soap.SOAPHandler#getHeaders()

close

public void close(javax.xml.ws.handler.MessageContext context)
Does nothing
Not utilised for dumping SOAP message.

Specified by:
close in interface javax.xml.ws.handler.Handler<javax.xml.ws.handler.soap.SOAPMessageContext>
Parameters:
context - @see javax.xml.ws.handler.Handler#close(javax.xml.ws.handler.MessageContext)