Source Code Cross Referenced for Header1_2Impl.java in  » 6.0-JDK-Modules » saaj » com » sun » xml » messaging » saaj » soap » ver1_2 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » saaj » com.sun.xml.messaging.saaj.soap.ver1_2 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the terms
003:         * of the Common Development and Distribution License
004:         * (the "License").  You may not use this file except
005:         * in compliance with the License.
006:         *
007:         * You can obtain a copy of the license at
008:         * https://jwsdp.dev.java.net/CDDLv1.0.html
009:         * See the License for the specific language governing
010:         * permissions and limitations under the License.
011:         *
012:         * When distributing Covered Code, include this CDDL
013:         * HEADER in each file and include the License file at
014:         * https://jwsdp.dev.java.net/CDDLv1.0.html  If applicable,
015:         * add the following below this CDDL HEADER, with the
016:         * fields enclosed by brackets "[]" replaced with your
017:         * own identifying information: Portions Copyright [yyyy]
018:         * [name of copyright owner]
019:         */
020:        /*
021:         * $Id: Header1_2Impl.java,v 1.2 2007/07/16 16:41:24 ofung Exp $
022:         */
023:
024:        /*
025:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
026:         * 
027:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
028:         * 
029:         * The contents of this file are subject to the terms of either the GNU
030:         * General Public License Version 2 only ("GPL") or the Common Development
031:         * and Distribution License("CDDL") (collectively, the "License").  You
032:         * may not use this file except in compliance with the License. You can obtain
033:         * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
034:         * or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
035:         * language governing permissions and limitations under the License.
036:         * 
037:         * When distributing the software, include this License Header Notice in each
038:         * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
039:         * Sun designates this particular file as subject to the "Classpath" exception
040:         * as provided by Sun in the GPL Version 2 section of the License file that
041:         * accompanied this code.  If applicable, add the following below the License
042:         * Header, with the fields enclosed by brackets [] replaced by your own
043:         * identifying information: "Portions Copyrighted [year]
044:         * [name of copyright owner]"
045:         * 
046:         * Contributor(s):
047:         * 
048:         * If you wish your version of this file to be governed by only the CDDL or
049:         * only the GPL Version 2, indicate your decision by adding "[Contributor]
050:         * elects to include this software in this distribution under the [CDDL or GPL
051:         * Version 2] license."  If you don't indicate a single choice of license, a
052:         * recipient has the option to distribute your version of this file under
053:         * either the CDDL, the GPL Version 2 or to extend the choice of license to
054:         * its licensees as provided above.  However, if you add GPL Version 2 code
055:         * and therefore, elected the GPL Version 2 license, then the option applies
056:         * only if the new code is made subject to such option by the copyright
057:         * holder.
058:         */
059:
060:        /**
061:         *
062:         * @author SAAJ RI Development Team
063:         */package com.sun.xml.messaging.saaj.soap.ver1_2;
064:
065:        import java.util.List;
066:        import java.util.Iterator;
067:        import java.util.logging.Logger;
068:        import java.util.logging.Level;
069:
070:        import javax.xml.namespace.QName;
071:        import javax.xml.soap.*;
072:
073:        import com.sun.xml.messaging.saaj.SOAPExceptionImpl;
074:        import com.sun.xml.messaging.saaj.soap.SOAPDocument;
075:        import com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl;
076:        import com.sun.xml.messaging.saaj.soap.impl.HeaderElementImpl;
077:        import com.sun.xml.messaging.saaj.soap.impl.HeaderImpl;
078:        import com.sun.xml.messaging.saaj.soap.name.NameImpl;
079:        import com.sun.xml.messaging.saaj.util.LogDomainConstants;
080:
081:        public class Header1_2Impl extends HeaderImpl {
082:
083:            protected static Logger log = Logger.getLogger(
084:                    LogDomainConstants.SOAP_VER1_2_DOMAIN,
085:                    "com.sun.xml.messaging.saaj.soap.ver1_2.LocalStrings");
086:
087:            public Header1_2Impl(SOAPDocumentImpl ownerDocument, String prefix) {
088:                super (ownerDocument, NameImpl.createHeader1_2Name(prefix));
089:            }
090:
091:            protected NameImpl getNotUnderstoodName() {
092:                return NameImpl.createNotUnderstood1_2Name(null);
093:            }
094:
095:            protected NameImpl getUpgradeName() {
096:                return NameImpl.createUpgrade1_2Name(null);
097:            }
098:
099:            protected NameImpl getSupportedEnvelopeName() {
100:                return NameImpl.createSupportedEnvelope1_2Name(null);
101:            }
102:
103:            public SOAPHeaderElement addNotUnderstoodHeaderElement(
104:                    final QName sourceName) throws SOAPException {
105:
106:                if (sourceName == null) {
107:                    log
108:                            .severe("SAAJ0410.ver1_2.no.null.to.addNotUnderstoodHeader");
109:                    throw new SOAPException(
110:                            "Cannot pass NULL to addNotUnderstoodHeaderElement");
111:                }
112:                if ("".equals(sourceName.getNamespaceURI())) {
113:                    log.severe("SAAJ0417.ver1_2.qname.not.ns.qualified");
114:                    throw new SOAPException(
115:                            "The qname passed to addNotUnderstoodHeaderElement must be namespace-qualified");
116:                }
117:                String prefix = sourceName.getPrefix();
118:                if ("".equals(prefix)) {
119:                    prefix = "ns1";
120:                }
121:                Name notunderstoodName = getNotUnderstoodName();
122:                SOAPHeaderElement notunderstoodHeaderElement = (SOAPHeaderElement) addChildElement(notunderstoodName);
123:                notunderstoodHeaderElement.addAttribute(NameImpl
124:                        .createFromUnqualifiedName("qname"),
125:                        getQualifiedName(new QName(
126:                                sourceName.getNamespaceURI(), sourceName
127:                                        .getLocalPart(), prefix)));
128:                notunderstoodHeaderElement.addNamespaceDeclaration(prefix,
129:                        sourceName.getNamespaceURI());
130:                return notunderstoodHeaderElement;
131:            }
132:
133:            public SOAPElement addTextNode(String text) throws SOAPException {
134:                log.log(Level.SEVERE, "SAAJ0416.ver1_2.adding.text.not.legal",
135:                        getElementQName());
136:                throw new SOAPExceptionImpl(
137:                        "Adding text to SOAP 1.2 Header is not legal");
138:            }
139:
140:            protected SOAPHeaderElement createHeaderElement(Name name)
141:                    throws SOAPException {
142:                String uri = name.getURI();
143:                if (uri == null || uri.equals("")) {
144:                    log
145:                            .severe("SAAJ0413.ver1_2.header.elems.must.be.ns.qualified");
146:                    throw new SOAPExceptionImpl(
147:                            "SOAP 1.2 header elements must be namespace qualified");
148:                }
149:                return new HeaderElement1_2Impl(
150:                        ((SOAPDocument) getOwnerDocument()).getDocument(), name);
151:            }
152:
153:            protected SOAPHeaderElement createHeaderElement(QName name)
154:                    throws SOAPException {
155:                String uri = name.getNamespaceURI();
156:                if (uri == null || uri.equals("")) {
157:                    log
158:                            .severe("SAAJ0413.ver1_2.header.elems.must.be.ns.qualified");
159:                    throw new SOAPExceptionImpl(
160:                            "SOAP 1.2 header elements must be namespace qualified");
161:                }
162:                return new HeaderElement1_2Impl(
163:                        ((SOAPDocument) getOwnerDocument()).getDocument(), name);
164:            }
165:
166:            public void setEncodingStyle(String encodingStyle)
167:                    throws SOAPException {
168:                log.severe("SAAJ0409.ver1_2.no.encodingstyle.in.header");
169:                throw new SOAPExceptionImpl(
170:                        "encodingStyle attribute cannot appear on Header");
171:            }
172:
173:            public SOAPElement addAttribute(Name name, String value)
174:                    throws SOAPException {
175:                if (name.getLocalName().equals("encodingStyle")
176:                        && name.getURI().equals(NameImpl.SOAP12_NAMESPACE)) {
177:
178:                    setEncodingStyle(value);
179:                }
180:                return super .addAttribute(name, value);
181:            }
182:
183:            public SOAPElement addAttribute(QName name, String value)
184:                    throws SOAPException {
185:                if (name.getLocalPart().equals("encodingStyle")
186:                        && name.getNamespaceURI().equals(
187:                                NameImpl.SOAP12_NAMESPACE)) {
188:
189:                    setEncodingStyle(value);
190:                }
191:                return super.addAttribute(name, value);
192:            }
193:        }
w_ww__.___j___ava2__s_.c_o_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.