View Javadoc

1   /*
2    * Copyright 2007 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.springframework.ws.transport;
18  
19  import java.io.IOException;
20  
21  import org.springframework.ws.soap.SoapFault;
22  
23  /**
24   * Sub-interface of [email protected] WebServiceConnection} that is aware of any Fault messages received. Fault messages (such as
25   * [email protected] SoapFault} SOAP Faults) often require different processing rules. Typically, fault detection is done by
26   * inspecting connection error codes, etc.
27   *
28   * @author Arjen Poutsma
29   * @since 1.0.0
30   */
31  public interface FaultAwareWebServiceConnection extends WebServiceConnection {
32  
33      /**
34       * Indicates whether this connection received a fault.
35       * <p/>
36       * Typically implemented by looking at an HTTP status code.
37       *
38       * @return <code>true</code> if this connection received a fault; <code>false</code> otherwise.
39       * @throws IOException in case of I/O errors
40       */
41      boolean hasFault() throws IOException;
42  
43      /**
44       * Sets whether this connection will send a fault.
45       * <p/>
46       * Typically implemented by setting an HTTP status code.
47       *
48       * @param fault <code>true</code> if this will send a fault; <code>false</code> otherwise.
49       * @throws IOException in case of I/O errors
50       */
51      void setFault(boolean fault) throws IOException;
52  }