KickJava   Java API By Example, From Geeks To Geeks.

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


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.service;
21
22 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.service.impl.IssuerImpl;
23 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.service.impl.KeyTypeImpl;
24 import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
25 import org.netbeans.modules.xml.wsdl.model.spi.ElementFactory;
26 import org.w3c.dom.Element JavaDoc;
27
28 import javax.xml.namespace.QName JavaDoc;
29 import java.util.Collections JavaDoc;
30 import java.util.Set JavaDoc;
31 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.service.impl.CertAliasImpl;
32 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.service.impl.ContractImpl;
33 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.service.impl.LifeTimeSTSImpl;
34 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.service.impl.STSConfigurationServiceImpl;
35 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.service.impl.ServiceProviderImpl;
36 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.service.impl.ServiceProvidersImpl;
37 import org.netbeans.modules.websvc.wsitmodelext.security.proprietary.service.impl.TokenTypeImpl;
38
39 public class ProprietaryTrustServiceFactories {
40
41     public static class CertAliasFactory extends ElementFactory {
42         @Override JavaDoc
43         public Set JavaDoc<QName JavaDoc> getElementQNames() {
44             return Collections.singleton(ProprietaryTrustServiceQName.CERTALIAS.getQName());
45         }
46         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
47             return type.cast(new CertAliasImpl(context.getModel()));
48         }
49         @Override JavaDoc
50         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
51             return new CertAliasImpl(context.getModel(), element);
52         }
53     }
54
55     public static class ContractFactory extends ElementFactory {
56         @Override JavaDoc
57         public Set JavaDoc<QName JavaDoc> getElementQNames() {
58             return Collections.singleton(ProprietaryTrustServiceQName.CONTRACT.getQName());
59         }
60         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
61             return type.cast(new ContractImpl(context.getModel()));
62         }
63         @Override JavaDoc
64         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
65             return new ContractImpl(context.getModel(), element);
66         }
67     }
68
69     public static class STSIssuerFactory extends ElementFactory {
70         @Override JavaDoc
71         public Set JavaDoc<QName JavaDoc> getElementQNames() {
72             return Collections.singleton(ProprietaryTrustServiceQName.ISSUER.getQName());
73         }
74         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
75             return type.cast(new IssuerImpl(context.getModel()));
76         }
77         @Override JavaDoc
78         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
79             return new IssuerImpl(context.getModel(), element);
80         }
81     }
82     
83     public static class STSConfigurationFactory extends ElementFactory {
84         @Override JavaDoc
85         public Set JavaDoc<QName JavaDoc> getElementQNames() {
86             return Collections.singleton(ProprietaryTrustServiceQName.STSCONFIGURATION.getQName());
87         }
88         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
89             return type.cast(new STSConfigurationServiceImpl(context.getModel()));
90         }
91         @Override JavaDoc
92         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
93             return new STSConfigurationServiceImpl(context.getModel(), element);
94         }
95     }
96
97     public static class ServiceProviderFactory extends ElementFactory {
98         @Override JavaDoc
99         public Set JavaDoc<QName JavaDoc> getElementQNames() {
100             return Collections.singleton(ProprietaryTrustServiceQName.SERVICEPROVIDER.getQName());
101         }
102         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
103             return type.cast(new ServiceProviderImpl(context.getModel()));
104         }
105         @Override JavaDoc
106         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
107             return new ServiceProviderImpl(context.getModel(), element);
108         }
109     }
110
111     public static class ServiceProvidersFactory extends ElementFactory {
112         @Override JavaDoc
113         public Set JavaDoc<QName JavaDoc> getElementQNames() {
114             return Collections.singleton(ProprietaryTrustServiceQName.SERVICEPROVIDERS.getQName());
115         }
116         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
117             return type.cast(new ServiceProvidersImpl(context.getModel()));
118         }
119         @Override JavaDoc
120         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
121             return new ServiceProvidersImpl(context.getModel(), element);
122         }
123     }
124     
125     public static class TokenTypeFactory extends ElementFactory {
126         @Override JavaDoc
127         public Set JavaDoc<QName JavaDoc> getElementQNames() {
128             return Collections.singleton(ProprietaryTrustServiceQName.TOKENTYPE.getQName());
129         }
130         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
131             return type.cast(new TokenTypeImpl(context.getModel()));
132         }
133         @Override JavaDoc
134         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
135             return new TokenTypeImpl(context.getModel(), element);
136         }
137     }
138
139     public static class KeyTypeFactory extends ElementFactory {
140         @Override JavaDoc
141         public Set JavaDoc<QName JavaDoc> getElementQNames() {
142             return Collections.singleton(ProprietaryTrustServiceQName.KEYTYPE.getQName());
143         }
144         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
145             return type.cast(new KeyTypeImpl(context.getModel()));
146         }
147         @Override JavaDoc
148         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
149             return new KeyTypeImpl(context.getModel(), element);
150         }
151     }
152     
153     public static class LifeTimeFactory extends ElementFactory {
154         @Override JavaDoc
155         public Set JavaDoc<QName JavaDoc> getElementQNames() {
156             return Collections.singleton(ProprietaryTrustServiceQName.LIFETIME.getQName());
157         }
158         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
159             return type.cast(new LifeTimeSTSImpl(context.getModel()));
160         }
161         @Override JavaDoc
162         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
163             return new LifeTimeSTSImpl(context.getModel(), element);
164         }
165     }
166 }
167
Popular Tags