src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java

changeset 1
0961a4a21176
child 45
31822b475baa
equal deleted inserted replaced
-1:000000000000 1:0961a4a21176
1 /*
2 * $Id: Message1_1Impl.java,v 1.24 2006/01/27 12:49:41 vj135062 Exp $
3 */
4
5 /*
6 * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 *
9 * This code is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 only, as
11 * published by the Free Software Foundation. Sun designates this
12 * particular file as subject to the "Classpath" exception as provided
13 * by Sun in the LICENSE file that accompanied this code.
14 *
15 * This code is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * version 2 for more details (a copy is included in the LICENSE file that
19 * accompanied this code).
20 *
21 * You should have received a copy of the GNU General Public License version
22 * 2 along with this work; if not, write to the Free Software Foundation,
23 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24 *
25 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
26 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * have any questions.
28 */
29
30 /**
31 *
32 * @author SAAJ RI Development Team
33 */
34 package com.sun.xml.internal.messaging.saaj.soap.ver1_1;
35
36 import java.io.IOException;
37 import java.io.InputStream;
38 import java.util.logging.Level;
39 import java.util.logging.Logger;
40
41 import javax.xml.soap.*;
42
43 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
44 import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
45 import com.sun.xml.internal.messaging.saaj.soap.MessageImpl;
46 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
47
48 public class Message1_1Impl extends MessageImpl implements SOAPConstants {
49
50 protected static Logger log =
51 Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN,
52 "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");
53
54 public Message1_1Impl() {
55 super();
56 }
57
58 public Message1_1Impl(boolean isFastInfoset, boolean acceptFastInfoset) {
59 super(isFastInfoset, acceptFastInfoset);
60 }
61
62 public Message1_1Impl(SOAPMessage msg) {
63 super(msg);
64 }
65
66 // unused. can we delete this? - Kohsuke
67 public Message1_1Impl(MimeHeaders headers, InputStream in)
68 throws IOException, SOAPExceptionImpl {
69 super(headers, in);
70 }
71
72 public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
73 throws SOAPExceptionImpl {
74 super(headers,ct,stat,in);
75 }
76
77 public SOAPPart getSOAPPart() {
78 if (soapPart == null) {
79 soapPart = new SOAPPart1_1Impl(this);
80 }
81 return soapPart;
82 }
83
84 protected boolean isCorrectSoapVersion(int contentTypeId) {
85 return (contentTypeId & SOAP1_1_FLAG) != 0;
86 }
87
88 public String getAction() {
89 log.log(
90 Level.SEVERE,
91 "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
92 new String[] { "Action" });
93 throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
94 }
95
96 public void setAction(String type) {
97 log.log(
98 Level.SEVERE,
99 "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
100 new String[] { "Action" });
101 throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
102 }
103
104 public String getCharset() {
105 log.log(
106 Level.SEVERE,
107 "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
108 new String[] { "Charset" });
109 throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
110 }
111
112 public void setCharset(String charset) {
113 log.log(
114 Level.SEVERE,
115 "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
116 new String[] { "Charset" });
117 throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
118 }
119
120 protected String getExpectedContentType() {
121 return isFastInfoset ? "application/fastinfoset" : "text/xml";
122 }
123
124 protected String getExpectedAcceptHeader() {
125 String accept = "text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
126 return acceptFastInfoset ? ("application/fastinfoset, " + accept) : accept;
127 }
128
129 }

mercurial