001: /*
002: * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025: package com.sun.xml.internal.ws.model.soap;
026:
027: import com.sun.xml.internal.ws.encoding.soap.SOAPVersion;
028:
029: /**
030: * Binding object that represents soap:binding
031: *
032: * @author Vivek Pandey
033: */
034: public class SOAPBinding {
035: public SOAPBinding() {
036: }
037:
038: public SOAPBinding(SOAPBinding sb) {
039: this .use = sb.use;
040: this .style = sb.style;
041: this .soapVersion = sb.soapVersion;
042: this .soapAction = sb.soapAction;
043: }
044:
045: /**
046: * @return Returns the use.
047: */
048: public Use getUse() {
049: return use;
050: }
051:
052: /**
053: * @param use
054: * The use to set.
055: */
056: public void setUse(Use use) {
057: this .use = use;
058: }
059:
060: /**
061: * @return Returns the style.
062: */
063: public Style getStyle() {
064: return style;
065: }
066:
067: /**
068: * @param style
069: * The style to set.
070: */
071: public void setStyle(Style style) {
072: this .style = style;
073: }
074:
075: /**
076: * @param version
077: */
078: public void setSOAPVersion(SOAPVersion version) {
079: this .soapVersion = version;
080: }
081:
082: /**
083: * @return the SOAPVersion of this SOAPBinding
084: */
085: public SOAPVersion getSOAPVersion() {
086: return soapVersion;
087: }
088:
089: /**
090: * @return true if this is a document/literal SOAPBinding
091: */
092: public boolean isDocLit() {
093: return style.equals(Style.DOCUMENT) && use.equals(Use.LITERAL);
094: }
095:
096: /**
097: * @return true if this is a rpc/literal SOAPBinding
098: */
099: public boolean isRpcLit() {
100: return style.equals(Style.RPC) && use.equals(Use.LITERAL);
101: }
102:
103: /**
104: * @return the soapAction header value. It's always non-null. soap
105: * message serializer needs to generated SOAPAction HTTP header with
106: * the return of this method enclosed in quotes("").
107: */
108: public String getSOAPAction() {
109: if (soapAction == null)
110: return "";
111: return soapAction;
112: }
113:
114: /**
115: * @param soapAction
116: * The soapAction to set.
117: */
118: public void setSOAPAction(String soapAction) {
119: this .soapAction = soapAction;
120: }
121:
122: private Style style = Style.DOCUMENT;
123:
124: private Use use = Use.LITERAL;
125:
126: private SOAPVersion soapVersion = SOAPVersion.SOAP_11;
127:
128: private String soapAction;
129:
130: }
|