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.util;
17
18 import javax.xml.namespace.QName;
19
20 import org.apache.axis.message.addressing.AddressingVersion;
21
22 /**
23 * Immutable implementation of the AddressingVersion interface.
24 *
25 * @author Rodrigo Ruiz
26 * @version $Revision: 14 $
27 */
28 class WsaVersion implements AddressingVersion {
29 /**
30 * Namespace.
31 */
32 private final String ns;
33
34 /**
35 * Anonymous URI.
36 */
37 private final String anonURI;
38
39 /**
40 * Reply/response QName.
41 */
42 private final QName response;
43
44 /**
45 * Is W3C compliant?
46 */
47 private final boolean w3c;
48
49 /**
50 * Supports reference parameters?
51 */
52 private final boolean params;
53
54 /**
55 * Supports reference properties?
56 */
57 private final boolean props;
58
59 /**
60 * Supports meta-data?
61 */
62 private final boolean mdata;
63
64 /**
65 * Creates an instance.
66 *
67 * @param ns Namespace
68 * @param anonURI Anonymous URI
69 * @param response Response/reply QName
70 * @param w3c Is W3C compliant?
71 * @param params Supports reference parameters?
72 * @param props Supports reference properties?
73 * @param mdata Supports meta-data?
74 */
75 public WsaVersion(String ns, String anonURI, QName response, boolean w3c,
76 boolean params, boolean props, boolean mdata) {
77 this.ns = ns;
78 this.anonURI = anonURI;
79 this.response = response;
80
81 this.w3c = w3c;
82 this.params = params;
83 this.props = props;
84 this.mdata = mdata;
85 }
86
87 /**
88 * {@inheritDoc}
89 */
90 public String getAnonymousRoleURI() {
91 return anonURI;
92 }
93
94 /**
95 * {@inheritDoc}
96 */
97 public String getFaultActionURI() {
98 return ns + "/fault";
99 }
100
101 /**
102 * {@inheritDoc}
103 */
104 public String getNamespace() {
105 return ns;
106 }
107
108 /**
109 * {@inheritDoc}
110 */
111 public QName getResponseRelationshipType() {
112 return response;
113 }
114
115 /**
116 * {@inheritDoc}
117 */
118 public boolean isW3C() {
119 return w3c;
120 }
121
122 /**
123 * {@inheritDoc}
124 */
125 public boolean supportsMetadata() {
126 return mdata;
127 }
128
129 /**
130 * {@inheritDoc}
131 */
132 public boolean supportsParameters() {
133 return params;
134 }
135
136 /**
137 * {@inheritDoc}
138 */
139 public boolean supportsProperties() {
140 return props;
141 }
142 }