Source Code Cross Referenced for SignatureConfirmation.java in  » 6.0-JDK-Modules-com.sun » xws-security » com » sun » xml » ws » security » opt » impl » tokens » 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 com.sun » xws security » com.sun.xml.ws.security.opt.impl.tokens 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * SignatureConfirmation.java
003:         *
004:         * Created on September 11, 2006, 3:06 PM
005:         *
006:         * The contents of this file are subject to the terms
007:         * of the Common Development and Distribution License
008:         * (the License).  You may not use this file except in
009:         * compliance with the License.
010:         *
011:         * You can obtain a copy of the license at
012:         * https://glassfish.dev.java.net/public/CDDLv1.0.html.
013:         * See the License for the specific language governing
014:         * permissions and limitations under the License.
015:         *
016:         * When distributing Covered Code, include this CDDL
017:         * Header Notice in each file and include the License file
018:         * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
019:         * If applicable, add the following below the CDDL Header,
020:         * with the fields enclosed by brackets [] replaced by
021:         * you own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         *
024:         * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
025:         */
026:
027:        package com.sun.xml.ws.security.opt.impl.tokens;
028:
029:        import com.sun.xml.ws.security.opt.api.SecurityElementWriter;
030:        import com.sun.xml.ws.security.opt.api.SecurityHeaderElement;
031:        import com.sun.xml.ws.security.opt.impl.util.JAXBUtil;
032:        import com.sun.xml.ws.security.secext11.ObjectFactory;
033:        import com.sun.xml.ws.security.secext11.SignatureConfirmationType;
034:        import java.io.OutputStream;
035:        import java.util.HashMap;
036:        import java.util.Iterator;
037:        import java.util.Map;
038:        import javax.xml.bind.JAXBElement;
039:        import javax.xml.bind.Marshaller;
040:        import javax.xml.bind.JAXBException;
041:        import javax.xml.namespace.QName;
042:        import com.sun.xml.wss.impl.MessageConstants;
043:        import com.sun.xml.stream.buffer.XMLStreamBufferResult;
044:        import com.sun.xml.ws.api.SOAPVersion;
045:        import javax.xml.stream.XMLStreamException;
046:
047:        /**
048:         *
049:         * @author Ashutosh.Shahi@sun.com
050:         */
051:        public class SignatureConfirmation extends SignatureConfirmationType
052:                implements  SecurityHeaderElement, SecurityElementWriter {
053:
054:            private final ObjectFactory objFac = new ObjectFactory();
055:            private SOAPVersion soapVersion = SOAPVersion.SOAP_11;
056:
057:            /** Creates a new instance of SignatureConfirmation */
058:            public SignatureConfirmation(String id, SOAPVersion sv) {
059:                setId(id);
060:                this .soapVersion = sv;
061:            }
062:
063:            public String getNamespaceURI() {
064:                return MessageConstants.WSSE11_NS;
065:            }
066:
067:            public String getLocalPart() {
068:                return MessageConstants.SIGNATURE_CONFIRMATION_LNAME;
069:            }
070:
071:            public String getAttribute(String nsUri, String localName) {
072:                throw new UnsupportedOperationException();
073:            }
074:
075:            public String getAttribute(QName name) {
076:                throw new UnsupportedOperationException();
077:            }
078:
079:            public javax.xml.stream.XMLStreamReader readHeader()
080:                    throws javax.xml.stream.XMLStreamException {
081:                XMLStreamBufferResult xbr = new XMLStreamBufferResult();
082:                JAXBElement<SignatureConfirmationType> scElem = objFac
083:                        .createSignatureConfirmation(this );
084:                try {
085:                    getMarshaller().marshal(scElem, xbr);
086:
087:                } catch (JAXBException je) {
088:                    throw new XMLStreamException(je);
089:                }
090:                return xbr.getXMLStreamBuffer().readAsXMLStreamReader();
091:            }
092:
093:            public void writeTo(OutputStream os) {
094:            }
095:
096:            public void writeTo(javax.xml.stream.XMLStreamWriter streamWriter)
097:                    throws javax.xml.stream.XMLStreamException {
098:                JAXBElement<SignatureConfirmationType> scElem = objFac
099:                        .createSignatureConfirmation(this );
100:                try {
101:                    // If writing to Zephyr, get output stream and use JAXB UTF-8 writer
102:                    if (streamWriter instanceof  Map) {
103:                        OutputStream os = (OutputStream) ((Map) streamWriter)
104:                                .get("sjsxp-outputstream");
105:                        if (os != null) {
106:                            streamWriter.writeCharacters(""); // Force completion of open elems
107:                            getMarshaller().marshal(scElem, os);
108:                            return;
109:                        }
110:                    }
111:
112:                    getMarshaller().marshal(scElem, streamWriter);
113:                } catch (JAXBException e) {
114:                    throw new XMLStreamException(e);
115:                }
116:            }
117:
118:            private Marshaller getMarshaller() throws JAXBException {
119:                return JAXBUtil.createMarshaller(soapVersion);
120:            }
121:
122:            /**
123:             * 
124:             * @param id 
125:             * @return 
126:             */
127:            public boolean refersToSecHdrWithId(String id) {
128:                return false;
129:            }
130:
131:            public void writeTo(javax.xml.stream.XMLStreamWriter streamWriter,
132:                    HashMap props) throws javax.xml.stream.XMLStreamException {
133:                try {
134:                    Marshaller marshaller = getMarshaller();
135:                    Iterator<Map.Entry<Object, Object>> itr = props.entrySet()
136:                            .iterator();
137:                    while (itr.hasNext()) {
138:                        Map.Entry<Object, Object> entry = itr.next();
139:                        marshaller.setProperty((String) entry.getKey(), entry
140:                                .getValue());
141:                    }
142:                    writeTo(streamWriter);
143:                } catch (JAXBException jbe) {
144:                    throw new XMLStreamException(jbe);
145:                }
146:            }
147:
148:        }
www_.___j_av___a___2_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.