This commit is contained in:
Arjen Poutsma
2007-09-28 23:22:07 +00:00
parent 755236e60c
commit ba3afc7c2b
2 changed files with 25 additions and 2 deletions

View File

@@ -18,7 +18,13 @@ package org.springframework.ws.transport.jms.support;
import org.springframework.ws.transport.jms.JmsTransportConstants;
/** @author Arjen Poutsma */
/**
* Collection of utility methods to work with JMS transports. Includes methods to convert from transport header names to
* JMS Properties and vice-versa.
*
* @author Arjen Poutsma
* @since 1.1.0
*/
public class JmsTransportUtils {
private static final String[] CONVERSION_TABLE = new String[]{JmsTransportConstants.HEADER_CONTENT_TYPE,
@@ -27,9 +33,14 @@ public class JmsTransportUtils {
JmsTransportConstants.PROPERTY_SOAP_ACTION};
private JmsTransportUtils() {
}
/**
* Converts the given transport header to a JMS property name. Returns the given header name if no match is found.
*
* @param headerName the header name to transform
* @return the JMS property name
*/
public static String headerToJmsProperty(String headerName) {
for (int i = 0; i < CONVERSION_TABLE.length; i = i + 2) {
if (CONVERSION_TABLE[i].equals(headerName)) {
@@ -39,6 +50,13 @@ public class JmsTransportUtils {
return headerName;
}
/**
* Converts the given JMS property name to a transport header name. Returns the given property name if no match is
* found.
*
* @param propertyName the JMS property name to transform
* @return the transport header name
*/
public static String jmsPropertyToHeader(String propertyName) {
for (int i = 1; i < CONVERSION_TABLE.length; i = i + 2) {
if (CONVERSION_TABLE[i].equals(propertyName)) {

View File

@@ -0,0 +1,5 @@
<html>
<body>
Classes supporting the org.springframework.ws.transport.jms package.
</body>
</html>