KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > websvc > wsitmodelext > security > algosuite > AlgorithmSuiteFactories


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.algosuite;
21
22 import org.netbeans.modules.websvc.wsitmodelext.security.algosuite.impl.*;
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
31 public class AlgorithmSuiteFactories {
32
33     public static class AlgorithmSuiteFactory extends ElementFactory {
34         @Override JavaDoc
35         public Set JavaDoc<QName JavaDoc> getElementQNames() {
36             return Collections.singleton(AlgorithmSuiteQName.ALGORITHMSUITE.getQName());
37         }
38         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
39             return type.cast(new AlgorithmSuiteImpl(context.getModel()));
40         }
41         @Override JavaDoc
42         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
43             return new AlgorithmSuiteImpl(context.getModel(), element);
44         }
45     }
46
47     public static class Basic128Factory extends ElementFactory {
48         @Override JavaDoc
49         public Set JavaDoc<QName JavaDoc> getElementQNames() {
50             return Collections.singleton(AlgorithmSuiteQName.BASIC128.getQName());
51         }
52         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
53             return type.cast(new Basic128Impl(context.getModel()));
54         }
55         @Override JavaDoc
56         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
57             return new Basic128Impl(context.getModel(), element);
58         }
59     }
60
61     public static class Basic192Factory extends ElementFactory {
62         @Override JavaDoc
63         public Set JavaDoc<QName JavaDoc> getElementQNames() {
64             return Collections.singleton(AlgorithmSuiteQName.BASIC192.getQName());
65         }
66         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
67             return type.cast(new Basic192Impl(context.getModel()));
68         }
69         @Override JavaDoc
70         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
71             return new Basic192Impl(context.getModel(), element);
72         }
73     }
74
75     public static class Basic256Factory extends ElementFactory {
76         @Override JavaDoc
77         public Set JavaDoc<QName JavaDoc> getElementQNames() {
78             return Collections.singleton(AlgorithmSuiteQName.BASIC256.getQName());
79         }
80         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
81             return type.cast(new Basic256Impl(context.getModel()));
82         }
83         @Override JavaDoc
84         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
85             return new Basic256Impl(context.getModel(), element);
86         }
87     }
88
89     public static class TripleDesFactory extends ElementFactory {
90         @Override JavaDoc
91         public Set JavaDoc<QName JavaDoc> getElementQNames() {
92             return Collections.singleton(AlgorithmSuiteQName.TRIPLEDES.getQName());
93         }
94         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
95             return type.cast(new TripleDesImpl(context.getModel()));
96         }
97         @Override JavaDoc
98         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
99             return new TripleDesImpl(context.getModel(), element);
100         }
101     }
102
103     /* rsa15 */
104     public static class Basic128Rsa15Factory extends ElementFactory {
105         @Override JavaDoc
106         public Set JavaDoc<QName JavaDoc> getElementQNames() {
107             return Collections.singleton(AlgorithmSuiteQName.BASIC128RSA15.getQName());
108         }
109         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
110             return type.cast(new Basic128Rsa15Impl(context.getModel()));
111         }
112         @Override JavaDoc
113         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
114             return new Basic128Rsa15Impl(context.getModel(), element);
115         }
116     }
117
118     public static class Basic192Rsa15Factory extends ElementFactory {
119         @Override JavaDoc
120         public Set JavaDoc<QName JavaDoc> getElementQNames() {
121             return Collections.singleton(AlgorithmSuiteQName.BASIC192RSA15.getQName());
122         }
123         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
124             return type.cast(new Basic192Rsa15Impl(context.getModel()));
125         }
126         @Override JavaDoc
127         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
128             return new Basic192Rsa15Impl(context.getModel(), element);
129         }
130     }
131
132     public static class Basic256Rsa15Factory extends ElementFactory {
133         @Override JavaDoc
134         public Set JavaDoc<QName JavaDoc> getElementQNames() {
135             return Collections.singleton(AlgorithmSuiteQName.BASIC256RSA15.getQName());
136         }
137         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
138             return type.cast(new Basic256Rsa15Impl(context.getModel()));
139         }
140         @Override JavaDoc
141         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
142             return new Basic256Rsa15Impl(context.getModel(), element);
143         }
144     }
145
146     public static class TripleDesRsa15Factory extends ElementFactory {
147         @Override JavaDoc
148         public Set JavaDoc<QName JavaDoc> getElementQNames() {
149             return Collections.singleton(AlgorithmSuiteQName.TRIPLEDESRSA15.getQName());
150         }
151         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
152             return type.cast(new TripleDesRsa15Impl(context.getModel()));
153         }
154         @Override JavaDoc
155         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
156             return new TripleDesRsa15Impl(context.getModel(), element);
157         }
158     }
159
160     /* sha256 */
161     public static class Basic128Sha256Factory extends ElementFactory {
162         @Override JavaDoc
163         public Set JavaDoc<QName JavaDoc> getElementQNames() {
164             return Collections.singleton(AlgorithmSuiteQName.BASIC128SHA256.getQName());
165         }
166         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
167             return type.cast(new Basic128Sha256Impl(context.getModel()));
168         }
169         @Override JavaDoc
170         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
171             return new Basic128Sha256Impl(context.getModel(), element);
172         }
173     }
174
175     public static class Basic192Sha256Factory extends ElementFactory {
176         @Override JavaDoc
177         public Set JavaDoc<QName JavaDoc> getElementQNames() {
178             return Collections.singleton(AlgorithmSuiteQName.BASIC192SHA256.getQName());
179         }
180         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
181             return type.cast(new Basic192Sha256Impl(context.getModel()));
182         }
183         @Override JavaDoc
184         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
185             return new Basic192Sha256Impl(context.getModel(), element);
186         }
187     }
188
189     public static class Basic256Sha256Factory extends ElementFactory {
190         @Override JavaDoc
191         public Set JavaDoc<QName JavaDoc> getElementQNames() {
192             return Collections.singleton(AlgorithmSuiteQName.BASIC256SHA256.getQName());
193         }
194         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
195             return type.cast(new Basic256Sha256Impl(context.getModel()));
196         }
197         @Override JavaDoc
198         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
199             return new Basic256Sha256Impl(context.getModel(), element);
200         }
201     }
202
203     public static class TripleDesSha256Factory extends ElementFactory {
204         @Override JavaDoc
205         public Set JavaDoc<QName JavaDoc> getElementQNames() {
206             return Collections.singleton(AlgorithmSuiteQName.TRIPLEDESSHA256.getQName());
207         }
208         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
209             return type.cast(new TripleDesSha256Impl(context.getModel()));
210         }
211         @Override JavaDoc
212         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
213             return new TripleDesSha256Impl(context.getModel(), element);
214         }
215     }
216
217     /* sha256rsa15 */
218     public static class Basic128Sha256Rsa15Factory extends ElementFactory {
219         @Override JavaDoc
220         public Set JavaDoc<QName JavaDoc> getElementQNames() {
221             return Collections.singleton(AlgorithmSuiteQName.BASIC128SHA256RSA15.getQName());
222         }
223         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
224             return type.cast(new Basic128Sha256Rsa15Impl(context.getModel()));
225         }
226         @Override JavaDoc
227         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
228             return new Basic128Sha256Rsa15Impl(context.getModel(), element);
229         }
230     }
231
232     public static class Basic192Sha256Rsa15Factory extends ElementFactory {
233         @Override JavaDoc
234         public Set JavaDoc<QName JavaDoc> getElementQNames() {
235             return Collections.singleton(AlgorithmSuiteQName.BASIC192SHA256RSA15.getQName());
236         }
237         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
238             return type.cast(new Basic192Sha256Rsa15Impl(context.getModel()));
239         }
240         @Override JavaDoc
241         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
242             return new Basic192Sha256Rsa15Impl(context.getModel(), element);
243         }
244     }
245
246     public static class Basic256Sha256Rsa15Factory extends ElementFactory {
247         @Override JavaDoc
248         public Set JavaDoc<QName JavaDoc> getElementQNames() {
249             return Collections.singleton(AlgorithmSuiteQName.BASIC256SHA256RSA15.getQName());
250         }
251         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
252             return type.cast(new Basic256Sha256Rsa15Impl(context.getModel()));
253         }
254         @Override JavaDoc
255         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
256             return new Basic256Sha256Rsa15Impl(context.getModel(), element);
257         }
258     }
259
260     public static class TripleDesSha256Rsa15Factory extends ElementFactory {
261         @Override JavaDoc
262         public Set JavaDoc<QName JavaDoc> getElementQNames() {
263             return Collections.singleton(AlgorithmSuiteQName.TRIPLEDESSHA256RSA15.getQName());
264         }
265         public <C extends WSDLComponent> C create(WSDLComponent context, Class JavaDoc<C> type) {
266             return type.cast(new TripleDesSha256Rsa15Impl(context.getModel()));
267         }
268         @Override JavaDoc
269         public WSDLComponent create(WSDLComponent context, Element JavaDoc element) {
270             return new TripleDesSha256Rsa15Impl(context.getModel(), element);
271         }
272     }
273 }
274
Popular Tags