Source Code Cross Referenced for WSSFeatureBindingExtension.java in  » 6.0-JDK-Modules-com.sun » xws-security » com » sun » xml » wss » impl » policy » mls » 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.wss.impl.policy.mls 
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 in
005:         * compliance with the License.
006:         * 
007:         * You can obtain a copy of the license at
008:         * https://glassfish.dev.java.net/public/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 Notice in each file and include the License file
014:         * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
015:         * If applicable, add the following below the CDDL Header,
016:         * with the fields enclosed by brackets [] replaced by
017:         * you own identifying information:
018:         * "Portions Copyrighted [year] [name of copyright owner]"
019:         * 
020:         * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
021:         */
022:
023:        /*
024:         * WSSFeatureBindingExtension.java
025:         *
026:         * Created on August 31, 2005, 7:11 PM
027:         *
028:         * To change this template, choose Tools | Options and locate the template under
029:         * the Source Creation and Management node. Right-click the template and choose
030:         * Open. You can then make changes to the template in the Source Editor.
031:         */
032:
033:        package com.sun.xml.wss.impl.policy.mls;
034:
035:        import com.sun.xml.wss.impl.PolicyTypeUtil;
036:        import com.sun.xml.wss.impl.policy.MLSPolicy;
037:        import com.sun.xml.wss.impl.policy.PolicyGenerationException;
038:
039:        /**
040:         *
041:         * @author abhijit.das@Sun.COM
042:         */
043:        public abstract class WSSFeatureBindingExtension extends WSSPolicy {
044:
045:            /** Creates a new instance of WSSFeatureBindingExtension */
046:            public WSSFeatureBindingExtension() {
047:            }
048:
049:            /**
050:             * Create and set the FeatureBinding for this WSSPolicy to a UsernameTokenBinding
051:             * @return a new UsernameTokenBinding as a FeatureBinding for this WSSPolicy
052:             * @exception PolicyGenerationException if UsernameTokenBinding is not a valid FeatureBinding for this WSSPolicy
053:             * @see SignaturePolicy
054:             * @see EncryptionPolicy
055:             * @see AuthenticationTokenPolicy
056:             */
057:            public MLSPolicy newUsernameTokenFeatureBinding()
058:                    throws PolicyGenerationException {
059:                if (isReadOnly()) {
060:                    throw new RuntimeException(
061:                            "Can not create a feature binding of UsernameToken type for ReadOnly "
062:                                    + _policyIdentifier);
063:                }
064:
065:                if ((PolicyTypeUtil.SIGNATURE_POLICY_TYPE == _policyIdentifier)
066:                        || (PolicyTypeUtil.ENCRYPTION_POLICY_TYPE == _policyIdentifier)) {
067:                    throw new PolicyGenerationException(
068:                            "Can not create a feature binding of UsernameToken type for "
069:                                    + _policyIdentifier);
070:                }
071:
072:                this ._featureBinding = new AuthenticationTokenPolicy.UsernameTokenBinding();
073:                return _featureBinding;
074:            }
075:
076:            /**
077:             * Create and set the FeatureBinding for this WSSPolicy to an X509CertificateBinding
078:             * @return a new X509CertificateBinding as a FeatureBinding for this WSSPolicy
079:             * @exception PolicyGenerationException if X509CertificateBinding is not a valid FeatureBinding for this WSSPolicy
080:             * @see SignaturePolicy
081:             * @see EncryptionPolicy
082:             * @see AuthenticationTokenPolicy
083:             */
084:            public MLSPolicy newX509CertificateFeatureBinding()
085:                    throws PolicyGenerationException {
086:                if (isReadOnly()) {
087:                    throw new RuntimeException(
088:                            "Can not create a feature binding of X509Certificate type for ReadOnly "
089:                                    + _policyIdentifier);
090:                }
091:
092:                if ((PolicyTypeUtil.SIGNATURE_POLICY_TYPE == _policyIdentifier)
093:                        || (PolicyTypeUtil.ENCRYPTION_POLICY_TYPE == _policyIdentifier)) {
094:                    throw new PolicyGenerationException(
095:                            "Can not create a feature binding of X509Certificate type for "
096:                                    + _policyIdentifier);
097:                }
098:
099:                this ._featureBinding = new AuthenticationTokenPolicy.X509CertificateBinding();
100:                return _featureBinding;
101:            }
102:
103:            /**
104:             * Create and set the FeatureBinding for this WSSPolicy to a SAMLAssertionBinding
105:             * @return a new SAMLAssertionBinding as a FeatureBinding for this WSSPolicy
106:             * @exception PolicyGenerationException if SAMLAssertionBinding is not a valid FeatureBinding for this WSSPolicy
107:             * @see SignaturePolicy
108:             * @see EncryptionPolicy
109:             * @see AuthenticationTokenPolicy
110:             */
111:            public MLSPolicy newSAMLAssertionFeatureBinding()
112:                    throws PolicyGenerationException {
113:                if (isReadOnly()) {
114:                    throw new RuntimeException(
115:                            "Can not create a feature binding of SAMLAssertion type for ReadOnly "
116:                                    + _policyIdentifier);
117:                }
118:
119:                if ((PolicyTypeUtil.SIGNATURE_POLICY_TYPE == _policyIdentifier)
120:                        || (PolicyTypeUtil.ENCRYPTION_POLICY_TYPE == _policyIdentifier)) {
121:                    throw new PolicyGenerationException(
122:                            "Can not create a feature binding of SAMLAssertion type for "
123:                                    + _policyIdentifier);
124:                }
125:
126:                this ._featureBinding = new AuthenticationTokenPolicy.SAMLAssertionBinding();
127:                return _featureBinding;
128:            }
129:
130:            /**
131:             * Create and set the FeatureBinding for this WSSPolicy to a TimestampPolicy
132:             * @return a new TimestampPolicy as a FeatureBinding for this WSSPolicy
133:             * @exception PolicyGenerationException, if TimestampPolicy is not a valid FeatureBinding for this WSSPolicy
134:             * @see SignaturePolicy
135:             * @see EncryptionPolicy
136:             * @see AuthenticationTokenPolicy
137:             */
138:            /*public MLSPolicy newTimestampFeatureBinding () throws PolicyGenerationException {
139:                if ( isReadOnly () ) {
140:                    throw new RuntimeException (
141:                            "Can not create a feature binding of Timestamp type for ReadOnly " + _policyIdentifier);
142:                }
143:                
144:                if (!(_policyIdentifier == PolicyTypeUtil.USERNAMETOKEN_TYPE) &&
145:                        !(_policyIdentifier == PolicyTypeUtil.SIGNATURE_POLICY_FEATUREBINDING_TYPE))
146:                    throw new PolicyGenerationException (
147:                            "Can not create a feature binding of Timestamp type for " + _policyIdentifier);
148:                
149:                this._featureBinding = new TimestampPolicy ();
150:                return _featureBinding;
151:            }*/
152:
153:        }
ww_w___.___j_av___a2___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.