001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.websvc.wsitmodelext.security.algosuite;
043:
044: import org.netbeans.modules.websvc.wsitmodelext.security.algosuite.impl.*;
045: import org.netbeans.modules.xml.wsdl.model.WSDLComponent;
046: import org.netbeans.modules.xml.wsdl.model.spi.ElementFactory;
047: import org.w3c.dom.Element;
048:
049: import javax.xml.namespace.QName;
050: import java.util.Collections;
051: import java.util.Set;
052:
053: public class AlgorithmSuiteFactories {
054:
055: public static class AlgorithmSuiteFactory extends ElementFactory {
056: @Override
057: public Set<QName> getElementQNames() {
058: return Collections
059: .singleton(AlgorithmSuiteQName.ALGORITHMSUITE
060: .getQName());
061: }
062:
063: public <C extends WSDLComponent> C create(
064: WSDLComponent context, Class<C> type) {
065: return type
066: .cast(new AlgorithmSuiteImpl(context.getModel()));
067: }
068:
069: @Override
070: public WSDLComponent create(WSDLComponent context,
071: Element element) {
072: return new AlgorithmSuiteImpl(context.getModel(), element);
073: }
074: }
075:
076: public static class Basic128Factory extends ElementFactory {
077: @Override
078: public Set<QName> getElementQNames() {
079: return Collections.singleton(AlgorithmSuiteQName.BASIC128
080: .getQName());
081: }
082:
083: public <C extends WSDLComponent> C create(
084: WSDLComponent context, Class<C> type) {
085: return type.cast(new Basic128Impl(context.getModel()));
086: }
087:
088: @Override
089: public WSDLComponent create(WSDLComponent context,
090: Element element) {
091: return new Basic128Impl(context.getModel(), element);
092: }
093: }
094:
095: public static class Basic192Factory extends ElementFactory {
096: @Override
097: public Set<QName> getElementQNames() {
098: return Collections.singleton(AlgorithmSuiteQName.BASIC192
099: .getQName());
100: }
101:
102: public <C extends WSDLComponent> C create(
103: WSDLComponent context, Class<C> type) {
104: return type.cast(new Basic192Impl(context.getModel()));
105: }
106:
107: @Override
108: public WSDLComponent create(WSDLComponent context,
109: Element element) {
110: return new Basic192Impl(context.getModel(), element);
111: }
112: }
113:
114: public static class Basic256Factory extends ElementFactory {
115: @Override
116: public Set<QName> getElementQNames() {
117: return Collections.singleton(AlgorithmSuiteQName.BASIC256
118: .getQName());
119: }
120:
121: public <C extends WSDLComponent> C create(
122: WSDLComponent context, Class<C> type) {
123: return type.cast(new Basic256Impl(context.getModel()));
124: }
125:
126: @Override
127: public WSDLComponent create(WSDLComponent context,
128: Element element) {
129: return new Basic256Impl(context.getModel(), element);
130: }
131: }
132:
133: public static class TripleDesFactory extends ElementFactory {
134: @Override
135: public Set<QName> getElementQNames() {
136: return Collections.singleton(AlgorithmSuiteQName.TRIPLEDES
137: .getQName());
138: }
139:
140: public <C extends WSDLComponent> C create(
141: WSDLComponent context, Class<C> type) {
142: return type.cast(new TripleDesImpl(context.getModel()));
143: }
144:
145: @Override
146: public WSDLComponent create(WSDLComponent context,
147: Element element) {
148: return new TripleDesImpl(context.getModel(), element);
149: }
150: }
151:
152: /* rsa15 */
153: public static class Basic128Rsa15Factory extends ElementFactory {
154: @Override
155: public Set<QName> getElementQNames() {
156: return Collections
157: .singleton(AlgorithmSuiteQName.BASIC128RSA15
158: .getQName());
159: }
160:
161: public <C extends WSDLComponent> C create(
162: WSDLComponent context, Class<C> type) {
163: return type.cast(new Basic128Rsa15Impl(context.getModel()));
164: }
165:
166: @Override
167: public WSDLComponent create(WSDLComponent context,
168: Element element) {
169: return new Basic128Rsa15Impl(context.getModel(), element);
170: }
171: }
172:
173: public static class Basic192Rsa15Factory extends ElementFactory {
174: @Override
175: public Set<QName> getElementQNames() {
176: return Collections
177: .singleton(AlgorithmSuiteQName.BASIC192RSA15
178: .getQName());
179: }
180:
181: public <C extends WSDLComponent> C create(
182: WSDLComponent context, Class<C> type) {
183: return type.cast(new Basic192Rsa15Impl(context.getModel()));
184: }
185:
186: @Override
187: public WSDLComponent create(WSDLComponent context,
188: Element element) {
189: return new Basic192Rsa15Impl(context.getModel(), element);
190: }
191: }
192:
193: public static class Basic256Rsa15Factory extends ElementFactory {
194: @Override
195: public Set<QName> getElementQNames() {
196: return Collections
197: .singleton(AlgorithmSuiteQName.BASIC256RSA15
198: .getQName());
199: }
200:
201: public <C extends WSDLComponent> C create(
202: WSDLComponent context, Class<C> type) {
203: return type.cast(new Basic256Rsa15Impl(context.getModel()));
204: }
205:
206: @Override
207: public WSDLComponent create(WSDLComponent context,
208: Element element) {
209: return new Basic256Rsa15Impl(context.getModel(), element);
210: }
211: }
212:
213: public static class TripleDesRsa15Factory extends ElementFactory {
214: @Override
215: public Set<QName> getElementQNames() {
216: return Collections
217: .singleton(AlgorithmSuiteQName.TRIPLEDESRSA15
218: .getQName());
219: }
220:
221: public <C extends WSDLComponent> C create(
222: WSDLComponent context, Class<C> type) {
223: return type
224: .cast(new TripleDesRsa15Impl(context.getModel()));
225: }
226:
227: @Override
228: public WSDLComponent create(WSDLComponent context,
229: Element element) {
230: return new TripleDesRsa15Impl(context.getModel(), element);
231: }
232: }
233:
234: /* sha256 */
235: public static class Basic128Sha256Factory extends ElementFactory {
236: @Override
237: public Set<QName> getElementQNames() {
238: return Collections
239: .singleton(AlgorithmSuiteQName.BASIC128SHA256
240: .getQName());
241: }
242:
243: public <C extends WSDLComponent> C create(
244: WSDLComponent context, Class<C> type) {
245: return type
246: .cast(new Basic128Sha256Impl(context.getModel()));
247: }
248:
249: @Override
250: public WSDLComponent create(WSDLComponent context,
251: Element element) {
252: return new Basic128Sha256Impl(context.getModel(), element);
253: }
254: }
255:
256: public static class Basic192Sha256Factory extends ElementFactory {
257: @Override
258: public Set<QName> getElementQNames() {
259: return Collections
260: .singleton(AlgorithmSuiteQName.BASIC192SHA256
261: .getQName());
262: }
263:
264: public <C extends WSDLComponent> C create(
265: WSDLComponent context, Class<C> type) {
266: return type
267: .cast(new Basic192Sha256Impl(context.getModel()));
268: }
269:
270: @Override
271: public WSDLComponent create(WSDLComponent context,
272: Element element) {
273: return new Basic192Sha256Impl(context.getModel(), element);
274: }
275: }
276:
277: public static class Basic256Sha256Factory extends ElementFactory {
278: @Override
279: public Set<QName> getElementQNames() {
280: return Collections
281: .singleton(AlgorithmSuiteQName.BASIC256SHA256
282: .getQName());
283: }
284:
285: public <C extends WSDLComponent> C create(
286: WSDLComponent context, Class<C> type) {
287: return type
288: .cast(new Basic256Sha256Impl(context.getModel()));
289: }
290:
291: @Override
292: public WSDLComponent create(WSDLComponent context,
293: Element element) {
294: return new Basic256Sha256Impl(context.getModel(), element);
295: }
296: }
297:
298: public static class TripleDesSha256Factory extends ElementFactory {
299: @Override
300: public Set<QName> getElementQNames() {
301: return Collections
302: .singleton(AlgorithmSuiteQName.TRIPLEDESSHA256
303: .getQName());
304: }
305:
306: public <C extends WSDLComponent> C create(
307: WSDLComponent context, Class<C> type) {
308: return type
309: .cast(new TripleDesSha256Impl(context.getModel()));
310: }
311:
312: @Override
313: public WSDLComponent create(WSDLComponent context,
314: Element element) {
315: return new TripleDesSha256Impl(context.getModel(), element);
316: }
317: }
318:
319: /* sha256rsa15 */
320: public static class Basic128Sha256Rsa15Factory extends
321: ElementFactory {
322: @Override
323: public Set<QName> getElementQNames() {
324: return Collections
325: .singleton(AlgorithmSuiteQName.BASIC128SHA256RSA15
326: .getQName());
327: }
328:
329: public <C extends WSDLComponent> C create(
330: WSDLComponent context, Class<C> type) {
331: return type.cast(new Basic128Sha256Rsa15Impl(context
332: .getModel()));
333: }
334:
335: @Override
336: public WSDLComponent create(WSDLComponent context,
337: Element element) {
338: return new Basic128Sha256Rsa15Impl(context.getModel(),
339: element);
340: }
341: }
342:
343: public static class Basic192Sha256Rsa15Factory extends
344: ElementFactory {
345: @Override
346: public Set<QName> getElementQNames() {
347: return Collections
348: .singleton(AlgorithmSuiteQName.BASIC192SHA256RSA15
349: .getQName());
350: }
351:
352: public <C extends WSDLComponent> C create(
353: WSDLComponent context, Class<C> type) {
354: return type.cast(new Basic192Sha256Rsa15Impl(context
355: .getModel()));
356: }
357:
358: @Override
359: public WSDLComponent create(WSDLComponent context,
360: Element element) {
361: return new Basic192Sha256Rsa15Impl(context.getModel(),
362: element);
363: }
364: }
365:
366: public static class Basic256Sha256Rsa15Factory extends
367: ElementFactory {
368: @Override
369: public Set<QName> getElementQNames() {
370: return Collections
371: .singleton(AlgorithmSuiteQName.BASIC256SHA256RSA15
372: .getQName());
373: }
374:
375: public <C extends WSDLComponent> C create(
376: WSDLComponent context, Class<C> type) {
377: return type.cast(new Basic256Sha256Rsa15Impl(context
378: .getModel()));
379: }
380:
381: @Override
382: public WSDLComponent create(WSDLComponent context,
383: Element element) {
384: return new Basic256Sha256Rsa15Impl(context.getModel(),
385: element);
386: }
387: }
388:
389: public static class TripleDesSha256Rsa15Factory extends
390: ElementFactory {
391: @Override
392: public Set<QName> getElementQNames() {
393: return Collections
394: .singleton(AlgorithmSuiteQName.TRIPLEDESSHA256RSA15
395: .getQName());
396: }
397:
398: public <C extends WSDLComponent> C create(
399: WSDLComponent context, Class<C> type) {
400: return type.cast(new TripleDesSha256Rsa15Impl(context
401: .getModel()));
402: }
403:
404: @Override
405: public WSDLComponent create(WSDLComponent context,
406: Element element) {
407: return new TripleDesSha256Rsa15Impl(context.getModel(),
408: element);
409: }
410: }
411: }
|