org.apache.ws.security.handler
Class WSS4JHandler

java.lang.Object
  extended byorg.apache.ws.security.handler.WSHandler
      extended byorg.apache.ws.security.handler.WSS4JHandler
All Implemented Interfaces:
javax.xml.rpc.handler.Handler

public class WSS4JHandler
extends WSHandler
implements javax.xml.rpc.handler.Handler

Merged and converted the the axis handlers WSDoAllReceiver and WSDoAllSender into a single JAX-RPC Handler. All the axis dependencies are removed.

Author:
Venkat Reddy (vreddyp@gmail.com).

Field Summary
 
Fields inherited from class org.apache.ws.security.handler.WSHandler
cryptos, DONE, secEngine
 
Constructor Summary
WSS4JHandler()
           
 
Method Summary
 void destroy()
          Destroys the Handler instance.
 boolean doReceiver(javax.xml.rpc.handler.MessageContext mc, RequestData reqData, boolean isRequest)
          handle responses
 boolean doSender(javax.xml.rpc.handler.MessageContext mc, RequestData reqData, boolean isRequest)
          Handles incoming web service requests and outgoing responses
 javax.xml.namespace.QName[] getHeaders()
           
 java.lang.Object getOption(java.lang.String key)
           
 java.lang.String getPassword(java.lang.Object msgContext)
           
 java.lang.Object getProperty(java.lang.Object msgContext, java.lang.String key)
           
 boolean handleFault(javax.xml.rpc.handler.MessageContext mc)
          Handles SOAP Faults that may occur during message processing
 boolean handleRequest(javax.xml.rpc.handler.MessageContext mc)
           
 boolean handleResponse(javax.xml.rpc.handler.MessageContext mc)
           
 void init(javax.xml.rpc.handler.HandlerInfo hi)
          Initializes the instance of the handler.
static org.w3c.dom.Document messageToDocument(javax.xml.soap.SOAPMessage message)
          Utility method to convert SOAPMessage to org.w3c.dom.Document
 boolean processMessage(javax.xml.rpc.handler.MessageContext mc, boolean isRequestMessage)
          Switch for transferring control to doReceiver and doSender
 void setPassword(java.lang.Object msgContext, java.lang.String password)
           
 void setProperty(java.lang.Object msgContext, java.lang.String key, java.lang.Object value)
           
 
Methods inherited from class org.apache.ws.security.handler.WSHandler
checkReceiverResults, checkSignatureConfirmation, decodeCustomPasswordTypes, decodeDecryptionParameter, decodeEnableSignatureConfirmation, decodeEncryptionParameter, decodeMustUnderstand, decodeSignatureParameter, decodeSignatureParameter2, decodeTimestampPrecision, decodeTimestampStrict, decodeTimeToLive, decodeUTParameter, doReceiverAction, doSenderAction, getClassLoader, getPassword, getPasswordCB, getString, getStringOption, loadDecryptionCrypto, loadEncryptionCrypto, loadSignatureCrypto, verifyTimestamp, verifyTrust
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSS4JHandler

public WSS4JHandler()
Method Detail

init

public void init(javax.xml.rpc.handler.HandlerInfo hi)
Initializes the instance of the handler.

Specified by:
init in interface javax.xml.rpc.handler.Handler

destroy

public void destroy()
Destroys the Handler instance.

Specified by:
destroy in interface javax.xml.rpc.handler.Handler

getHeaders

public javax.xml.namespace.QName[] getHeaders()
Specified by:
getHeaders in interface javax.xml.rpc.handler.Handler

handleRequest

public boolean handleRequest(javax.xml.rpc.handler.MessageContext mc)
Specified by:
handleRequest in interface javax.xml.rpc.handler.Handler

handleResponse

public boolean handleResponse(javax.xml.rpc.handler.MessageContext mc)
Specified by:
handleResponse in interface javax.xml.rpc.handler.Handler

handleFault

public boolean handleFault(javax.xml.rpc.handler.MessageContext mc)
Handles SOAP Faults that may occur during message processing

Specified by:
handleFault in interface javax.xml.rpc.handler.Handler

processMessage

public boolean processMessage(javax.xml.rpc.handler.MessageContext mc,
                              boolean isRequestMessage)
                       throws WSSecurityException
Switch for transferring control to doReceiver and doSender

Throws:
WSSecurityException

doSender

public boolean doSender(javax.xml.rpc.handler.MessageContext mc,
                        RequestData reqData,
                        boolean isRequest)
                 throws WSSecurityException
Handles incoming web service requests and outgoing responses

Throws:
WSSecurityException

doReceiver

public boolean doReceiver(javax.xml.rpc.handler.MessageContext mc,
                          RequestData reqData,
                          boolean isRequest)
                   throws WSSecurityException
handle responses

Parameters:
mc -
reqData -
Returns:
true on successful processing
Throws:
WSSecurityException

messageToDocument

public static org.w3c.dom.Document messageToDocument(javax.xml.soap.SOAPMessage message)
Utility method to convert SOAPMessage to org.w3c.dom.Document


getOption

public java.lang.Object getOption(java.lang.String key)
Specified by:
getOption in class WSHandler

getProperty

public java.lang.Object getProperty(java.lang.Object msgContext,
                                    java.lang.String key)
Specified by:
getProperty in class WSHandler

setProperty

public void setProperty(java.lang.Object msgContext,
                        java.lang.String key,
                        java.lang.Object value)
Specified by:
setProperty in class WSHandler

getPassword

public java.lang.String getPassword(java.lang.Object msgContext)
Specified by:
getPassword in class WSHandler

setPassword

public void setPassword(java.lang.Object msgContext,
                        java.lang.String password)
Specified by:
setPassword in class WSHandler


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.