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

Mon, 04 May 2009 21:10:41 -0700

author
tbell
date
Mon, 04 May 2009 21:10:41 -0700
changeset 50
42dfec6871f6
parent 45
31822b475baa
child 78
860b95cc8d1d
permissions
-rw-r--r--

6658158: Mutable statics in SAAJ (findbugs)
6658163: txw2.DatatypeWriter.BUILDIN is a mutable static (findbugs)
Reviewed-by: darcy

     1 /*
     2  * Copyright 2005-2006 Sun Microsystems, Inc.  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.  Sun designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    22  * CA 95054 USA or visit www.sun.com if you need additional information or
    23  * have any questions.
    24  */
    25 /*
    26  *
    27  */
    31 /**
    32 *
    33 * @author SAAJ RI Development Team
    34 */
    35 package com.sun.xml.internal.messaging.saaj.soap.ver1_1;
    37 import java.io.IOException;
    38 import java.io.InputStream;
    39 import java.util.logging.Level;
    40 import java.util.logging.Logger;
    42 import javax.xml.soap.*;
    44 import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
    45 import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
    46 import com.sun.xml.internal.messaging.saaj.soap.MessageImpl;
    47 import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
    49 public class Message1_1Impl extends MessageImpl implements SOAPConstants {
    51     protected static final Logger log =
    52         Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN,
    53                          "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");
    55     public Message1_1Impl() {
    56         super();
    57     }
    59     public Message1_1Impl(boolean isFastInfoset, boolean acceptFastInfoset) {
    60         super(isFastInfoset, acceptFastInfoset);
    61     }
    63     public Message1_1Impl(SOAPMessage msg) {
    64         super(msg);
    65     }
    67     // unused. can we delete this? - Kohsuke
    68     public Message1_1Impl(MimeHeaders headers, InputStream in)
    69         throws IOException, SOAPExceptionImpl {
    70         super(headers, in);
    71     }
    73     public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    74         throws SOAPExceptionImpl {
    75         super(headers,ct,stat,in);
    76     }
    78     public SOAPPart getSOAPPart() {
    79         if (soapPart == null) {
    80             soapPart = new SOAPPart1_1Impl(this);
    81         }
    82         return soapPart;
    83     }
    85     protected boolean isCorrectSoapVersion(int contentTypeId) {
    86         return (contentTypeId & SOAP1_1_FLAG) != 0;
    87     }
    89     public String getAction() {
    90         log.log(
    91             Level.SEVERE,
    92             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
    93             new String[] { "Action" });
    94         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
    95     }
    97     public void setAction(String type) {
    98         log.log(
    99             Level.SEVERE,
   100             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
   101             new String[] { "Action" });
   102         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
   103     }
   105     public String getCharset() {
   106         log.log(
   107             Level.SEVERE,
   108             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
   109             new String[] { "Charset" });
   110         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
   111     }
   113     public void setCharset(String charset) {
   114         log.log(
   115             Level.SEVERE,
   116             "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
   117             new String[] { "Charset" });
   118         throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
   119     }
   121     protected String getExpectedContentType() {
   122         return isFastInfoset ? "application/fastinfoset" : "text/xml";
   123     }
   125    protected String getExpectedAcceptHeader() {
   126        String accept = "text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
   127        return acceptFastInfoset ? ("application/fastinfoset, " + accept) : accept;
   128    }
   130 }

mercurial