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