1 /*
2 * Copyright (c) 2008 Rodrigo Ruiz
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 package org.apache.axis.message.addressing;
17
18 import javax.xml.soap.SOAPEnvelope;
19 import javax.xml.soap.SOAPException;
20 import javax.xml.soap.SOAPHeaderElement;
21
22 import org.apache.axis.types.URI;
23 import org.apache.axis.types.URI.MalformedURIException;
24 import org.w3c.dom.Document;
25 import org.w3c.dom.Element;
26
27 /**
28 * Java content class for FaultTo element declaration.
29 * <p>
30 * The following schema fragment specifies the expected content contained within
31 * this java content object. (defined at
32 * http://schemas.xmlsoap.org/ws/2004/08/addressing line 82)
33 *
34 * <pre>
35 * <element
36 * xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
37 * name="FaultTo"
38 * type="wsa:EndpointReferenceType"/>
39 * </pre>
40 *
41 * @author Davanum Srinivas
42 * @version $Revision: 14 $
43 */
44 public class FaultTo extends EndpointReference {
45 /**
46 * <code>serialVersionUID</code> attribute.
47 */
48 private static final long serialVersionUID = -1029754784219086363L;
49
50 /**
51 * Constructor FaultTo.
52 *
53 * @param address Target address
54 */
55 public FaultTo(Address address) {
56 super(address);
57 }
58
59 /**
60 * Constructor FaultTo.
61 *
62 * @param endpoint Target end-point
63 */
64 public FaultTo(EndpointReferenceType endpoint) {
65 super(endpoint);
66 }
67
68 /**
69 * Constructor FaultTo.
70 *
71 * @param element Header element to copy from
72 * @throws MalformedURIException If an error occurs
73 */
74 public FaultTo(SOAPHeaderElement element) throws MalformedURIException {
75 super(element);
76 }
77
78 /**
79 * Constructor FaultTo.
80 *
81 * @param uri Target URI
82 */
83 public FaultTo(URI uri) {
84 super(uri);
85 }
86
87 /**
88 * {@inheritDoc}
89 */
90 @Override
91 public Element toDOM(Document doc) {
92 return this.toDOM(doc, Constants.FAULT_TO);
93 }
94
95 /**
96 * {@inheritDoc}
97 */
98 public SOAPHeaderElement toSOAPHeaderElement(AddressingVersion version,
99 SOAPEnvelope env, String actorURI) throws SOAPException {
100 return this.toSOAPHeaderElement(version, env, actorURI, Constants.FAULT_TO);
101 }
102 }