|
||||||||||
| 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. Can be used on the server side, registered in a
endpoint mapping; or on the client side, on the web service template.
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses. |
protected static javax.xml.namespace.QName |
WS_SECURITY_NAME
|
| Constructor Summary | |
|---|---|
AbstractWsSecurityInterceptor()
|
|
| Method Summary | |
|---|---|
protected abstract void |
cleanUp()
|
boolean |
handleFault(org.springframework.ws.context.MessageContext messageContext)
Returns true, i.e. |
boolean |
handleFault(org.springframework.ws.context.MessageContext messageContext,
Object endpoint)
Returns true, i.e. |
protected boolean |
handleFaultException(WsSecurityFaultException ex,
org.springframework.ws.context.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(org.springframework.ws.context.MessageContext messageContext)
Secures a client-side outgoing request. |
boolean |
handleRequest(org.springframework.ws.context.MessageContext messageContext,
Object endpoint)
Validates a server-side incoming request. |
boolean |
handleResponse(org.springframework.ws.context.MessageContext messageContext)
Validates a client-side incoming response. |
boolean |
handleResponse(org.springframework.ws.context.MessageContext messageContext,
Object endpoint)
Secures a server-side outgoing response. |
protected boolean |
handleSecurementException(WsSecuritySecurementException ex,
org.springframework.ws.context.MessageContext messageContext)
Handles an securement exception. |
protected boolean |
handleValidationException(WsSecurityValidationException ex,
org.springframework.ws.context.MessageContext messageContext)
Handles an invalid SOAP message. |
protected abstract void |
secureMessage(org.springframework.ws.soap.SoapMessage soapMessage,
org.springframework.ws.context.MessageContext messageContext)
Abstract template method. |
void |
setExceptionResolver(org.springframework.ws.server.EndpointExceptionResolver exceptionResolver)
Provide an EndpointExceptionResolver for resolving validation exceptions. |
void |
setSecureRequest(boolean secureRequest)
Indicates whether client-side outgoing requests are to be secured. |
void |
setSecureResponse(boolean secureResponse)
Indicates whether server-side outgoing responses are to be secured. |
void |
setValidateRequest(boolean validateRequest)
Indicates whether server-side incoming request are to be validated. |
void |
setValidateResponse(boolean validateResponse)
Indicates whether client-side incoming responses are to be validated. |
boolean |
understands(org.springframework.ws.soap.SoapHeaderElement headerElement)
|
protected abstract void |
validateMessage(org.springframework.ws.soap.SoapMessage soapMessage,
org.springframework.ws.context.MessageContext messageContext)
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 org.apache.commons.logging.Log logger
protected static final javax.xml.namespace.QName WS_SECURITY_NAME
| Constructor Detail |
|---|
public AbstractWsSecurityInterceptor()
| Method Detail |
|---|
public void setValidateRequest(boolean validateRequest)
true.
public void setSecureResponse(boolean secureResponse)
true.
public void setSecureRequest(boolean secureRequest)
true.
public void setValidateResponse(boolean validateResponse)
true.
public void setExceptionResolver(org.springframework.ws.server.EndpointExceptionResolver exceptionResolver)
EndpointExceptionResolver for resolving validation exceptions.
public final boolean handleRequest(org.springframework.ws.context.MessageContext messageContext,
Object endpoint)
throws Exception
validateMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext)
if the validateRequest property is true.
handleRequest in interface org.springframework.ws.server.EndpointInterceptormessageContext - the message context, containing the request to be validatedendpoint - chosen endpoint to invoke
true if the request was valid; false otherwise.
Exception - in case of errorsvalidateMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext)
public final boolean handleResponse(org.springframework.ws.context.MessageContext messageContext,
Object endpoint)
throws Exception
secureMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext)
if the secureResponse property is true.
handleResponse in interface org.springframework.ws.server.EndpointInterceptormessageContext - the message context, containing the response to be securedendpoint - chosen endpoint to invoke
true if the response was secured; false otherwise.
Exception - in case of errorssecureMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext)
public boolean handleFault(org.springframework.ws.context.MessageContext messageContext,
Object endpoint)
throws Exception
true, i.e. fault responses are not secured.
handleFault in interface org.springframework.ws.server.EndpointInterceptorExceptionpublic boolean understands(org.springframework.ws.soap.SoapHeaderElement headerElement)
understands in interface org.springframework.ws.soap.server.SoapEndpointInterceptor
public final boolean handleRequest(org.springframework.ws.context.MessageContext messageContext)
throws org.springframework.ws.client.WebServiceClientException
secureMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext)
if the secureRequest property is true.
handleRequest in interface org.springframework.ws.client.support.interceptor.ClientInterceptormessageContext - the message context, containing the request to be secured
true if the response was secured; false otherwise.
Exception - in case of errors
org.springframework.ws.client.WebServiceClientExceptionsecureMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext)
public final boolean handleResponse(org.springframework.ws.context.MessageContext messageContext)
throws org.springframework.ws.client.WebServiceClientException
validateMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext)
if the validateResponse property is true.
handleResponse in interface org.springframework.ws.client.support.interceptor.ClientInterceptormessageContext - the message context, containing the response to be validated
true if the request was valid; false otherwise.
Exception - in case of errors
org.springframework.ws.client.WebServiceClientExceptionvalidateMessage(org.springframework.ws.soap.SoapMessage,org.springframework.ws.context.MessageContext)
public boolean handleFault(org.springframework.ws.context.MessageContext messageContext)
throws org.springframework.ws.client.WebServiceClientException
true, i.e. fault responses are not validated.
handleFault in interface org.springframework.ws.client.support.interceptor.ClientInterceptororg.springframework.ws.client.WebServiceClientException
protected boolean handleSecurementException(WsSecuritySecurementException ex,
org.springframework.ws.context.MessageContext messageContext)
false.
ex - the validation exceptionmessageContext - the message context
true to continue processing the message, false (the default) otherwise
protected boolean handleValidationException(WsSecurityValidationException ex,
org.springframework.ws.context.MessageContext messageContext)
exceptionResolver if any, or creates a SOAP 1.1 Client or SOAP
1.2 Sender Fault with the exception message as fault string, and returns false.
ex - the validation exceptionmessageContext - the message context
true to continue processing the message, false (the default) otherwise
protected boolean handleFaultException(WsSecurityFaultException ex,
org.springframework.ws.context.MessageContext messageContext)
false.
ex - the validation exceptionmessageContext - the message context
true to continue processing the message, false (the default) otherwise
protected abstract void validateMessage(org.springframework.ws.soap.SoapMessage soapMessage,
org.springframework.ws.context.MessageContext messageContext)
throws WsSecurityValidationException
SoapMessage, and replace the original request with the validated version.
soapMessage - the soap message to validate
WsSecurityValidationException - in case of validation errors
protected abstract void secureMessage(org.springframework.ws.soap.SoapMessage soapMessage,
org.springframework.ws.context.MessageContext messageContext)
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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||