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

changeset 1
0961a4a21176
child 45
31822b475baa
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Message1_1Impl.java	Sat Dec 01 00:00:00 2007 +0000
     1.3 @@ -0,0 +1,129 @@
     1.4 +/*
     1.5 + * $Id: Message1_1Impl.java,v 1.24 2006/01/27 12:49:41 vj135062 Exp $
     1.6 + */
     1.7 +
     1.8 +/*
     1.9 + * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
    1.10 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    1.11 + *
    1.12 + * This code is free software; you can redistribute it and/or modify it
    1.13 + * under the terms of the GNU General Public License version 2 only, as
    1.14 + * published by the Free Software Foundation.  Sun designates this
    1.15 + * particular file as subject to the "Classpath" exception as provided
    1.16 + * by Sun in the LICENSE file that accompanied this code.
    1.17 + *
    1.18 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.19 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.20 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.21 + * version 2 for more details (a copy is included in the LICENSE file that
    1.22 + * accompanied this code).
    1.23 + *
    1.24 + * You should have received a copy of the GNU General Public License version
    1.25 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.26 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.27 + *
    1.28 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    1.29 + * CA 95054 USA or visit www.sun.com if you need additional information or
    1.30 + * have any questions.
    1.31 + */
    1.32 +
    1.33 +/**
    1.34 +*
    1.35 +* @author SAAJ RI Development Team
    1.36 +*/
    1.37 +package com.sun.xml.internal.messaging.saaj.soap.ver1_1;
    1.38 +
    1.39 +import java.io.IOException;
    1.40 +import java.io.InputStream;
    1.41 +import java.util.logging.Level;
    1.42 +import java.util.logging.Logger;
    1.43 +
    1.44 +import javax.xml.soap.*;
    1.45 +
    1.46 +import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
    1.47 +import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType;
    1.48 +import com.sun.xml.internal.messaging.saaj.soap.MessageImpl;
    1.49 +import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
    1.50 +
    1.51 +public class Message1_1Impl extends MessageImpl implements SOAPConstants {
    1.52 +
    1.53 +    protected static Logger log =
    1.54 +        Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN,
    1.55 +                         "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");
    1.56 +
    1.57 +    public Message1_1Impl() {
    1.58 +        super();
    1.59 +    }
    1.60 +
    1.61 +    public Message1_1Impl(boolean isFastInfoset, boolean acceptFastInfoset) {
    1.62 +        super(isFastInfoset, acceptFastInfoset);
    1.63 +    }
    1.64 +
    1.65 +    public Message1_1Impl(SOAPMessage msg) {
    1.66 +        super(msg);
    1.67 +    }
    1.68 +
    1.69 +    // unused. can we delete this? - Kohsuke
    1.70 +    public Message1_1Impl(MimeHeaders headers, InputStream in)
    1.71 +        throws IOException, SOAPExceptionImpl {
    1.72 +        super(headers, in);
    1.73 +    }
    1.74 +
    1.75 +    public Message1_1Impl(MimeHeaders headers, ContentType ct, int stat, InputStream in)
    1.76 +        throws SOAPExceptionImpl {
    1.77 +        super(headers,ct,stat,in);
    1.78 +    }
    1.79 +
    1.80 +    public SOAPPart getSOAPPart() {
    1.81 +        if (soapPart == null) {
    1.82 +            soapPart = new SOAPPart1_1Impl(this);
    1.83 +        }
    1.84 +        return soapPart;
    1.85 +    }
    1.86 +
    1.87 +    protected boolean isCorrectSoapVersion(int contentTypeId) {
    1.88 +        return (contentTypeId & SOAP1_1_FLAG) != 0;
    1.89 +    }
    1.90 +
    1.91 +    public String getAction() {
    1.92 +        log.log(
    1.93 +            Level.SEVERE,
    1.94 +            "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
    1.95 +            new String[] { "Action" });
    1.96 +        throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
    1.97 +    }
    1.98 +
    1.99 +    public void setAction(String type) {
   1.100 +        log.log(
   1.101 +            Level.SEVERE,
   1.102 +            "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
   1.103 +            new String[] { "Action" });
   1.104 +        throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
   1.105 +    }
   1.106 +
   1.107 +    public String getCharset() {
   1.108 +        log.log(
   1.109 +            Level.SEVERE,
   1.110 +            "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
   1.111 +            new String[] { "Charset" });
   1.112 +        throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
   1.113 +    }
   1.114 +
   1.115 +    public void setCharset(String charset) {
   1.116 +        log.log(
   1.117 +            Level.SEVERE,
   1.118 +            "SAAJ0303.ver1_1.msg.op.unsupported.in.SOAP1.1",
   1.119 +            new String[] { "Charset" });
   1.120 +        throw new UnsupportedOperationException("Operation not supported by SOAP 1.1");
   1.121 +    }
   1.122 +
   1.123 +    protected String getExpectedContentType() {
   1.124 +        return isFastInfoset ? "application/fastinfoset" : "text/xml";
   1.125 +    }
   1.126 +
   1.127 +   protected String getExpectedAcceptHeader() {
   1.128 +       String accept = "text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2";
   1.129 +       return acceptFastInfoset ? ("application/fastinfoset, " + accept) : accept;
   1.130 +   }
   1.131 +
   1.132 +}

mercurial