001: /*
002: * The Apache Software License, Version 1.1
003: *
004: *
005: * Copyright (c) 2002 The Apache Software Foundation. All rights
006: * reserved.
007: *
008: * Redistribution and use in source and binary forms, with or without
009: * modification, are permitted provided that the following conditions
010: * are met:
011: *
012: * 1. Redistributions of source code must retain the above copyright
013: * notice, this list of conditions and the following disclaimer.
014: *
015: * 2. Redistributions in binary form must reproduce the above copyright
016: * notice, this list of conditions and the following disclaimer in
017: * the documentation and/or other materials provided with the
018: * distribution.
019: *
020: * 3. The end-user documentation included with the redistribution,
021: * if any, must include the following acknowledgment:
022: * "This product includes software developed by the
023: * Apache Software Foundation (http://www.apache.org/)."
024: * Alternately, this acknowledgment may appear in the software itself,
025: * if and wherever such third-party acknowledgments normally appear.
026: *
027: * 4. The names "WSIF" and "Apache Software Foundation" must
028: * not be used to endorse or promote products derived from this
029: * software without prior written permission. For written
030: * permission, please contact apache@apache.org.
031: *
032: * 5. Products derived from this software may not be called "Apache",
033: * nor may "Apache" appear in their name, without prior written
034: * permission of the Apache Software Foundation.
035: *
036: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
037: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
038: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
039: * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
040: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
041: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
042: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
043: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
044: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
045: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
046: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
047: * SUCH DAMAGE.
048: * ====================================================================
049: *
050: * This software consists of voluntary contributions made by many
051: * individuals on behalf of the Apache Software Foundation and was
052: * originally based on software copyright (c) 2001, 2002, International
053: * Business Machines, Inc., http://www.apache.org. For more
054: * information on the Apache Software Foundation, please see
055: * <http://www.apache.org/>.
056: */
057:
058: package org.apache.wsif;
059:
060: import java.io.Serializable;
061:
062: import javax.xml.namespace.QName;
063:
064: /**
065: * This class represents a service response coming out of WSIF. It
066: * contains the outgoing message or fault message, context information
067: * as well as other information.
068: *
069: * @author Sanjiva Weerawarana <sanjiva@watson.ibm.com>
070: * @author Paul Fremantle <pzf@uk.ibm.com>
071: */
072: public class WSIFResponse implements Serializable {
073:
074: private static final long serialVersionUID = 1L;
075:
076: QName serviceID;
077: String operationName;
078: boolean isFault = false;
079: WSIFMessage outgoingMessage;
080: WSIFMessage faultMessage;
081: WSIFMessage contextMessage;
082:
083: String portName;
084: String inputName;
085: String outputName;
086:
087: /**
088: * Constructor.
089: */
090: public WSIFResponse(QName serviceID) {
091: this .serviceID = serviceID;
092: }
093:
094: /**
095: * Get the service ID.
096: */
097: public QName getServiceID() {
098: return serviceID;
099: }
100:
101: /**
102: * Set the operation name.
103: */
104: public void setOperationName(String operationName) {
105: this .operationName = operationName;
106: }
107:
108: /**
109: * Get the operation name.
110: */
111: public String getOperationName() {
112: return operationName;
113: }
114:
115: /**
116: * Indicate whether this response contains a a fault message or an
117: * ok response message. Defaults to ok (i.e., the value of the flag
118: * is false).
119: */
120: public void setIsFault(boolean isFault) {
121: this .isFault = isFault;
122: }
123:
124: /**
125: * Get the value of the isFault flag. True if response contains a
126: * fault and false otherwise.
127: */
128: public boolean getIsFault() {
129: return isFault;
130: }
131:
132: /**
133: * Set the outgoing message. The outgoing message or the fault
134: * message must be set for any given response.
135: */
136: public void setOutgoingMessage(WSIFMessage outgoingMessage) {
137: this .outgoingMessage = outgoingMessage;
138: }
139:
140: /**
141: * Get the outgoing message.
142: */
143: public WSIFMessage getOutgoingMessage() {
144: return outgoingMessage;
145: }
146:
147: /**
148: * Set the fault message. The outgoing message or the fault
149: * message must be set for any given response.
150: */
151: public void setFaultMessage(WSIFMessage faultMessage) {
152: this .faultMessage = faultMessage;
153: }
154:
155: /**
156: * Get the fault message.
157: */
158: public WSIFMessage getFaultMessage() {
159: return faultMessage;
160: }
161:
162: /**
163: * Set the context message.
164: */
165: public void setContextMessage(WSIFMessage contextMessage) {
166: this .contextMessage = contextMessage;
167: }
168:
169: /**
170: * Get the context message.
171: */
172: public WSIFMessage getContextMessage() {
173: return contextMessage;
174: }
175:
176: /**
177: * Printable version.
178: */
179: public String toString() {
180: return "[WSIFResponse:\n" + "\t serviceID = '" + serviceID
181: + "'\n" + "\t operationName = '" + operationName
182: + "'\n" + "\t isFault = '" + isFault + "'\n"
183: + "\t outgoingMessage = '" + outgoingMessage + "'\n"
184: + "\t faultMessage = '" + faultMessage + "'\n"
185: + "\t contextMessage = '" + contextMessage + "']";
186: }
187:
188: /**
189: * Gets the portName
190: * @return Returns a String
191: */
192: public String getPortName() {
193: return portName;
194: }
195:
196: /**
197: * Sets the portName
198: * @param portName The portName to set
199: */
200: public void setPortName(String portName) {
201: this .portName = portName;
202: }
203:
204: /**
205: * Gets the inputName
206: * @return Returns a String
207: */
208: public String getInputName() {
209: return inputName;
210: }
211:
212: /**
213: * Sets the inputName
214: * @param inputName The inputName to set
215: */
216: public void setInputName(String inputName) {
217: this .inputName = inputName;
218: }
219:
220: /**
221: * Gets the outputName
222: * @return Returns a String
223: */
224: public String getOutputName() {
225: return outputName;
226: }
227:
228: /**
229: * Sets the outputName
230: * @param outputName The outputName to set
231: */
232: public void setOutputName(String outputName) {
233: this.outputName = outputName;
234: }
235:
236: }
|