comparison WebServiceToolWorkflow/lib/SAWADLParser/src/edu/uga/cs/lsdis/meteors/wadls/MethodImpl.java @ 0:d5cd409b8a18 default tip

Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
author ganjoo
date Tue, 07 Jun 2011 18:00:50 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d5cd409b8a18
1 /*
2 * (c) Copyright IBM Corp 2001, 2005
3 */
4
5 package edu.uga.cs.lsdis.meteors.wadls;
6
7 import java.util.ArrayList;
8 import java.util.HashMap;
9 import java.util.Iterator;
10 import java.util.List;
11 import java.util.Map;
12 import java.util.Vector;
13 import javax.wadls.Effect;
14 import javax.wadls.Request;
15 import javax.wadls.ModelReference;
16 import javax.wadls.Method;
17 import javax.wadls.Response;
18 import javax.wadls.PreCondition;
19 import org.w3c.dom.Element;
20
21 /**
22 * This class represents a WSDL operation.
23 * It includes information on input, output and fault
24 * messages associated with usage of the operation.
25 *
26 * @author Zixin Wu (wuzixin@uga.edu)
27 * @author Paul Fremantle (pzf@us.ibm.com)
28 * @author Nirmal Mukhi (nmukhi@us.ibm.com)
29 * @author Matthew J. Duftler (duftler@us.ibm.com)
30 */
31 public class MethodImpl implements Method
32 {
33 protected String name = null;
34 protected Request request = null;
35 protected Response response = null;
36 protected List<ModelReference> modelRefs = null;
37 protected PreCondition preCondition = null;
38 protected Effect effect = null;
39 protected List parameterOrder = null;
40 protected Element docEl = null;
41 protected List extElements = new Vector();
42 protected boolean isUndefined = true;
43
44 public static final long serialVersionUID = 1;
45
46
47 public void addModelReference (ModelReference modelReference){
48 if (this.modelRefs == null)
49 modelRefs= new ArrayList<ModelReference> ();
50 modelRefs.add(modelReference);
51 }
52
53
54 /**
55 * Get the modelReference of this operation.
56 *
57 * @return the modelReference value
58 */
59
60 public ModelReference getModelReference(){
61 if(modelRefs == null)
62 return null;
63 return modelRefs.get(0);
64 }
65
66 /**
67 * Set the precondition of this operation.
68 *
69 * @param preCondition the desired precondition
70 */
71 public void setPreCondition(PreCondition preCondition){
72 this.preCondition = preCondition;
73 }
74
75 /**
76 * Get the precondition of this operation.
77 *
78 * @return the precondition
79 */
80 public PreCondition getPreCondition(){
81 return this.preCondition;
82 }
83
84 /**
85 * Set the effect of this operation.
86 *
87 * @param effect the desired effect
88 */
89 public void setEffect(Effect effect){
90 this.effect = effect;
91 }
92
93 /**
94 * Get the effect of this operation.
95 *
96 * @return The effect
97 */
98 public Effect getEffect(){
99 return this.effect;
100 }
101
102 /**
103 * Set the name of this operation.
104 *
105 * @param name the desired name
106 */
107 public void setName(String name)
108 {
109 this.name = name;
110 }
111
112 /**
113 * Get the name of this operation.
114 *
115 * @return the operation name
116 */
117 public String getName()
118 {
119 return name;
120 }
121
122 /**
123 * Set the input message specification for this operation.
124 *
125 * @param input the new input message
126 */
127 public void setRequest(Request request)
128 {
129 this.request = request;
130 }
131
132 /**
133 * Get the input message specification for this operation.
134 *
135 * @return the input message
136 */
137 public Request getRequest()
138 {
139 return request;
140 }
141
142 /**
143 * Set the output message specification for this operation.
144 *
145 * @param output the new output message
146 */
147 public void setResponse(Response response)
148 {
149 this.response = response;
150 }
151
152 /**
153 * Get the output message specification for this operation.
154 *
155 * @return the output message specification for the operation
156 */
157 public Response getResponse()
158 {
159 return response;
160 }
161
162
163
164 /**
165 * Set the parameter ordering for a request-response,
166 * or solicit-response operation.
167 *
168 * @param parameterOrder a list of named parameters
169 * containing the part names to reflect the desired
170 * order of parameters for RPC-style operations
171 */
172 public void setParameterOrdering(List parameterOrder)
173 {
174 this.parameterOrder = parameterOrder;
175 }
176
177 /**
178 * Get the parameter ordering for this operation.
179 *
180 * @return the parameter ordering, a list consisting
181 * of message part names
182 */
183 public List getParameterOrdering()
184 {
185 return parameterOrder;
186 }
187
188 /**
189 * Set the documentation element for this document. This dependency
190 * on org.w3c.dom.Element should eventually be removed when a more
191 * appropriate way of representing this information is employed.
192 *
193 * @param docEl the documentation element
194 */
195 public void setDocumentationElement(Element docEl)
196 {
197 this.docEl = docEl;
198 }
199
200 /**
201 * Get the documentation element. This dependency on org.w3c.dom.Element
202 * should eventually be removed when a more appropriate way of
203 * representing this information is employed.
204 *
205 * @return the documentation element
206 */
207 public Element getDocumentationElement()
208 {
209 return docEl;
210 }
211
212 public void setUndefined(boolean isUndefined)
213 {
214 this.isUndefined = isUndefined;
215 }
216
217 public boolean isUndefined()
218 {
219 return isUndefined;
220 }
221
222 public String toString()
223 {
224 StringBuffer strBuf = new StringBuffer();
225
226 strBuf.append("Operation: name=" + name);
227
228 if (parameterOrder != null)
229 {
230 strBuf.append("\nparameterOrder=" + parameterOrder);
231 }
232
233
234 if (request != null)
235 {
236 strBuf.append("\n" + request);
237 }
238
239 if (response != null)
240 {
241 strBuf.append("\n" + response);
242 }
243
244 if (modelRefs != null)
245 for(ModelReference ref : modelRefs) {
246 strBuf.append('\n');
247 strBuf.append(ref);
248 }
249 /* if (modelRef != null)
250 {
251 strBuf.append("\n" + modelRef);
252 }*/
253
254 if (preCondition != null)
255 {
256 strBuf.append("\n" + preCondition);
257 }
258
259 if (effect != null)
260 {
261 strBuf.append("\n" + effect);
262 }
263
264 return strBuf.toString();
265 }
266
267 public List<ModelReference> getModelReferences() {
268 return modelRefs;
269 }
270
271 public void setModelReferences(List<ModelReference> refs) {
272 modelRefs = refs;
273 }
274 }