[jboss-svn-commits] JBL Code SVN: r28975 - in labs/jbossesb/workspace/tfennelly/httpg2: product/rosetta/src/org/jboss/internal/soa/esb/listeners/war and 7 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Aug 18 12:15:53 EDT 2009
Author: tfennelly
Date: 2009-08-18 12:15:51 -0400 (Tue, 18 Aug 2009)
New Revision: 28975
Added:
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpGatewayMapper.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods_with_guarantee.xml
Removed:
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpListenerMapper.java
Modified:
labs/jbossesb/workspace/tfennelly/httpg2/product/etc/schemas/xml/jbossesb-1.2.0.xsd
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/HttpGatewayDeploymentFactory.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/SecurityConstraints.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/templates/web.xml.ftl
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/ESBAwareGenerator.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/GatewayGenerator.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/JcaGatewayMapper.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/MapperUtil.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/UntypedListenerMapper.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/XMLBeansModel.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/WebDeploymentArchiveUnitTest.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_method_constraints_no_roles.xml
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods.xml
labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml
labs/jbossesb/workspace/tfennelly/httpg2/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java
labs/jbossesb/workspace/tfennelly/httpg2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HttpGatewayTest.java
Log:
More
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/etc/schemas/xml/jbossesb-1.2.0.xsd
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/etc/schemas/xml/jbossesb-1.2.0.xsd 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/etc/schemas/xml/jbossesb-1.2.0.xsd 2009-08-18 16:15:51 UTC (rev 28975)
@@ -511,28 +511,53 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
- <xsd:attribute default="1" name="maxThreads" type="xsd:int"
- use="optional">
- <xsd:annotation>
- <xsd:documentation xml:lang="en">
- The number of threads which will be started for this
- listener.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute default="false" name="is-gateway"
- type="xsd:boolean" use="optional">
- <xsd:annotation>
- <xsd:documentation xml:lang="en">
- true if the listener is a gateway. A gateway is an
- ESB-Unware listener, while a listener is ESB-aware
- and as such expects jbossesb formatted messages.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
</xsd:complexType>
- <xsd:element name="listener" type="jesb:listener" />
+ <xsd:attribute default="1" name="maxThreads" type="xsd:int" id="maxThreads">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ The number of threads which will be started for this
+ listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute default="false" name="is-gateway" type="xsd:boolean" id="is-gateway">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ true if the listener is a gateway. A gateway is an
+ ESB-Unware listener, while a listener is ESB-aware
+ and as such expects jbossesb formatted messages.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+
+ <xsd:complexType abstract="true" name="gateway-only-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Listener type that can only act as a message-unaware (gateway) listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:listener" />
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType abstract="true" name="dual-listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Listener type that can act as both a message-aware and message-unaware (gateway) listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:listener">
+ <xsd:attribute ref="jesb:is-gateway" use="optional" />
+ <xsd:attribute ref="jesb:maxThreads" use="optional" />
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:element name="listener" type="jesb:listener" />
+
<xsd:complexType abstract="true"
name="abstract-scheduled-listener">
<xsd:annotation>
@@ -541,7 +566,7 @@
</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
- <xsd:extension base="jesb:listener">
+ <xsd:extension base="jesb:dual-listener">
<xsd:attribute default="-1"
name="poll-frequency-seconds" type="xsd:int" use="optional">
<!-- Purposely defaults to -1 -->
@@ -633,7 +658,7 @@
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
- <xsd:extension base="jesb:listener">
+ <xsd:extension base="jesb:gateway-only-listener">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0"
ref="jesb:activation-config" />
@@ -890,7 +915,7 @@
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
- <xsd:extension base="jesb:listener">
+ <xsd:extension base="jesb:dual-listener">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0"
ref="jesb:jms-message-filter" />
@@ -1495,7 +1520,7 @@
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
- <xsd:extension base="jesb:listener">
+ <xsd:extension base="jesb:dual-listener">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0"
ref="jesb:sql-message-filter" />
@@ -1598,7 +1623,7 @@
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
- <xsd:extension base="jesb:listener">
+ <xsd:extension base="jesb:dual-listener">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0"
ref="jesb:hibernate-message-filter" />
@@ -1681,7 +1706,7 @@
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
- <xsd:extension base="jesb:listener" />
+ <xsd:extension base="jesb:dual-listener" />
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
@@ -1733,6 +1758,15 @@
</xsd:complexType>
</xsd:element>
</xsd:choice>
+ <xsd:attribute name="transportGuarantee" use="optional">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:NMTOKEN">
+ <xsd:enumeration value="NONE" />
+ <xsd:enumeration value="INTEGRAL" />
+ <xsd:enumeration value="CONFIDENTIAL" />
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
@@ -1771,7 +1805,7 @@
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
- <xsd:element name="http-listener"
+ <xsd:element name="http-gateway"
substitutionGroup="jesb:listener">
<xsd:annotation>
<xsd:documentation xml:lang="en">
@@ -1780,7 +1814,7 @@
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
- <xsd:extension base="jesb:listener">
+ <xsd:extension base="jesb:gateway-only-listener">
<xsd:attribute name="urlPattern" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation xml:lang="en">
@@ -1818,7 +1852,7 @@
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
- <xsd:extension base="jesb:listener">
+ <xsd:extension base="jesb:dual-listener">
<xsd:attribute name="script" type="xsd:string"
use="required">
<xsd:annotation>
@@ -1845,7 +1879,7 @@
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
- <xsd:extension base="jesb:listener">
+ <xsd:extension base="jesb:dual-listener">
<xsd:attribute name="host" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation xml:lang="en">
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/HttpGatewayDeploymentFactory.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/HttpGatewayDeploymentFactory.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/HttpGatewayDeploymentFactory.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -33,6 +33,7 @@
public static final String URL_PATTERN = "urlPattern";
public static final String PROTECTED_METHODS = "protectedMethods";
+ public static final String TRANSPORT_GUARANTEE = "transportGuarantee";
public static final String ALLOWED_ROLES = "allowedRoles";
public static final String AUTH_METHOD = "authMethod";
public static final String AUTH_DOMAIN = "authDomain";
@@ -101,6 +102,11 @@
securityConstraints.getAllowedRoles().add(role.trim());
}
}
+
+ String transportGuarantee = webEndpointConfig.getAttribute(TRANSPORT_GUARANTEE);
+ if(transportGuarantee != null) {
+ getSecurityConstraints(servlet).setTransportGuarantee(transportGuarantee);
+ }
}
private SecurityConstraints getSecurityConstraints(Servlet servlet) {
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/SecurityConstraints.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/SecurityConstraints.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/SecurityConstraints.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -36,6 +36,7 @@
private Servlet servlet;
private Set<String> protectedMethods = new LinkedHashSet<String>() ;
private Set<String> allowedRoles = new AllowedRoleSet<String>();
+ private String transportGuarantee;
public SecurityConstraints(Servlet servlet) {
AssertArgument.isNotNull(servlet, "servlet");
@@ -51,6 +52,14 @@
return allowedRoles;
}
+ public String getTransportGuarantee() {
+ return transportGuarantee;
+ }
+
+ public void setTransportGuarantee(String transportGuarantee) {
+ this.transportGuarantee = transportGuarantee;
+ }
+
private class AllowedRoleSet<T extends String> extends LinkedHashSet<String> {
public boolean add(String role) {
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/templates/web.xml.ftl
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/templates/web.xml.ftl 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/internal/soa/esb/listeners/war/templates/web.xml.ftl 2009-08-18 16:15:51 UTC (rev 28975)
@@ -56,7 +56,7 @@
<#if servlet.securityConstraints??>
<security-constraint>
<web-resource-collection>
- <web-resource-name>Localized "Reopen" constraints for servlet ${servlet.name}</web-resource-name>
+ <web-resource-name>Constraints for servlet ${servlet.name}</web-resource-name>
<#list servlet.urlMappings as urlMapping>
<url-pattern>${urlMapping}</url-pattern>
</#list>
@@ -73,9 +73,11 @@
<#else>
<auth-constraint/>
</#if>
+ <#if servlet.securityConstraints.transportGuarantee??>
<user-data-constraint>
- <transport-guarantee>NONE</transport-guarantee>
+ <transport-guarantee>${servlet.securityConstraints.transportGuarantee}</transport-guarantee>
</user-data-constraint>
+ </#if>
</security-constraint>
</#if>
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -486,7 +486,6 @@
final List<ContractReferencePublisher> publishers = new ArrayList<ContractReferencePublisher>() ;
Map<String, List<ConfigTree>> listenerGroups = getListenerGroups(model);
Set<Map.Entry<String, List<ConfigTree>>> listenerGroupEntries = listenerGroups.entrySet();
- ClasspathDeploymentResourceLocator diResourceLocator = new ClasspathDeploymentResourceLocator(di.localCl);
WebDeploymentArchive webDeployment = new WebDeploymentArchive(getESBWarFileName(di));
// Add the EBWS components...
@@ -511,9 +510,6 @@
WebGatewayDeploymentFactory deploymentFactory = WebGatewayDeploymentFactory.FactoryBuilder.createInstance(gatewayClass);
if(deploymentFactory != null) {
- deploymentFactory.setBusName(busIdRef);
- deploymentFactory.setDeploymentResourceLocator(diResourceLocator);
-
// For each listener...
for(ConfigTree listenerConfig : listeners) {
deploymentFactory.updateDeployment(listenerConfig, webDeployment);
@@ -846,22 +842,4 @@
throw new DeploymentException(e.getMessage(), e);
}
}
-
- private static class ClasspathDeploymentResourceLocator implements DeploymentResourceLocator {
- private ClassLoader classloader;
-
- private ClasspathDeploymentResourceLocator(ClassLoader classloader) {
- AssertArgument.isNotNull(classloader, "classloader");
- this.classloader = classloader;
- }
-
- public InputStream getResource(String resourcePath) {
- AssertArgument.isNotNullAndNotEmpty(resourcePath, "resourcePath");
- if(resourcePath.startsWith("/")) {
- return classloader.getResourceAsStream(resourcePath.substring(1));
- } else {
- return classloader.getResourceAsStream(resourcePath);
- }
- }
- }
}
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/ESBAwareGenerator.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/ESBAwareGenerator.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/ESBAwareGenerator.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -36,7 +36,6 @@
import org.jboss.soa.esb.listeners.config.xbeanmodel120.FtpListenerDocument.FtpListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.GroovyListenerDocument.GroovyListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.JbrListenerDocument.JbrListener;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.HttpListenerDocument.HttpListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.JmsBusDocument.JmsBus;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.JmsJcaProviderDocument.JmsJcaProvider;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.JmsListenerDocument.JmsListener;
@@ -46,6 +45,7 @@
import org.jboss.soa.esb.listeners.config.xbeanmodel120.SqlListenerDocument.SqlListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.SqlProviderDocument.SqlProvider;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.ScheduledListenerDocument.ScheduledListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel110.HttpListenerDocument;
import org.jboss.soa.esb.listeners.ListenerTagNames;
import org.jboss.soa.esb.listeners.message.MessageAwareListener;
import org.w3c.dom.Document;
@@ -207,9 +207,6 @@
} else if (listener instanceof JbrListener) {
logger.error("JbossRemoting listener only supported in Gateway mode.");
return;
- } else if (listener instanceof HttpListener) {
- logger.error("Http listener only supported in Gateway mode.");
- return;
} else if (listener instanceof GroovyListener) {
listenerConfigTree = GroovyListenerMapper.map(root, (GroovyListener)listener, model);
} else {
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/GatewayGenerator.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/GatewayGenerator.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/GatewayGenerator.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -32,7 +32,7 @@
import org.jboss.soa.esb.listeners.config.xbeanmodel120.GroovyListenerDocument.GroovyListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.HibernateListenerDocument.HibernateListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.JbrListenerDocument.JbrListener;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.HttpListenerDocument.HttpListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel120.HttpGatewayDocument.HttpGateway;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.JmsListenerDocument.JmsListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.ServiceDocument.Service;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.SqlListenerDocument.SqlListener;
@@ -40,6 +40,7 @@
import org.jboss.soa.esb.listeners.config.xbeanmodel120.Listener;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.JcaGatewayDocument;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.AbstractScheduledListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel110.HttpListenerDocument;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -134,8 +135,8 @@
listenerConfig = SqlListenerMapper.map(root, (SqlListener) gateway, model);
} else if (gateway instanceof JbrListener) {
listenerConfig = JbrListenerMapper.map(root, (JbrListener) gateway, model);
- } else if (gateway instanceof HttpListener) {
- listenerConfig = HttpListenerMapper.map(root, (HttpListener) gateway, model);
+ } else if (gateway instanceof HttpGateway) {
+ listenerConfig = HttpGatewayMapper.map(root, (HttpGateway) gateway, model);
} else if (gateway instanceof GroovyListener) {
listenerConfig = GroovyListenerMapper.map(root, (GroovyListener) gateway, model);
} else if (gateway instanceof HibernateListener) {
Copied: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpGatewayMapper.java (from rev 28836, labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpListenerMapper.java)
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpGatewayMapper.java (rev 0)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpGatewayMapper.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -0,0 +1,126 @@
+package org.jboss.soa.esb.listeners.config.mappers120;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.gateway.HttpGatewayServlet;
+import org.jboss.soa.esb.listeners.config.xbeanmodel120.PropertyDocument.Property;
+import org.jboss.soa.esb.listeners.config.xbeanmodel120.HttpBusDocument.HttpBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel120.HttpGatewayDocument.HttpGateway;
+import org.jboss.soa.esb.listeners.config.xbeanmodel120.HttpProviderDocument.HttpProvider;
+import org.jboss.soa.esb.listeners.config.xbeanmodel120.PayloadAs;
+import org.jboss.internal.soa.esb.listeners.war.HttpGatewayDeploymentFactory;
+import org.w3c.dom.Element;
+
+import java.util.List;
+
+/**
+ * Http gateway mapper.
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpGatewayMapper {
+
+ /**
+ * Perform the Http listener mapping.
+ * @param root The "ConfigTree" configuration root node.
+ * @param listener http listener config.
+ * @param model The configuration model from which the mapping is being performed.
+ * @return The ConfigTree listener configuration node.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ public static Element map(Element root, HttpGateway listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+ HttpBus bus;
+ HttpProvider provider;
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ try {
+ bus = (HttpBus) model.getOptionalBus(listener.getBusidref());
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "]. A <http-listener> must reference a <http-bus>.");
+ }
+
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+
+ String urlPattern = listener.getUrlPattern();
+ PayloadAs.Enum payloadAs = listener.getPayloadAs();
+
+ if(bus != null) {
+ try {
+ provider = (HttpProvider) model.getProvider(bus);
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "]. Should be contained within a <http-provider> instance. Unexpected exception - this should have caused a validation error!");
+ }
+
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ //MapperUtil.mapProperties(provider.getPropertyList(), listenerNode);
+ for(Property property : provider.getPropertyList()) {
+ Element propertyElement = listenerNode.getOwnerDocument().createElement("property");
+ MapperUtil.serialize(property, propertyElement);
+ listenerNode.appendChild(propertyElement);
+ }
+
+ List<HttpBus.ProtectedMethods> protectedMethodsList = bus.getProtectedMethodsList();
+ List<HttpBus.AllowedRoles> rolesList = bus.getAllowedRolesList();
+ HttpProvider.Auth authType = provider.getAuth();
+ HttpBus.TransportGuarantee.Enum transportGuarantee = bus.getTransportGuarantee();
+
+ MapperUtil.mapProperties(bus.getPropertyList(), listenerNode);
+ mapStandardSettings(listenerNode, urlPattern, payloadAs, listener.getPropertyList());
+
+ if(protectedMethodsList != null && !protectedMethodsList.isEmpty()) {
+ HttpBus.ProtectedMethods methods = protectedMethodsList.get(0);
+ StringBuilder methodsString = new StringBuilder();
+
+ for(HttpBus.ProtectedMethods.Method method : methods.getMethodList()) {
+ if(methodsString.length() > 0) {
+ methodsString.append(",");
+ }
+ methodsString.append(method.getName().toString());
+ }
+ listenerNode.setAttribute(HttpGatewayDeploymentFactory.PROTECTED_METHODS, methodsString.toString());
+ }
+ if(rolesList != null && !rolesList.isEmpty()) {
+ HttpBus.AllowedRoles roles = rolesList.get(0);
+ StringBuilder rolesString = new StringBuilder();
+
+ for(HttpBus.AllowedRoles.Role role : roles.getRoleList()) {
+ if(rolesString.length() > 0) {
+ rolesString.append(",");
+ }
+ rolesString.append(role.getName().toString());
+ }
+ listenerNode.setAttribute(HttpGatewayDeploymentFactory.ALLOWED_ROLES, rolesString.toString());
+ }
+ if(authType != null) {
+ listenerNode.setAttribute(HttpGatewayDeploymentFactory.AUTH_METHOD, authType.getMethod().toString());
+ listenerNode.setAttribute(HttpGatewayDeploymentFactory.AUTH_DOMAIN, authType.getDomain());
+ }
+
+ if(transportGuarantee != null) {
+ listenerNode.setAttribute(HttpGatewayDeploymentFactory.TRANSPORT_GUARANTEE, transportGuarantee.toString());
+ }
+ } else {
+ // Use the "default" http bus....
+ mapStandardSettings(listenerNode, urlPattern, payloadAs, listener.getPropertyList());
+ }
+
+ return listenerNode;
+ }
+
+ private static void mapStandardSettings(Element listenerNode, String urlPattern, PayloadAs.Enum payloadAs, List<Property> listenerProps) {
+ MapperUtil.mapProperties(listenerProps, listenerNode);
+
+ listenerNode.setAttribute(ListenerTagNames.GATEWAY_CLASS_TAG, HttpGatewayDeploymentFactory.class.getName());
+ listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, "true");
+
+ if(urlPattern != null) {
+ listenerNode.setAttribute(HttpGatewayDeploymentFactory.URL_PATTERN, urlPattern);
+ }
+ if(payloadAs != null) {
+ listenerNode.setAttribute(HttpGatewayServlet.PAYLOAD_AS, payloadAs.toString());
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpGatewayMapper.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpListenerMapper.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpListenerMapper.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -1,113 +0,0 @@
-package org.jboss.soa.esb.listeners.config.mappers120;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.gateway.HttpGatewayServlet;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.PropertyDocument.Property;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.HttpBusDocument.HttpBus;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.HttpListenerDocument.HttpListener;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.HttpProviderDocument.HttpProvider;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.PayloadAs;
-import org.jboss.internal.soa.esb.listeners.war.HttpGatewayDeploymentFactory;
-import org.w3c.dom.Element;
-
-import java.util.List;
-
-/**
- * Http listener mapper.
- * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
- */
-public class HttpListenerMapper {
-
- /**
- * Perform the Http listener mapping.
- * @param root The "ConfigTree" configuration root node.
- * @param listener http listener config.
- * @param model The configuration model from which the mapping is being performed.
- * @return The ConfigTree listener configuration node.
- * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
- */
- public static Element map(Element root, HttpListener listener, XMLBeansModel model) throws ConfigurationException {
- Element listenerNode = YADOMUtil.addElement(root, "listener");
- HttpBus bus;
- HttpProvider provider;
-
- listenerNode.setAttribute("name", listener.getName());
-
- try {
- bus = (HttpBus) model.getBus(listener.getBusidref());
- } catch (ClassCastException e) {
- throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "]. A <http-listener> must reference a <http-bus>.");
- }
- try {
- provider = (HttpProvider) model.getProvider(bus);
-
- } catch (ClassCastException e) {
- throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "]. Should be contained within a <http-provider> instance. Unexpected exception - this should have caused a validation error!");
- }
-
- // Map the standard listener attributes - common across all listener types...
- MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
- // Map the <property> elements targeted at the listener - from the listener itself.
- //MapperUtil.mapProperties(provider.getPropertyList(), listenerNode);
- for(Property property : provider.getPropertyList()) {
- Element propertyElement = listenerNode.getOwnerDocument().createElement("property");
- MapperUtil.serialize(property, propertyElement);
- listenerNode.appendChild(propertyElement);
- }
-
- MapperUtil.mapProperties(bus.getPropertyList(), listenerNode);
- MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
-
- if(listener.getIsGateway()) {
- String urlPattern = listener.getUrlPattern();
- PayloadAs.Enum payloadAs = listener.getPayloadAs();
- List<HttpBus.ProtectedMethods> protectedMethodsList = bus.getProtectedMethodsList();
- List<HttpBus.AllowedRoles> rolesList = bus.getAllowedRolesList();
- HttpProvider.Auth authType = provider.getAuth();
-
- listenerNode.setAttribute(ListenerTagNames.GATEWAY_CLASS_TAG, HttpGatewayDeploymentFactory.class.getName());
- listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, "true");
-
- if(urlPattern != null) {
- listenerNode.setAttribute(HttpGatewayDeploymentFactory.URL_PATTERN, urlPattern);
- }
- if(payloadAs != null) {
- listenerNode.setAttribute(HttpGatewayServlet.PAYLOAD_AS, payloadAs.toString());
- }
- if(protectedMethodsList != null && !protectedMethodsList.isEmpty()) {
- HttpBus.ProtectedMethods methods = protectedMethodsList.get(0);
- StringBuilder methodsString = new StringBuilder();
-
- for(HttpBus.ProtectedMethods.Method method : methods.getMethodList()) {
- if(methodsString.length() > 0) {
- methodsString.append(",");
- }
- methodsString.append(method.getName().toString());
- }
- listenerNode.setAttribute(HttpGatewayDeploymentFactory.PROTECTED_METHODS, methodsString.toString());
- }
- if(rolesList != null && !rolesList.isEmpty()) {
- HttpBus.AllowedRoles roles = rolesList.get(0);
- StringBuilder rolesString = new StringBuilder();
-
- for(HttpBus.AllowedRoles.Role role : roles.getRoleList()) {
- if(rolesString.length() > 0) {
- rolesString.append(",");
- }
- rolesString.append(role.getName().toString());
- }
- listenerNode.setAttribute(HttpGatewayDeploymentFactory.ALLOWED_ROLES, rolesString.toString());
- }
- if(authType != null) {
- listenerNode.setAttribute(HttpGatewayDeploymentFactory.AUTH_METHOD, authType.getMethod().toString());
- listenerNode.setAttribute(HttpGatewayDeploymentFactory.AUTH_DOMAIN, authType.getDomain());
- }
- } else {
- throw new ConfigurationException("Invalid <http-listener> config [" + listener.getName() +"]. <http-listener> is currently only supported as a gateway listener.");
- }
-
- return listenerNode;
- }
-}
\ No newline at end of file
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/JcaGatewayMapper.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/JcaGatewayMapper.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/JcaGatewayMapper.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -40,7 +40,6 @@
public static Element map(Element root, JcaGateway gateway, XMLBeansModel model) throws ConfigurationException
{
Element listenerNode = YADOMUtil.addElement(root, "listener");
- gateway.setIsGateway(true);
listenerNode.setAttribute("name", gateway.getName());
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/MapperUtil.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/MapperUtil.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/MapperUtil.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -50,10 +50,14 @@
*/
protected static void mapDefaultAttributes(Listener listener, Element listenerNode, XMLBeansModel model) {
Service service = model.getService(listener);
- boolean isGateway = listener.getIsGateway();
+ boolean isGateway = XMLBeansModel.isGateway(listener);
// Map maxThreads - appears to be a JMS only attrib...
- listenerNode.setAttribute(ListenerTagNames.MAX_THREADS_TAG, String.valueOf(listener.getMaxThreads()));
+ if(listener instanceof DualListener) {
+ listenerNode.setAttribute(ListenerTagNames.MAX_THREADS_TAG, String.valueOf(((DualListener)listener).getMaxThreads()));
+ } else {
+ listenerNode.setAttribute(ListenerTagNames.MAX_THREADS_TAG, "1");
+ }
mapListenerServiceAttributes(listenerNode, service, isGateway);
if (!isGateway && !listenerNode.hasAttribute(ListenerTagNames.LISTENER_CLASS_TAG)) {
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/UntypedListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/UntypedListenerMapper.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/UntypedListenerMapper.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -66,13 +66,9 @@
// Map the <property> elements targeted at the listener - from the listener itself.
MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
- if(listener.getIsGateway()) {
- listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, Boolean.toString(listener.getIsGateway()));
-
+ if(listenerNode.getAttribute(ListenerTagNames.IS_GATEWAY_TAG).equals("true")) {
MapperUtil.mapEPRProperties(listener, listenerNode, model);
-
} else {
-
Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
MapperUtil.mapEPRProperties(listener, eprNode, model);
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/XMLBeansModel.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/XMLBeansModel.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/XMLBeansModel.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -38,15 +38,7 @@
import org.jboss.soa.esb.common.ModulePropertyManager;
import org.jboss.soa.esb.listeners.config.ServicePublisher;
import org.jboss.soa.esb.listeners.config.WebserviceInfo;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.AbstractScheduledListener;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.Bus;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.BusProvider;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.JcaGatewayDocument;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.Listener;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.ListenersDocument;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.MepType;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.Provider;
-import org.jboss.soa.esb.listeners.config.xbeanmodel120.Schedule;
+import org.jboss.soa.esb.listeners.config.xbeanmodel120.*;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.ActionDocument.Action;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.ActionsDocument.Actions;
import org.jboss.soa.esb.listeners.config.xbeanmodel120.JbossesbDocument.Jbossesb;
@@ -143,6 +135,21 @@
* @throws org.jboss.soa.esb.ConfigurationException Unknown busid reference value.
*/
public Bus getBus(String busid) throws ConfigurationException {
+ Bus bus = getOptionalBus(busid);
+
+ if(bus == null) {
+ throw new ConfigurationException("Invalid ESB Configuration: No <bus> configuration matching busid reference value [" + busid + "].");
+ }
+
+ return bus;
+ }
+
+ /**
+ * Get the <bus> configuration matching the supplied busid reference value.
+ * @param busid The required <bus> configuration reference value.
+ * @return The Bus configuration instance.
+ */
+ public Bus getOptionalBus(String busid) {
List<Provider> providers = jbossesb.getProviders().getProviderList();
for(Provider provider : providers) {
@@ -157,7 +164,7 @@
}
}
- throw new ConfigurationException("Invalid ESB Configuration: No <bus> configuration matching busid reference value [" + busid + "].");
+ return null;
}
/**
@@ -239,9 +246,15 @@
return count ;
}
- private boolean isGateway(Listener listener)
+ public static boolean isGateway(Listener listener)
{
- return listener.getIsGateway() || (listener instanceof JcaGatewayDocument.JcaGateway);
+ if(listener instanceof GatewayOnlyListener) {
+ return true;
+ } else if(listener instanceof DualListener) {
+ return ((DualListener)listener).getIsGateway();
+ }
+
+ return false;
}
/**
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/WebDeploymentArchiveUnitTest.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/WebDeploymentArchiveUnitTest.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/WebDeploymentArchiveUnitTest.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -104,6 +104,24 @@
XMLAssert.assertXMLEqual(new InputStreamReader(getClass().getResourceAsStream("with_role_constraints_no_methods.xml")), new StringReader(webXML));
}
+ public void test_with_role_constraints_no_methods_with_guarantee() throws TemplateException, IOException, SAXException {
+ WebDeploymentArchive modelArch = new WebDeploymentArchive("testarch.esb");
+ Servlet servlet = new Servlet("servletX", "com.acme.XServlet", modelArch.getWebModel());
+ SecurityConstraints securityConstraints = new SecurityConstraints(servlet);
+
+ servlet.getUrlMappings().add("/x/*");
+
+ securityConstraints.getAllowedRoles().add("manager");
+ securityConstraints.getAllowedRoles().add("accountant");
+
+ securityConstraints.setTransportGuarantee("INTEGRAL");
+
+ String webXML = modelArch.getWebXML();
+ //System.out.println(webXML);
+ XMLUnit.setIgnoreWhitespace(true);
+ XMLAssert.assertXMLEqual(new InputStreamReader(getClass().getResourceAsStream("with_role_constraints_no_methods_with_guarantee.xml")), new StringReader(webXML));
+ }
+
public void test_with_authmethod() throws TemplateException, IOException, SAXException, ConfigurationException {
WebDeploymentArchive modelArch = new WebDeploymentArchive("testarch.esb");
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_method_constraints_no_roles.xml
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_method_constraints_no_roles.xml 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_method_constraints_no_roles.xml 2009-08-18 16:15:51 UTC (rev 28975)
@@ -23,16 +23,13 @@
<security-constraint>
<web-resource-collection>
- <web-resource-name>Localized "Reopen" constraints for servlet servletX</web-resource-name>
+ <web-resource-name>Constraints for servlet servletX</web-resource-name>
<url-pattern>/x/*</url-pattern>
<http-method>PUT</http-method>
<http-method>POST</http-method>
<http-method>DELETE</http-method>
</web-resource-collection>
<auth-constraint/>
- <user-data-constraint>
- <transport-guarantee>NONE</transport-guarantee>
- </user-data-constraint>
</security-constraint>
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods.xml
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods.xml 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods.xml 2009-08-18 16:15:51 UTC (rev 28975)
@@ -23,16 +23,13 @@
<security-constraint>
<web-resource-collection>
- <web-resource-name>Localized "Reopen" constraints for servlet servletX</web-resource-name>
+ <web-resource-name>Constraints for servlet servletX</web-resource-name>
<url-pattern>/x/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-name>
<role-name>accountant</role-name>
</auth-constraint>
- <user-data-constraint>
- <transport-guarantee>NONE</transport-guarantee>
- </user-data-constraint>
</security-constraint>
Copied: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods_with_guarantee.xml (from rev 28836, labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods.xml)
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods_with_guarantee.xml (rev 0)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods_with_guarantee.xml 2009-08-18 16:15:51 UTC (rev 28975)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+
+
+ <!-- Servlet 'servletX' configuration... -->
+ <servlet>
+ <servlet-name>servletX</servlet-name>
+ <servlet-class>com.acme.XServlet</servlet-class>
+
+
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>servletX</servlet-name>
+ <url-pattern>/x/*</url-pattern>
+ </servlet-mapping>
+
+ <!-- Security constraints... -->
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Constraints for servlet servletX</web-resource-name>
+ <url-pattern>/x/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>manager</role-name>
+ <role-name>accountant</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>INTEGRAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>Authentication Realm for testarch.esb</realm-name>
+ </login-config>
+
+ <security-role>
+ <role-name>accountant</role-name>
+ </security-role>
+ <security-role>
+ <role-name>manager</role-name>
+ </security-role>
+
+</web-app>
\ No newline at end of file
Property changes on: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/tests/src/org/jboss/internal/soa/esb/listeners/war/with_role_constraints_no_methods_with_guarantee.xml
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/publish_as_webservice/jboss-esb.xml 2009-08-18 16:15:51 UTC (rev 28975)
@@ -12,9 +12,6 @@
</jms-bus>
</jms-provider>
- <http-provider name="http">
- <http-bus busid="ordermgt" />
- </http-provider>
</providers>
<services>
@@ -32,14 +29,6 @@
<action name="action" class="org.jboss.soa.esb.samples.quickstart.publishAsWebservice.ESBWSListenerAction" process="displayMessage"/>
</actions>
</service>
- <service category="OrderManagement" name="Incoming" description="" invmScope="GLOBAL">
- <listeners>
- <http-listener name="1" busidref="ordermgt" urlPattern="/in/*" is-gateway="true" />
- </listeners>
- <actions mep="RequestResponse">
- <action name="print" class="org.jboss.soa.esb.actions.SystemPrintln"/>
- </actions>
- </service>
</services>
</jbossesb>
Modified: labs/jbossesb/workspace/tfennelly/httpg2/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/qa/junit/src/org/jboss/soa/esb/server/ebws/EBWSUtil.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -64,9 +64,9 @@
public static final String SOAP_ADDRESSING_RESPONSE = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
"<soap:Header/><soap:Body>" + VALID_RESPONSE + "</soap:Body></soap:Envelope>" ;
- public static final String NORMAL_SOAP_ENDPOINT = "http://127.0.0.1:8080/ebws-test/TestEBWS/normal" ;
- public static final String ALTERNATE_SOAP_ENDPOINT = "http://127.0.0.1:8080/ebws-test/TestEBWS/alternate" ;
- public static final String NORMAL_SOAP_ADDRESSING_ENDPOINT = "http://127.0.0.1:8080/ebws-test/TestEBWS/addressing" ;
+ public static final String NORMAL_SOAP_ENDPOINT = "http://127.0.0.1:8080/ebws-test/ebws/TestEBWS/normal" ;
+ public static final String ALTERNATE_SOAP_ENDPOINT = "http://127.0.0.1:8080/ebws-test/ebws/TestEBWS/alternate" ;
+ public static final String NORMAL_SOAP_ADDRESSING_ENDPOINT = "http://127.0.0.1:8080/ebws-test/ebws/TestEBWS/addressing" ;
public static EBWSServerMBean getEBWSServerMBean()
throws MalformedObjectNameException
Modified: labs/jbossesb/workspace/tfennelly/httpg2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HttpGatewayTest.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HttpGatewayTest.java 2009-08-18 13:32:06 UTC (rev 28974)
+++ labs/jbossesb/workspace/tfennelly/httpg2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HttpGatewayTest.java 2009-08-18 16:15:51 UTC (rev 28975)
@@ -47,7 +47,7 @@
}
public void sendMessage() throws Exception {
- URL request = new URL("http://localhost:8080/Quickstart_http_gateway/http/in/a/b?param1=value1");
+ URL request = new URL("http://localhost:8080/Quickstart_http_gateway/http/index/XXXX/yyy?param1=value1");
URLConnection connection = request.openConnection();
connection.connect();
@@ -55,8 +55,9 @@
try {
String response = StreamUtils.readReader(reader);
- assertTrue(response.indexOf("Service: OrderManagement:Incoming") != -1);
- assertTrue(response.indexOf("pathInfo: /a/b") != -1);
+ assertTrue(response.indexOf("Service: Index:List") != -1);
+ assertTrue(response.indexOf("pathInfo: /XXXX/yyy") != -1);
+ assertTrue(response.indexOf("pathInfoTokens: [, XXXX, yyy]") != -1);
assertTrue(response.indexOf("params: {param1=") != -1);
} finally {
reader.close();
More information about the jboss-svn-commits
mailing list