KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > wsitmodelext > security > proprietary > ProprietarySecurityPolicyFactories


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.websvc.wsitmodelext.security.proprietary;
21
22 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.impl.TimestampImpl;
23 import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
24 import org.netbeans.modules.xml.wsdl.model.spi.ElementFactory;
25 import org.w3c.dom.Element JavaDoc;
26
27 import javax.xml.namespace.QName JavaDoc;
28 import java.util.Collections JavaDoc;
29 import java.util.Set JavaDoc;
30 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.impl.CallbackHandlerConfigurationImpl;
31 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.impl.CallbackHandlerImpl;
32 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.impl.KeyStoreImpl;
33 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.impl.TrustStoreImpl;
34 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.impl.ValidatorConfigurationImpl;
35 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.impl.ValidatorImpl;
36
37 public class ProprietarySecurityPolicyFactories {
38
39     public static class KeyStoreFactory extends ElementFactory {
40         @Override JavaDoc
41         public Set JavaDoc<QName JavaDoc> getElementQNames() {
42             return Collections.singleton(ProprietarySecurityPolicyQName.KEYSTORE.getQName());
43         }
44         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
45             return type.cast(new KeyStoreImpl(context.getModel()));
46         }
47         @Override JavaDoc
48         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
49             return new KeyStoreImpl(context.getModel(), element);
50         }
51     }
52
53     public static class ValidatorConfigurationFactory extends ElementFactory {
54         @Override JavaDoc
55         public Set JavaDoc<QName JavaDoc> getElementQNames() {
56             return Collections.singleton(ProprietarySecurityPolicyQName.VALIDATORCONFIGURATION.getQName());
57         }
58         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
59             return type.cast(new ValidatorConfigurationImpl(context.getModel()));
60         }
61         @Override JavaDoc
62         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
63             return new ValidatorConfigurationImpl(context.getModel(), element);
64         }
65     }
66
67     public static class ValidatorFactory extends ElementFactory {
68         @Override JavaDoc
69         public Set JavaDoc<QName JavaDoc> getElementQNames() {
70             return Collections.singleton(ProprietarySecurityPolicyQName.VALIDATOR.getQName());
71         }
72         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
73             return type.cast(new ValidatorImpl(context.getModel()));
74         }
75         @Override JavaDoc
76         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
77             return new ValidatorImpl(context.getModel(), element);
78         }
79     }
80     
81     public static class TimestampFactory extends ElementFactory {
82         @Override JavaDoc
83         public Set JavaDoc<QName JavaDoc> getElementQNames() {
84             return Collections.singleton(ProprietarySecurityPolicyQName.TIMESTAMP.getQName());
85         }
86         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
87             return type.cast(new TimestampImpl(context.getModel()));
88         }
89         @Override JavaDoc
90         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
91             return new TimestampImpl(context.getModel(), element);
92         }
93     }
94
95     public static class TrustStoreFactory extends ElementFactory {
96         @Override JavaDoc
97         public Set JavaDoc<QName JavaDoc> getElementQNames() {
98             return Collections.singleton(ProprietarySecurityPolicyQName.TRUSTSTORE.getQName());
99         }
100         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
101             return type.cast(new TrustStoreImpl(context.getModel()));
102         }
103         @Override JavaDoc
104         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
105             return new TrustStoreImpl(context.getModel(), element);
106         }
107     }
108
109     public static class CallbackHandlerFactory extends ElementFactory {
110         @Override JavaDoc
111         public Set JavaDoc<QName JavaDoc> getElementQNames() {
112             return Collections.singleton(ProprietarySecurityPolicyQName.CALLBACKHANDLER.getQName());
113         }
114         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
115             return type.cast(new CallbackHandlerImpl(context.getModel()));
116         }
117         @Override JavaDoc
118         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
119             return new CallbackHandlerImpl(context.getModel(), element);
120         }
121     }
122
123     public static class CallbackHandlerConfigurationFactory extends ElementFactory {
124         @Override JavaDoc
125         public Set JavaDoc<QName JavaDoc> getElementQNames() {
126             return Collections.singleton(ProprietarySecurityPolicyQName.CALLBACKHANDLERCONFIGURATION.getQName());
127         }
128         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
129             return type.cast(new CallbackHandlerConfigurationImpl(context.getModel()));
130         }
131         @Override JavaDoc
132         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
133             return new CallbackHandlerConfigurationImpl(context.getModel(), element);
134         }
135     }
136
137 }
138
Popular Tags