View Javadoc

1   /*
2    * Copyright 2005-2010 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.soap.saaj;
18  
19  import java.util.Iterator;
20  import java.util.Locale;
21  import javax.xml.namespace.QName;
22  import javax.xml.soap.SOAPException;
23  import javax.xml.soap.SOAPFault;
24  
25  import org.springframework.ws.soap.soap12.Soap12Fault;
26  
27  /**
28   * @author Arjen Poutsma
29   * @since 1.0.0
30   */
31  class SaajSoap12Fault extends SaajSoapFault implements Soap12Fault {
32  
33      public SaajSoap12Fault(SOAPFault fault) {
34          super(fault);
35      }
36  
37      public String getFaultActorOrRole() {
38          return getImplementation().getFaultRole(getSaajFault());
39      }
40  
41      public void setFaultActorOrRole(String faultRole) {
42          try {
43              getImplementation().setFaultRole(getSaajFault(), faultRole);
44          }
45          catch (SOAPException ex) {
46              throw new SaajSoapFaultException(ex);
47          }
48      }
49  
50      public Iterator<QName> getFaultSubcodes() {
51          return getImplementation().getFaultSubcodes(getSaajFault());
52      }
53  
54      public void addFaultSubcode(QName subcode) {
55          try {
56              getImplementation().appendFaultSubcode(getSaajFault(), subcode);
57          }
58          catch (SOAPException ex) {
59              throw new SaajSoapFaultException(ex);
60          }
61      }
62  
63      public String getFaultNode() {
64          return getImplementation().getFaultNode(getSaajFault());
65      }
66  
67      public void setFaultNode(String uri) {
68          try {
69              getImplementation().setFaultNode(getSaajFault(), uri);
70          }
71          catch (SOAPException ex) {
72              throw new SaajSoapFaultException(ex);
73          }
74  
75      }
76  
77      public void setFaultReasonText(Locale locale, String text) {
78          try {
79              getImplementation().setFaultReasonText(getSaajFault(), locale, text);
80          }
81          catch (SOAPException ex) {
82              throw new SaajSoapFaultException(ex);
83          }
84  
85      }
86  
87      public String getFaultReasonText(Locale locale) {
88          try {
89              return getImplementation().getFaultReasonText(getSaajFault(), locale);
90          }
91          catch (SOAPException ex) {
92              throw new SaajSoapFaultException(ex);
93          }
94      }
95  
96      public String getFaultStringOrReason() {
97          return getImplementation().getFaultString(getSaajFault());
98      }
99  }