1 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 ; 26 27 import javax.xml.namespace.QName ; 28 import java.util.Collections ; 29 import java.util.Set ; 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 41 public Set <QName > getElementQNames() { 42 return Collections.singleton(ProprietarySecurityPolicyQName.KEYSTORE.getQName()); 43 } 44 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 45 return type.cast(new KeyStoreImpl(context.getModel())); 46 } 47 @Override 48 public WSDLComponent create(WSDLComponent context, Element element) { 49 return new KeyStoreImpl(context.getModel(), element); 50 } 51 } 52 53 public static class ValidatorConfigurationFactory extends ElementFactory { 54 @Override 55 public Set <QName > getElementQNames() { 56 return Collections.singleton(ProprietarySecurityPolicyQName.VALIDATORCONFIGURATION.getQName()); 57 } 58 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 59 return type.cast(new ValidatorConfigurationImpl(context.getModel())); 60 } 61 @Override 62 public WSDLComponent create(WSDLComponent context, Element element) { 63 return new ValidatorConfigurationImpl(context.getModel(), element); 64 } 65 } 66 67 public static class ValidatorFactory extends ElementFactory { 68 @Override 69 public Set <QName > getElementQNames() { 70 return Collections.singleton(ProprietarySecurityPolicyQName.VALIDATOR.getQName()); 71 } 72 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 73 return type.cast(new ValidatorImpl(context.getModel())); 74 } 75 @Override 76 public WSDLComponent create(WSDLComponent context, Element element) { 77 return new ValidatorImpl(context.getModel(), element); 78 } 79 } 80 81 public static class TimestampFactory extends ElementFactory { 82 @Override 83 public Set <QName > getElementQNames() { 84 return Collections.singleton(ProprietarySecurityPolicyQName.TIMESTAMP.getQName()); 85 } 86 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 87 return type.cast(new TimestampImpl(context.getModel())); 88 } 89 @Override 90 public WSDLComponent create(WSDLComponent context, Element element) { 91 return new TimestampImpl(context.getModel(), element); 92 } 93 } 94 95 public static class TrustStoreFactory extends ElementFactory { 96 @Override 97 public Set <QName > getElementQNames() { 98 return Collections.singleton(ProprietarySecurityPolicyQName.TRUSTSTORE.getQName()); 99 } 100 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 101 return type.cast(new TrustStoreImpl(context.getModel())); 102 } 103 @Override 104 public WSDLComponent create(WSDLComponent context, Element element) { 105 return new TrustStoreImpl(context.getModel(), element); 106 } 107 } 108 109 public static class CallbackHandlerFactory extends ElementFactory { 110 @Override 111 public Set <QName > getElementQNames() { 112 return Collections.singleton(ProprietarySecurityPolicyQName.CALLBACKHANDLER.getQName()); 113 } 114 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 115 return type.cast(new CallbackHandlerImpl(context.getModel())); 116 } 117 @Override 118 public WSDLComponent create(WSDLComponent context, Element element) { 119 return new CallbackHandlerImpl(context.getModel(), element); 120 } 121 } 122 123 public static class CallbackHandlerConfigurationFactory extends ElementFactory { 124 @Override 125 public Set <QName > getElementQNames() { 126 return Collections.singleton(ProprietarySecurityPolicyQName.CALLBACKHANDLERCONFIGURATION.getQName()); 127 } 128 public <C extends WSDLComponent> C create(WSDLComponent context, Class <C> type) { 129 return type.cast(new CallbackHandlerConfigurationImpl(context.getModel())); 130 } 131 @Override 132 public WSDLComponent create(WSDLComponent context, Element element) { 133 return new CallbackHandlerConfigurationImpl(context.getModel(), element); 134 } 135 } 136 137 } 138 | Popular Tags |