|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.ws.soap.security.AbstractWsSecurityInterceptor
public abstract class AbstractWsSecurityInterceptor
Interceptor base class for interceptors that handle WS-Security.
Subclasses of this base class can be configured to validate incoming and secure outgoing messages. By default, both are on.
Field Summary | |
---|---|
protected Log |
logger
Logger available to subclasses. |
Constructor Summary | |
---|---|
AbstractWsSecurityInterceptor()
|
Method Summary | |
---|---|
protected abstract void |
cleanUp()
|
boolean |
handleFault(MessageContext messageContext,
Object endpoint)
Returns true , i.e. faults are not secured. |
protected boolean |
handleFaultException(WsSecurityFaultException ex,
MessageContext messageContext)
Handles a fault exception.Default implementation logs the given exception, and creates a SOAP Fault with the properties of the given exception, and returns false . |
boolean |
handleRequest(MessageContext messageContext,
Object endpoint)
Processes the incoming request message. |
boolean |
handleResponse(MessageContext messageContext,
Object endpoint)
Processes the outgoing response message. |
protected boolean |
handleSecurementException(WsSecuritySecurementException ex,
MessageContext messageContext)
Handles an securement exception. |
protected boolean |
handleValidationException(WsSecurityValidationException ex,
MessageContext messageContext)
Handles an invalid SOAP message. |
protected abstract void |
secureMessage(SoapMessage soapMessage)
Abstract template method. |
void |
setSecureResponse(boolean secureResponse)
Indicates whether outgoing responsed are to be secured. |
void |
setValidateRequest(boolean validateRequest)
Indicates whether incoming request are to be validated. |
boolean |
understands(SoapHeaderElement headerElement)
Given a SoapHeaderElement , return whether or not this SoapEndpointInterceptor understands it. |
protected abstract void |
validateMessage(SoapMessage soapMessage)
Abstract template method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log logger
Constructor Detail |
---|
public AbstractWsSecurityInterceptor()
Method Detail |
---|
public void setSecureResponse(boolean secureResponse)
true
.
public void setValidateRequest(boolean validateRequest)
true
.
public final boolean handleRequest(MessageContext messageContext, Object endpoint) throws Exception
EndpointInterceptor
EndpointMapping
determined an appropriate endpoint
object, but before EndpointAdapter
invokes the endpoint.
MessageDispatcher
processes an endpoint in an invocation chain, consisting of any number of interceptors,
with the endpoint itself at the end. With this method, each interceptor can decide to abort the chain, typically
creating a custom response.
handleRequest
in interface EndpointInterceptor
messageContext
- contains the incoming request messageendpoint
- chosen endpoint to invoke
true
to continue processing of the request interceptor chain; false
to indicate
blocking of the request endpoint chain, without invoking the endpoint
Exception
- in case of errorsMessageContext.getRequest()
public final boolean handleResponse(MessageContext messageContext, Object endpoint) throws Exception
EndpointInterceptor
EndpointAdapter
actually invoked the endpoint. Can
manipulate the response, if any, by adding new headers, etc.
MessageDispatcher
processes an endpoint in an invocation chain, consisting of any number of interceptors,
with the endpoint itself at the end. With this method, each interceptor can post-process an invocation, getting
applied in inverse order of the execution chain.
Note: Will only be called if this interceptor's EndpointInterceptor.handleRequest(org.springframework.ws.context.MessageContext, java.lang.Object)
method has successfully completed.
handleResponse
in interface EndpointInterceptor
messageContext
- contains both request and response messagesendpoint
- chosen endpoint to invoke
true
to continue processing of the reponse interceptor chain; false
to indicate
blocking of the response endpoint chain.
Exception
- in case of errorsMessageContext.getRequest()
,
MessageContext.hasResponse()
,
MessageContext.getResponse()
public boolean handleFault(MessageContext messageContext, Object endpoint) throws Exception
true
, i.e. faults are not secured.
handleFault
in interface EndpointInterceptor
messageContext
- contains both request and response messages, the response should contains a Faultendpoint
- chosen endpoint to invoke
true
to continue processing of the reponse interceptor chain; false
to indicate
blocking of the response handler chain.
Exception
public boolean understands(SoapHeaderElement headerElement)
SoapEndpointInterceptor
SoapHeaderElement
, return whether or not this SoapEndpointInterceptor
understands it.
understands
in interface SoapEndpointInterceptor
headerElement
- the header
true
if understood, false
otherwiseprotected boolean handleSecurementException(WsSecuritySecurementException ex, MessageContext messageContext)
false
.
ex
- the validation exceptionmessageContext
- the message context
true
to continue processing the message, false
(the default) otherwiseprotected boolean handleValidationException(WsSecurityValidationException ex, MessageContext messageContext)
false
.
ex
- the validation exceptionmessageContext
- the message context
true
to continue processing the message, false
(the default) otherwiseprotected boolean handleFaultException(WsSecurityFaultException ex, MessageContext messageContext)
false
.
ex
- the validation exceptionmessageContext
- the message context
true
to continue processing the message, false
(the default) otherwiseprotected abstract void validateMessage(SoapMessage soapMessage) throws WsSecurityValidationException
SoapMessage
, and replace the original request with the validated version.
soapMessage
- the soap message to validate
WsSecurityValidationException
- in case of validation errorsprotected abstract void secureMessage(SoapMessage soapMessage) throws WsSecuritySecurementException
SoapMessage
, and replace the original response with the secured version.
soapMessage
- the soap message to secure
WsSecuritySecurementException
- in case of securement errorsprotected abstract void cleanUp()
|
Spring Web Services Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |