001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)Operation.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package com.sun.jbi.common.soap;
030:
031: /**
032: * This object represents the operation supported by a JBI service engine. This
033: * information is obtained when a service has been deployed on the SOAP Binding
034: * component.
035: *
036: * @author Sun Microsystems, Inc.
037: */
038: public class Operation {
039: /**
040: * Operation name.
041: */
042: private String mOperationName;
043:
044: /**
045: * Pattern used by the operation.
046: */
047: private String mPattern;
048:
049: /**
050: * Operation's SOAP action URI.
051: */
052: private String mSoapAction;
053:
054: /**
055: * Style used to physically represent the operation message style. This is either
056: * "rpc" style, "uri" style or "multipart" style. These styles are based on WSDL 2.0.
057: */
058: private String mOperationStyle;
059:
060: /**
061: * Style used to physically represent the operation message style. This is either
062: * "rpc" style, "uri" style or "multipart" style. These styles are based on WSDL 2.0.
063: */
064: private String mInterfaceStyle;
065:
066: /**
067: * Input operation namespace.
068: */
069: private String mInputNamespace;
070:
071: /**
072: * Output operation namespace.
073: */
074: private String mOutputNamespace;
075:
076: /**
077: * Creates a new instance of Operation.
078: *
079: * @param operationName operation name
080: * @param pattern message exchange pattern name.
081: */
082: public Operation(String operationName, String pattern) {
083: mPattern = pattern;
084: mOperationName = operationName;
085: mOperationStyle = null;
086: mSoapAction = "\"\"";
087: }
088:
089: /**
090: * Gets the operation name.
091: *
092: * @return the operation name.
093: */
094: public String getName() {
095: return mOperationName;
096: }
097:
098: /**
099: * Gets the message exchange pattern name.
100: *
101: * @return message exchange pattern name.
102: */
103: public String getPattern() {
104: return mPattern;
105: }
106:
107: /**
108: * Sets the soap Action URI.
109: *
110: * @param soapAction soapAction associated with this operation.
111: */
112: public void setSoapAction(String soapAction) {
113: if ((soapAction != null) && (!soapAction.equals(""))) {
114: mSoapAction = soapAction;
115: }
116: }
117:
118: /**
119: * Gets the soap Action URI.
120: *
121: * @return soap action associated with this operation.
122: */
123: public String getSoapAction() {
124: return mSoapAction;
125: }
126:
127: /**
128: * Sets the operation style.
129: *
130: * @param operationStyle operation style.
131: */
132: public void setStyle(String operationStyle) {
133: mOperationStyle = operationStyle;
134: }
135:
136: /**
137: * Gets the operation style.
138: *
139: * @return operation style.
140: */
141: public String getStyle() {
142: if (mOperationStyle != null) {
143: return mOperationStyle;
144: } else {
145: return mInterfaceStyle;
146: }
147: }
148:
149: /**
150: * Indicates whether the operation input is encoded or not.
151: *
152: * @return false if it is not encoded;true otherwise.
153: */
154: public boolean isInputEncoded() {
155: return false;
156: }
157:
158: /**
159: * Sets the operation input namespace.
160: *
161: * @param namespace operation input namespace
162: */
163: public void setInputNamespace(String namespace) {
164: mInputNamespace = namespace;
165: }
166:
167: /**
168: * Gets the operation input namespace.
169: *
170: * @return operation input namespace;
171: */
172: public String getInputNamespace() {
173: return mInputNamespace;
174: }
175:
176: /**
177: * Indicates whether the operation output is encoded or not.
178: *
179: * @return false if it is not encoded;true otherwise.
180: */
181: public boolean isOutputEncoded() {
182: return false;
183: }
184:
185: /**
186: * Sets the operation output namespace.
187: *
188: * @param namespace operation output namespace
189: */
190: public void setOutputNamespace(String namespace) {
191: mOutputNamespace = namespace;
192: }
193:
194: /**
195: * Gets the operation output namespace.
196: *
197: * @return operation output namespace;
198: */
199: public String getOutputNamespace() {
200: return mOutputNamespace;
201: }
202:
203: /**
204: * Sets the interface style.
205: *
206: * @param style interface style
207: */
208: public void setInterfaceStyle(String style) {
209: mInterfaceStyle = style;
210: }
211:
212: /**
213: * Returns the operation as a string.
214: *
215: * @return operation represented as a string.
216: */
217: public String toString() {
218: StringBuffer buffer = new StringBuffer();
219: buffer.append("{ name = " + mOperationName);
220: buffer.append(", pattern = " + mPattern);
221: buffer.append(", style = " + getStyle());
222: buffer.append(", soap action = " + mSoapAction);
223: buffer.append(", input namespace = " + mInputNamespace);
224: buffer.append(", output namespace = " + mOutputNamespace);
225: buffer.append("}");
226: return buffer.toString();
227: }
228: }
|