KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > jbi > serviceengine > util > soap > Operation


1 // Copyright (c) 2004-2005 Sun Microsystems Inc., All Rights Reserved.
2

3 /*
4  * Operation.java
5  *
6  * SUN PROPRIETARY/CONFIDENTIAL.
7  * This software is the proprietary information of Sun Microsystems, Inc.
8  * Use is subject to license terms.
9  *
10  */

11 package com.sun.enterprise.jbi.serviceengine.util.soap;
12
13 /**
14  * This object represents the operation supported by a JBI service engine. This
15  * information is obtained when a service has been deployed on the SOAP Binding
16  * component.
17  *
18  * @author Sun Microsystems, Inc.
19  */

20 public class Operation
21 {
22     /**
23      * Operation name.
24      */

25     private String JavaDoc mOperationName;
26
27     /**
28      * Pattern used by the operation.
29      */

30     private String JavaDoc mPattern;
31
32     /**
33      * Operation's SOAP action URI.
34      */

35     private String JavaDoc mSoapAction;
36
37     /**
38      * Style used to physically represent the operation message style. This is either
39      * "rpc" style, "uri" style or "multipart" style. These styles are based on WSDL 2.0.
40      */

41     private String JavaDoc mOperationStyle;
42
43     /**
44      * Style used to physically represent the operation message style. This is either
45      * "rpc" style, "uri" style or "multipart" style. These styles are based on WSDL 2.0.
46      */

47     private String JavaDoc mInterfaceStyle;
48
49     /**
50      * Input operation namespace.
51      */

52     private String JavaDoc mInputNamespace;
53
54     /**
55      * Output operation namespace.
56      */

57     private String JavaDoc mOutputNamespace;
58
59     /**
60      * Creates a new instance of Operation.
61      *
62      * @param operationName operation name
63      * @param pattern message exchange pattern name.
64      */

65     public Operation(String JavaDoc operationName, String JavaDoc pattern)
66     {
67         mPattern = pattern;
68         mOperationName = operationName;
69         mOperationStyle = null;
70         mSoapAction = "\"\"";
71     }
72
73     /**
74      * Gets the operation name.
75      *
76      * @return the operation name.
77      */

78     public String JavaDoc getName()
79     {
80         return mOperationName;
81     }
82
83     /**
84      * Gets the message exchange pattern name.
85      *
86      * @return message exchange pattern name.
87      */

88     public String JavaDoc getPattern()
89     {
90         return mPattern;
91     }
92
93     /**
94      * Sets the soap Action URI.
95      *
96      * @param soapAction soapAction associated with this operation.
97      */

98     public void setSoapAction(String JavaDoc soapAction)
99     {
100         if ( ( soapAction != null) && ( !soapAction.equals("")) )
101         {
102             mSoapAction = soapAction;
103         }
104     }
105
106     /**
107      * Gets the soap Action URI.
108      *
109      * @return soap action associated with this operation.
110      */

111     public String JavaDoc getSoapAction()
112     {
113         return mSoapAction;
114     }
115
116     /**
117      * Sets the operation style.
118      *
119      * @param operationStyle operation style.
120      */

121     public void setStyle(String JavaDoc operationStyle)
122     {
123         mOperationStyle = operationStyle;
124     }
125
126     /**
127      * Gets the operation style.
128      *
129      * @return operation style.
130      */

131     public String JavaDoc getStyle()
132     {
133         if (mOperationStyle != null)
134         {
135             return mOperationStyle;
136         }
137         else
138         {
139             return mInterfaceStyle;
140         }
141     }
142
143     /**
144      * Indicates whether the operation input is encoded or not.
145      *
146      * @return false if it is not encoded;true otherwise.
147      */

148     public boolean isInputEncoded()
149     {
150         return false;
151     }
152
153     /**
154      * Sets the operation input namespace.
155      *
156      * @param namespace operation input namespace
157      */

158     public void setInputNamespace(String JavaDoc namespace)
159     {
160         mInputNamespace = namespace;
161     }
162
163     /**
164      * Gets the operation input namespace.
165      *
166      * @return operation input namespace;
167      */

168     public String JavaDoc getInputNamespace()
169     {
170         return mInputNamespace;
171     }
172
173     /**
174      * Indicates whether the operation output is encoded or not.
175      *
176      * @return false if it is not encoded;true otherwise.
177      */

178     public boolean isOutputEncoded()
179     {
180         return false;
181     }
182
183     /**
184      * Sets the operation output namespace.
185      *
186      * @param namespace operation output namespace
187      */

188     public void setOutputNamespace(String JavaDoc namespace)
189     {
190         mOutputNamespace = namespace;
191     }
192
193     /**
194      * Gets the operation output namespace.
195      *
196      * @return operation output namespace;
197      */

198     public String JavaDoc getOutputNamespace()
199     {
200         return mOutputNamespace;
201     }
202
203     /**
204      * Sets the interface style.
205      *
206      * @param style interface style
207      */

208     public void setInterfaceStyle(String JavaDoc style)
209     {
210         mInterfaceStyle = style;
211     }
212
213     /**
214      * Returns the operation as a string.
215      *
216      * @return operation represented as a string.
217      */

218     public String JavaDoc toString()
219     {
220         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
221         buffer.append("{ name = " + mOperationName);
222         buffer.append(", pattern = " + mPattern);
223         buffer.append(", style = " + getStyle());
224         buffer.append(", soap action = " + mSoapAction);
225         buffer.append(", input namespace = " + mInputNamespace);
226         buffer.append(", output namespace = " + mOutputNamespace);
227         buffer.append("}");
228         return buffer.toString();
229     }
230 }
231
Popular Tags