Author: heiko.braun(a)jboss.com
Date: 2006-12-14 10:23:08 -0500 (Thu, 14 Dec 2006)
New Revision: 1652
Added:
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
Removed:
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java
Modified:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
Log:
Refactor WSSE config factory
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-14
14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-14
15:23:08 UTC (rev 1652)
@@ -42,7 +42,7 @@
import org.jboss.ws.metadata.j2ee.UnifiedServiceRefMetaData;
import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
+import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
/**
* A JNDI reference to a javax.xml.rpc.Service
@@ -156,7 +156,7 @@
{
ObjectOutputStream oos = new ObjectOutputStream(baos);
URL securityURL = getSecurityConfigURL();
- WSSecurityConfiguration securityConfig =
WSSecurityConfigurationFactory.newInstance().parse(securityURL);
+ WSSecurityConfiguration securityConfig =
WSSecurityOMFactory.newInstance().parse(securityURL);
oos.writeObject(securityConfig);
oos.close();
}
@@ -171,7 +171,7 @@
{
ClassLoader ctxClassLoader = refMetaData.getResourceCL();
String descriptorLoc = udi.metaData instanceof UnifiedWebMetaData ?
"WEB-INF" : "META-INF";
- URL securityURL = ctxClassLoader.getResource(descriptorLoc + "/" +
WSSecurityConfigurationFactory.CLIENT_RESOURCE_NAME);
+ URL securityURL = ctxClassLoader.getResource(descriptorLoc + "/" +
WSSecurityOMFactory.CLIENT_RESOURCE_NAME);
return securityURL;
}
}
\ No newline at end of file
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-14
14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-14
15:23:08 UTC (rev 1652)
@@ -37,8 +37,6 @@
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.wsdl.*;
-import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
import org.w3c.dom.Element;
import javax.management.ObjectName;
@@ -69,44 +67,6 @@
// provide logging
private final static Logger log = Logger.getLogger(MetaDataBuilder.class);
- public static WSSecurityConfiguration getWsSecurityConfiguration(UnifiedDeploymentInfo
udi) throws IOException
- {
- WSSecurityConfiguration config = null;
-
- String resource = WSSecurityConfigurationFactory.SERVER_RESOURCE_NAME;
- if (udi.metaData instanceof UnifiedWebMetaData)
- {
- resource = "WEB-INF/" + resource;
- }
- else
- {
- resource = "META-INF/" + resource;
- }
-
- URL location = udi.classLoader.getResource(resource);
- if (location != null)
- {
- config = WSSecurityConfigurationFactory.newInstance().parse(location);
-
- // Get and set deployment path to the keystore file
- if (config.getKeyStoreFile() != null)
- {
- location = udi.classLoader.getResource(config.getKeyStoreFile());
- if (location != null)
- config.setKeyStoreURL(location);
- }
-
- if (config.getTrustStoreFile() != null)
- {
- location = udi.classLoader.getResource(config.getTrustStoreFile());
- if (location != null)
- config.setTrustStoreURL(location);
- }
- }
-
- return config;
- }
-
/** Inititialize the endpoint binding */
protected void initEndpointBinding(WSDLEndpoint wsdlEndpoint, ClientEndpointMetaData
epMetaData)
{
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-14
14:58:46 UTC (rev 1651)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCClientMetaDataBuilder.java 2006-12-14
15:23:08 UTC (rev 1652)
@@ -49,7 +49,7 @@
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.metadata.wsse.WSSecurityConfigurationFactory;
+import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
/**
* A client side meta data builder.
@@ -79,7 +79,7 @@
WSSecurityConfiguration securityConfig = null;
if (securityURL != null)
{
- securityConfig =
WSSecurityConfigurationFactory.newInstance().parse(securityURL);
+ securityConfig = WSSecurityOMFactory.newInstance().parse(securityURL);
}
return buildMetaData(serviceQName, wsdlURL, javaWsdlMapping, securityConfig,
serviceRefMetaData, loader);
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-14
14:58:46 UTC (rev 1651)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCServerMetaDataBuilder.java 2006-12-14
15:23:08 UTC (rev 1652)
@@ -22,34 +22,30 @@
// $Id$
package org.jboss.ws.metadata.builder.jaxrpc;
-import java.net.URL;
-import java.util.Set;
-
-import javax.management.ObjectName;
-import javax.xml.namespace.QName;
-
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
import org.jboss.ws.metadata.config.jaxrpc.EndpointConfigJAXRPC;
-import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
+import org.jboss.ws.metadata.j2ee.*;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.ServiceEndpointInterfaceMapping;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.webservices.PortComponentMetaData;
import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLService;
+import org.jboss.ws.metadata.wsse.WSSecurityConfigFactory;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import java.net.URL;
+import java.util.Set;
+
/**
* A server side meta data builder that is based on webservices.xml.
*
@@ -84,7 +80,7 @@
// Set wsdl location
String wsdlFile = wsdMetaData.getWsdlFile();
URL wsdlLocation = udi.getMetaDataFile(wsdlFile);
-
+
// Unmarshall the WSDL
serviceMetaData.setWsdlLocation(wsdlLocation);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
@@ -100,7 +96,8 @@
setupTypesMetaData(serviceMetaData);
// Assign the WS-Security configuration,
- WSSecurityConfiguration securityConfiguration =
getWsSecurityConfiguration(udi);
+ WSSecurityConfigFactory wsseConfFactory =
WSSecurityConfigFactory.newInstance();
+ WSSecurityConfiguration securityConfiguration =
wsseConfFactory.createConfiguration(udi);
serviceMetaData.setSecurityConfiguration(securityConfiguration);
// For every port-component build the EndpointMetaData
Modified:
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-14
14:58:46 UTC (rev 1651)
+++
trunk/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2006-12-14
15:23:08 UTC (rev 1652)
@@ -23,41 +23,8 @@
// $Id$
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Writer;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import javax.jws.HandlerChain;
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPMessageHandlers;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-import javax.management.ObjectName;
-import javax.xml.bind.JAXBException;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.ws.BindingType;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-import javax.xml.ws.WebFault;
-import javax.xml.ws.addressing.AddressingProperties;
-
+import com.sun.xml.bind.api.JAXBRIContext;
+import com.sun.xml.bind.api.TypeReference;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
@@ -74,25 +41,16 @@
import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
import org.jboss.ws.metadata.acessor.JAXBAccessor;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
-import org.jboss.ws.metadata.config.jaxws.EndpointConfigJAXWS;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
import org.jboss.ws.metadata.jsr181.HandlerChainsMetaData;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.FaultMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.TypeMappingMetaData;
-import org.jboss.ws.metadata.umdm.TypesMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.ws.metadata.umdm.WrappedParameter;
+import org.jboss.ws.metadata.umdm.*;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.metadata.wsse.WSSecurityConfigFactory;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
import org.jboss.ws.tools.jaxws.WSDLGenerator;
@@ -102,8 +60,34 @@
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
-import com.sun.xml.bind.api.JAXBRIContext;
-import com.sun.xml.bind.api.TypeReference;
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.jws.soap.SOAPMessageHandlers;
+import javax.management.ObjectName;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+import javax.xml.ws.WebFault;
+import javax.xml.ws.addressing.AddressingProperties;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Writer;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
/** An abstract annotation meta data builder.
*
@@ -981,7 +965,8 @@
sepMetaData.setLinkName(linkName);
// Assign the WS-Security configuration,
- WSSecurityConfiguration securityConfiguration =
MetaDataBuilder.getWsSecurityConfiguration(udi);
+ WSSecurityConfigFactory wsseConfFactory =
WSSecurityConfigFactory.newInstance();
+ WSSecurityConfiguration securityConfiguration =
wsseConfFactory.createConfiguration(udi);
serviceMetaData.setSecurityConfiguration(securityConfiguration);
sepMetaData.setServiceEndpointImplName(sepClass.getName());
@@ -1027,7 +1012,7 @@
if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) ||
wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no
replacement.");
- // process configuration, this will as well setup the handler
+ // setup handler chain from config
sepMetaData.processEndpointConfig();
// Process an optional @HandlerChain annotation
@@ -1040,7 +1025,6 @@
processHandlerChain(sepMetaData, wsClass);
}
-
// init service endpoint id
ObjectName sepID = MetaDataBuilder.getServiceEndpointID(udi, sepMetaData);
sepMetaData.setServiceEndpointID(sepID);
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-14
14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2006-12-14
15:23:08 UTC (rev 1652)
@@ -97,6 +97,9 @@
}
public void processEndpointConfig() {
+
+ log.debug("Process endpoint config");
+
// rebuild handler from config
clearHandlers();
ClientConfigJAXWS jaxwsConfig = (ClientConfigJAXWS)getEndpointConfig();
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-14
14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2006-12-14
15:23:08 UTC (rev 1652)
@@ -157,6 +157,11 @@
public abstract Object getEndpointConfig();
+ /**
+ * Processing the endpoint configuration will
+ * reset parts of the meta data model and update it according to
+ * the configuration given.
+ */
public abstract void processEndpointConfig();
public String getEndpointAddress()
Modified: trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-14
14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2006-12-14
15:23:08 UTC (rev 1652)
@@ -255,6 +255,8 @@
*/
public void processEndpointConfig()
{
+ log.debug("Process endpoint config");
+
// update handler configuration
List<HandlerMetaData> sepHandlers =
getHandlerMetaData(HandlerType.ENDPOINT);
clearHandlers();
Added: trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java 2006-12-14
14:58:46 UTC (rev 1651)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigFactory.java 2006-12-14
15:23:08 UTC (rev 1652)
@@ -0,0 +1,61 @@
+package org.jboss.ws.metadata.wsse;
+
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
+
+import java.io.IOException;
+import java.net.URL;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: hbraun
+ * Date: 14.12.2006
+ * Time: 16:17:02
+ * To change this template use File | Settings | File Templates.
+ */
+public class WSSecurityConfigFactory {
+
+ public static WSSecurityConfigFactory newInstance()
+ {
+ return new WSSecurityConfigFactory();
+ }
+
+ public WSSecurityConfiguration createConfiguration(UnifiedDeploymentInfo udi) throws
IOException
+ {
+ WSSecurityConfiguration config = null;
+
+ String resource = WSSecurityOMFactory.SERVER_RESOURCE_NAME;
+ if (udi.metaData instanceof UnifiedWebMetaData)
+ {
+ resource = "WEB-INF/" + resource;
+ }
+ else
+ {
+ resource = "META-INF/" + resource;
+ }
+
+ URL location = udi.classLoader.getResource(resource);
+ if (location != null)
+ {
+ config = WSSecurityOMFactory.newInstance().parse(location);
+
+ // Get and set deployment path to the keystore file
+ if (config.getKeyStoreFile() != null)
+ {
+ location = udi.classLoader.getResource(config.getKeyStoreFile());
+ if (location != null)
+ config.setKeyStoreURL(location);
+ }
+
+ if (config.getTrustStoreFile() != null)
+ {
+ location = udi.classLoader.getResource(config.getTrustStoreFile());
+ if (location != null)
+ config.setTrustStoreURL(location);
+ }
+ }
+
+ return config;
+ }
+
+}
Deleted:
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-14
14:58:46 UTC (rev 1651)
+++
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-14
15:23:08 UTC (rev 1652)
@@ -1,460 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.ws.metadata.wsse;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-
-import org.jboss.logging.Logger;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.SimpleTypeBindings;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-/**
- * A JBossXB Object Model Factory that represets a JBoss WS-Security
- * configuration. See the jboss-ws-security_1_0.xsd file for more info.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
- * @version $Revision$
- */
-public class WSSecurityConfigurationFactory implements ObjectModelFactory
-{
-
- public static String SERVER_RESOURCE_NAME = "jboss-wsse-server.xml";
-
- public static String CLIENT_RESOURCE_NAME = "jboss-wsse-client.xml";
-
- private static HashMap options = new HashMap(6);
-
- static
- {
- options.put("key-store-file", "setKeyStoreFile");
- options.put("key-store-type", "setKeyStoreType");
- options.put("key-store-password", "setKeyStorePassword");
- options.put("trust-store-file", "setTrustStoreFile");
- options.put("trust-store-type", "setTrustStoreType");
- options.put("trust-store-password", "setTrustStorePassword");
- }
-
- // provide logging
- private static final Logger log =
Logger.getLogger(WSSecurityConfigurationFactory.class);
-
- // Hide constructor
- private WSSecurityConfigurationFactory()
- {
- }
-
- /**
- * Create a new instance of a jaxrpc-mapping factory
- */
- public static WSSecurityConfigurationFactory newInstance()
- {
- return new WSSecurityConfigurationFactory();
- }
-
- /**
- * Factory method for JavaWsdlMapping
- */
- public WSSecurityConfiguration parse(URL configurationFile) throws IOException
- {
- if (configurationFile == null)
- {
- throw new IllegalArgumentException("URL cannot be null");
- }
-
- // setup the XML binding Unmarshaller
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- InputStream is = configurationFile.openStream();
- try
- {
- WSSecurityConfiguration configuration = (WSSecurityConfiguration)
unmarshaller.unmarshal(is, this, null);
- return configuration;
- }
- catch (JBossXBException e)
- {
- IOException ioex = new IOException("Cannot parse: " +
configurationFile);
- Throwable cause = e.getCause();
- if (cause != null)
- ioex.initCause(cause);
- throw ioex;
- }
- finally
- {
- is.close();
- }
- }
-
- /**
- * This method is called on the factory by the object model builder when the
- * parsing starts.
- */
- public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- return new WSSecurityConfiguration();
- }
-
- public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
- {
- return root;
- }
-
- public void setValue(WSSecurityConfiguration configuration, UnmarshallingContext
navigator, String namespaceURI,
- String localName, String value)
- {
- log.trace("setValue: [obj=" + configuration + ",value=" + value
+ "]");
- String method = (String) options.get(localName);
- if (method == null)
- return;
-
- // Dispatch to propper initializer
- try
- {
- WSSecurityConfiguration.class.getMethod(method, new Class[]
{String.class}).invoke(configuration, new Object[]{value});
- }
- catch (Exception e)
- {
- log.error("Could not set option: " + method + " to: " +
value, e);
- }
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(WSSecurityConfiguration configuration, UnmarshallingContext
navigator, String namespaceURI,
- String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("config".equals(localName))
- {
- return new Config();
- }
- if ("port".equals(localName))
- {
- return new Port(attrs.getValue("", "name"));
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WSSecurityConfiguration configuration, Config defaultConfig,
UnmarshallingContext navigator,
- String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + configuration + ",child=" +
defaultConfig + "]");
- configuration.setDefaultConfig(defaultConfig);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(WSSecurityConfiguration configuration, Port port,
UnmarshallingContext navigator, String namespaceURI,
- String localName)
- {
- log.trace("addChild: [obj=" + configuration + ",child=" + port
+ "]");
- configuration.addPort(port);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Config config, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("sign".equals(localName))
- {
- // By default, we alwyas include a timestamp
- Boolean include = new Boolean(true);
- String timestamp = attrs.getValue("", "includeTimestamp");
- if (timestamp != null)
- include = (Boolean) SimpleTypeBindings.unmarshal(timestamp,
SimpleTypeBindings.XS_BOOLEAN_NAME, null);
-
- return new Sign(attrs.getValue("", "type"),
attrs.getValue("", "alias"), include.booleanValue());
- }
- else if ("encrypt".equals(localName))
- {
- return new Encrypt(attrs.getValue("", "type"),
attrs.getValue("", "alias"), attrs.getValue("",
"algorithm"));
- }
- else if ("timestamp".equals(localName))
- {
- return new Timestamp(attrs.getValue("", "ttl"));
- }
- else if ("requires".equals(localName))
- {
- return new Requires();
- }
- else if ("username".equals(localName))
- {
- return new Username();
- }
-
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Encrypt encrypt, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + encrypt +
"]");
- config.setEncrypt(encrypt);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Sign sign, UnmarshallingContext navigator, String
namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + sign +
"]");
- config.setSign(sign);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Timestamp timestamp, UnmarshallingContext
navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + timestamp +
"]");
- config.setTimestamp(timestamp);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Username username, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + username +
"]");
- config.setUsername(username);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Config config, Requires requires, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + config + ",child=" + requires +
"]");
- config.setRequires(requires);
- }
-
-
- private Object handleTargets(Object object, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("target".equals(localName))
- {
- Target target = new Target(attrs.getValue("", "type"));
- if ("true".equals(attrs.getValue("",
"contentOnly")))
- target.setContentOnly(true);
-
- return target;
- }
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Encrypt encrypt, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(encrypt, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Sign sign, UnmarshallingContext navigator, String namespaceURI,
String localName, Attributes attrs)
- {
- return handleTargets(sign, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Requires requires, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("signature".equals(localName))
- {
- return new RequireSignature();
- }
- else if ("encryption".equals(localName))
- {
- return new RequireEncryption();
- }
- else if ("timestamp".equals(localName))
- {
- return new RequireTimestamp(attrs.getValue("", "maxAge"));
- }
-
- return null;
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(RequireSignature requireSignature, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(requireSignature, navigator, namespaceURI, localName, attrs);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(RequireEncryption requireEncryption, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
- {
- return handleTargets(requireEncryption, navigator, namespaceURI, localName,
attrs);
- }
-
- public void setValue(Target target, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
- {
- log.trace("setValue: [obj=" + target + ",value=" + value +
"]");
-
- target.setValue(value);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Encrypt encrypt, Target target, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + encrypt + ",child=" + target +
"]");
- encrypt.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Sign sign, Target target, UnmarshallingContext navigator, String
namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + sign + ",child=" + target +
"]");
- sign.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireEncryption requireEncryption,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" +
requireEncryption + "]");
- requires.setRequireEncryption(requireEncryption);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireSignature requireSignature,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" +
requireSignature + "]");
- requires.setRequireSignature(requireSignature);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Requires requires, RequireTimestamp requireTimestamp,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requires + ",child=" +
requireTimestamp + "]");
- requires.setRequireTimestamp(requireTimestamp);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(RequireEncryption requireEncryption, Target target,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requireEncryption + ",child=" +
target + "]");
- requireEncryption.addTarget(target);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(RequireSignature requireSignature, Target target,
UnmarshallingContext navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + requireSignature + ",child=" +
target + "]");
- requireSignature.addTarget(target);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Port port, UnmarshallingContext navigator, String namespaceURI,
String localName, Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("operation".equals(localName))
- {
- return new Operation(attrs.getValue("", "name"));
- }
- else if ("config".equals(localName))
- {
- return new Config();
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Port port, Operation operation, UnmarshallingContext navigator,
String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + port + ",child=" + operation +
"]");
- port.addOperation(operation);
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Port port, Config config, UnmarshallingContext navigator, String
namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + port + ",child=" + config +
"]");
- port.setDefaultConfig(config);
- }
-
- /**
- * Called when parsing of a new element started.
- */
- public Object newChild(Operation operation, UnmarshallingContext navigator, String
namespaceURI, String localName,
- Attributes attrs)
- {
- log.trace("newChild: " + localName);
- if ("config".equals(localName))
- {
- return new Config();
- }
- return null;
- }
-
- /**
- * Called when parsing character is complete.
- */
- public void addChild(Operation operation, Config config, UnmarshallingContext
navigator, String namespaceURI, String localName)
- {
- log.trace("addChild: [obj=" + operation + ",child=" + config +
"]");
- operation.setConfig(config);
- }
-}
Copied: trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java (from rev
1640, trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java)
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityConfigurationFactory.java 2006-12-14
01:38:28 UTC (rev 1640)
+++ trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java 2006-12-14
15:23:08 UTC (rev 1652)
@@ -0,0 +1,460 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.ws.metadata.wsse;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+
+import org.jboss.logging.Logger;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.SimpleTypeBindings;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * A JBossXB Object Model Factory that represets a JBoss WS-Security
+ * configuration. See the jboss-ws-security_1_0.xsd file for more info.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T.
Greene</a>
+ * @version $Revision$
+ */
+public class WSSecurityOMFactory implements ObjectModelFactory
+{
+
+ public static String SERVER_RESOURCE_NAME = "jboss-wsse-server.xml";
+
+ public static String CLIENT_RESOURCE_NAME = "jboss-wsse-client.xml";
+
+ private static HashMap options = new HashMap(6);
+
+ static
+ {
+ options.put("key-store-file", "setKeyStoreFile");
+ options.put("key-store-type", "setKeyStoreType");
+ options.put("key-store-password", "setKeyStorePassword");
+ options.put("trust-store-file", "setTrustStoreFile");
+ options.put("trust-store-type", "setTrustStoreType");
+ options.put("trust-store-password", "setTrustStorePassword");
+ }
+
+ // provide logging
+ private static final Logger log = Logger.getLogger(WSSecurityOMFactory.class);
+
+ // Hide constructor
+ private WSSecurityOMFactory()
+ {
+ }
+
+ /**
+ * Create a new instance of a jaxrpc-mapping factory
+ */
+ public static WSSecurityOMFactory newInstance()
+ {
+ return new WSSecurityOMFactory();
+ }
+
+ /**
+ * Factory method for JavaWsdlMapping
+ */
+ public WSSecurityConfiguration parse(URL configurationFile) throws IOException
+ {
+ if (configurationFile == null)
+ {
+ throw new IllegalArgumentException("URL cannot be null");
+ }
+
+ // setup the XML binding Unmarshaller
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ InputStream is = configurationFile.openStream();
+ try
+ {
+ WSSecurityConfiguration configuration = (WSSecurityConfiguration)
unmarshaller.unmarshal(is, this, null);
+ return configuration;
+ }
+ catch (JBossXBException e)
+ {
+ IOException ioex = new IOException("Cannot parse: " +
configurationFile);
+ Throwable cause = e.getCause();
+ if (cause != null)
+ ioex.initCause(cause);
+ throw ioex;
+ }
+ finally
+ {
+ is.close();
+ }
+ }
+
+ /**
+ * This method is called on the factory by the object model builder when the
+ * parsing starts.
+ */
+ public Object newRoot(Object root, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ return new WSSecurityConfiguration();
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext ctx, String uri, String
name)
+ {
+ return root;
+ }
+
+ public void setValue(WSSecurityConfiguration configuration, UnmarshallingContext
navigator, String namespaceURI,
+ String localName, String value)
+ {
+ log.trace("setValue: [obj=" + configuration + ",value=" + value
+ "]");
+ String method = (String) options.get(localName);
+ if (method == null)
+ return;
+
+ // Dispatch to propper initializer
+ try
+ {
+ WSSecurityConfiguration.class.getMethod(method, new Class[]
{String.class}).invoke(configuration, new Object[]{value});
+ }
+ catch (Exception e)
+ {
+ log.error("Could not set option: " + method + " to: " +
value, e);
+ }
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(WSSecurityConfiguration configuration, UnmarshallingContext
navigator, String namespaceURI,
+ String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("config".equals(localName))
+ {
+ return new Config();
+ }
+ if ("port".equals(localName))
+ {
+ return new Port(attrs.getValue("", "name"));
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(WSSecurityConfiguration configuration, Config defaultConfig,
UnmarshallingContext navigator,
+ String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + configuration + ",child=" +
defaultConfig + "]");
+ configuration.setDefaultConfig(defaultConfig);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(WSSecurityConfiguration configuration, Port port,
UnmarshallingContext navigator, String namespaceURI,
+ String localName)
+ {
+ log.trace("addChild: [obj=" + configuration + ",child=" + port
+ "]");
+ configuration.addPort(port);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Config config, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("sign".equals(localName))
+ {
+ // By default, we alwyas include a timestamp
+ Boolean include = new Boolean(true);
+ String timestamp = attrs.getValue("", "includeTimestamp");
+ if (timestamp != null)
+ include = (Boolean) SimpleTypeBindings.unmarshal(timestamp,
SimpleTypeBindings.XS_BOOLEAN_NAME, null);
+
+ return new Sign(attrs.getValue("", "type"),
attrs.getValue("", "alias"), include.booleanValue());
+ }
+ else if ("encrypt".equals(localName))
+ {
+ return new Encrypt(attrs.getValue("", "type"),
attrs.getValue("", "alias"), attrs.getValue("",
"algorithm"));
+ }
+ else if ("timestamp".equals(localName))
+ {
+ return new Timestamp(attrs.getValue("", "ttl"));
+ }
+ else if ("requires".equals(localName))
+ {
+ return new Requires();
+ }
+ else if ("username".equals(localName))
+ {
+ return new Username();
+ }
+
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Encrypt encrypt, UnmarshallingContext navigator,
String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + encrypt +
"]");
+ config.setEncrypt(encrypt);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Sign sign, UnmarshallingContext navigator, String
namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + sign +
"]");
+ config.setSign(sign);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Timestamp timestamp, UnmarshallingContext
navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + timestamp +
"]");
+ config.setTimestamp(timestamp);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Username username, UnmarshallingContext navigator,
String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + username +
"]");
+ config.setUsername(username);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Config config, Requires requires, UnmarshallingContext navigator,
String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + config + ",child=" + requires +
"]");
+ config.setRequires(requires);
+ }
+
+
+ private Object handleTargets(Object object, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("target".equals(localName))
+ {
+ Target target = new Target(attrs.getValue("", "type"));
+ if ("true".equals(attrs.getValue("",
"contentOnly")))
+ target.setContentOnly(true);
+
+ return target;
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Encrypt encrypt, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ return handleTargets(encrypt, navigator, namespaceURI, localName, attrs);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Sign sign, UnmarshallingContext navigator, String namespaceURI,
String localName, Attributes attrs)
+ {
+ return handleTargets(sign, navigator, namespaceURI, localName, attrs);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Requires requires, UnmarshallingContext navigator, String
namespaceURI, String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("signature".equals(localName))
+ {
+ return new RequireSignature();
+ }
+ else if ("encryption".equals(localName))
+ {
+ return new RequireEncryption();
+ }
+ else if ("timestamp".equals(localName))
+ {
+ return new RequireTimestamp(attrs.getValue("", "maxAge"));
+ }
+
+ return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(RequireSignature requireSignature, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return handleTargets(requireSignature, navigator, namespaceURI, localName, attrs);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(RequireEncryption requireEncryption, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ return handleTargets(requireEncryption, navigator, namespaceURI, localName,
attrs);
+ }
+
+ public void setValue(Target target, UnmarshallingContext navigator, String
namespaceURI, String localName, String value)
+ {
+ log.trace("setValue: [obj=" + target + ",value=" + value +
"]");
+
+ target.setValue(value);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Encrypt encrypt, Target target, UnmarshallingContext navigator,
String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + encrypt + ",child=" + target +
"]");
+ encrypt.addTarget(target);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Sign sign, Target target, UnmarshallingContext navigator, String
namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + sign + ",child=" + target +
"]");
+ sign.addTarget(target);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Requires requires, RequireEncryption requireEncryption,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requires + ",child=" +
requireEncryption + "]");
+ requires.setRequireEncryption(requireEncryption);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Requires requires, RequireSignature requireSignature,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requires + ",child=" +
requireSignature + "]");
+ requires.setRequireSignature(requireSignature);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Requires requires, RequireTimestamp requireTimestamp,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requires + ",child=" +
requireTimestamp + "]");
+ requires.setRequireTimestamp(requireTimestamp);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(RequireEncryption requireEncryption, Target target,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requireEncryption + ",child=" +
target + "]");
+ requireEncryption.addTarget(target);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(RequireSignature requireSignature, Target target,
UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + requireSignature + ",child=" +
target + "]");
+ requireSignature.addTarget(target);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Port port, UnmarshallingContext navigator, String namespaceURI,
String localName, Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("operation".equals(localName))
+ {
+ return new Operation(attrs.getValue("", "name"));
+ }
+ else if ("config".equals(localName))
+ {
+ return new Config();
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Port port, Operation operation, UnmarshallingContext navigator,
String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + port + ",child=" + operation +
"]");
+ port.addOperation(operation);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Port port, Config config, UnmarshallingContext navigator, String
namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + port + ",child=" + config +
"]");
+ port.setDefaultConfig(config);
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(Operation operation, UnmarshallingContext navigator, String
namespaceURI, String localName,
+ Attributes attrs)
+ {
+ log.trace("newChild: " + localName);
+ if ("config".equals(localName))
+ {
+ return new Config();
+ }
+ return null;
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(Operation operation, Config config, UnmarshallingContext
navigator, String namespaceURI, String localName)
+ {
+ log.trace("addChild: [obj=" + operation + ",child=" + config +
"]");
+ operation.setConfig(config);
+ }
+}
Property changes on:
trunk/src/main/java/org/jboss/ws/metadata/wsse/WSSecurityOMFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF