|
17 | 17 | package org.springframework.ws.client.support.interceptor; |
18 | 18 |
|
19 | 19 | import org.springframework.ws.client.WebServiceClientException; |
20 | | -import org.springframework.ws.client.core.WebServiceMessageCallback; |
21 | | -import org.springframework.ws.client.core.WebServiceTemplate; |
22 | 20 | import org.springframework.ws.context.MessageContext; |
23 | 21 | import org.springframework.ws.soap.SoapHeader; |
24 | 22 | import org.springframework.ws.transport.WebServiceConnection; |
25 | 23 |
|
26 | 24 | /** |
27 | 25 | * Workflow interface that allows for customized client-side message interception. Applications can register any number |
28 | | - * of existing or custom interceptors on a {@link WebServiceTemplate}, to add common pre- and postprocessing behavior |
29 | | - * without needing to modify payload handling code. |
| 26 | + * of existing or custom interceptors on a {@link org.springframework.ws.client.core.WebServiceTemplate}, to add common |
| 27 | + * pre- and postprocessing behavior without needing to modify payload handling code. |
30 | 28 | * <p/> |
31 | 29 | * A <code>ClientInterceptor</code> gets called after payload creation (using {@link |
32 | | - * WebServiceTemplate#marshalSendAndReceive(Object)} or similar methods, and after {@link WebServiceMessageCallback |
33 | | - * callback} invocation, but before the message is sent over the {@link WebServiceConnection}. This mechanism can be |
34 | | - * used for a large field of preprocessing aspects, e.g. for authorization checks, or message header checks. Its main |
35 | | - * purpose is to allow for factoring out meta-data (i.e. {@link SoapHeader}) related code. |
| 30 | + * org.springframework.ws.client.core.WebServiceTemplate#marshalSendAndReceive(Object)} or similar methods, and after |
| 31 | + * {@link org.springframework.ws.client.core.WebServiceMessageCallback callback} invocation, but before the message is |
| 32 | + * sent over the {@link WebServiceConnection}. This mechanism can be used for a large field of preprocessing aspects, |
| 33 | + * e.g. for authorization checks, or message header checks. Its main purpose is to allow for factoring out meta-data |
| 34 | + * (i.e. {@link SoapHeader}) related code. |
36 | 35 | * <p/> |
37 | | - * Client interceptors are defined on a {@link WebServiceTemplate}, using the {@link |
38 | | - * WebServiceTemplate#setInterceptors(ClientInterceptor[]) interceptors} property. |
| 36 | + * Client interceptors are defined on a {@link org.springframework.ws.client.core.WebServiceTemplate}, using the {@link |
| 37 | + * org.springframework.ws.client.core.WebServiceTemplate#setInterceptors(ClientInterceptor[]) interceptors} property. |
39 | 38 | * |
40 | 39 | * @author Giovanni Cuccu |
41 | 40 | * @author Arjen Poutsma |
42 | | - * @see WebServiceTemplate#setInterceptors(ClientInterceptor[]) |
| 41 | + * @see org.springframework.ws.client.core.WebServiceTemplate#setInterceptors(ClientInterceptor[]) |
43 | 42 | * @since 1.5.0 |
44 | 43 | */ |
45 | 44 | public interface ClientInterceptor { |
46 | 45 |
|
| 46 | + /** |
| 47 | + * Processes the outgoing request message. Called after payload creation and callback invocation, but before the |
| 48 | + * message is sent. |
| 49 | + * |
| 50 | + * @param messageContext contains the outgoing request message |
| 51 | + * @return <code>true</code> to continue processing of the request interceptors; <code>false</code> to indicate |
| 52 | + * blocking of the request endpoint chain |
| 53 | + * @throws WebServiceClientException in case of errors |
| 54 | + * @see MessageContext#getRequest() |
| 55 | + */ |
47 | 56 | boolean handleRequest(MessageContext messageContext) throws WebServiceClientException; |
48 | 57 |
|
| 58 | + /** |
| 59 | + * Processes the incoming response message. Called for non-fault response messages before payload handling in the |
| 60 | + * {@link org.springframework.ws.client.core.WebServiceTemplate}. |
| 61 | + * |
| 62 | + * @param messageContext contains the outgoing request message |
| 63 | + * @return <code>true</code> to continue processing of the request interceptors; <code>false</code> to indicate |
| 64 | + * blocking of the response endpoint chain |
| 65 | + * @throws WebServiceClientException in case of errors |
| 66 | + * @see MessageContext#getResponse() |
| 67 | + */ |
49 | 68 | boolean handleResponse(MessageContext messageContext) throws WebServiceClientException; |
50 | 69 |
|
| 70 | + /** |
| 71 | + * Processes the incoming response fault. Called for response fault messages before payload handling in the {@link |
| 72 | + * org.springframework.ws.client.core.WebServiceTemplate}. |
| 73 | + * |
| 74 | + * @param messageContext contains the outgoing request message |
| 75 | + * @return <code>true</code> to continue processing of the request interceptors; <code>false</code> to indicate |
| 76 | + * blocking of the request endpoint chain |
| 77 | + * @throws WebServiceClientException in case of errors |
| 78 | + * @see MessageContext#getResponse() |
| 79 | + * @see org.springframework.ws.FaultAwareWebServiceMessage#hasFault() |
| 80 | + */ |
51 | 81 | boolean handleFault(MessageContext messageContext) throws WebServiceClientException; |
52 | 82 |
|
53 | 83 | } |
0 commit comments