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