Class JmsTransportUtils
java.lang.Object
org.springframework.ws.transport.jms.support.JmsTransportUtils
Collection of utility methods to work with JMS transports. Includes methods to retrieve JMS properties from an
URI
.- Since:
- 1.5.0
- Author:
- Arjen Poutsma
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Adds the given header to the specified message.static int
getDeliveryMode
(URI uri) Returns the delivery mode of the given URI.static String
getDestinationName
(URI uri) Returns the destination name of the given URI.getHeaderNames
(jakarta.jms.Message message) Returns an iterator over all header names in the given message.getHeaders
(jakarta.jms.Message message, String name) Returns an iterator over all the header values of the given message and header name.static int
getMessageType
(URI uri) Returns the message type of the given URI.static int
getPriority
(URI uri) Returns the priority of the given URI.static String
getReplyToName
(URI uri) Returns the reply-to name of the given URI.static long
getTimeToLive
(URI uri) Returns the lifetime, in milliseconds, of the given URI.static String
headerToJmsProperty
(String headerName) Converts the given transport header to a JMS property name.static String
jmsPropertyToHeader
(String propertyName) Converts the given JMS property name to a transport header name.static URI
toUri
(jakarta.jms.Destination destination) Converts the given JMS destination into ajms
URI.
-
Method Details
-
headerToJmsProperty
Converts the given transport header to a JMS property name. Returns the given header name if no match is found.- Parameters:
headerName
- the header name to transform- Returns:
- the JMS property name
-
jmsPropertyToHeader
Converts the given JMS property name to a transport header name. Returns the given property name if no match is found.- Parameters:
propertyName
- the JMS property name to transform- Returns:
- the transport header name
-
toUri
public static URI toUri(jakarta.jms.Destination destination) throws URISyntaxException, jakarta.jms.JMSException Converts the given JMS destination into ajms
URI.- Parameters:
destination
- the destination- Returns:
- a jms URI
- Throws:
URISyntaxException
jakarta.jms.JMSException
-
getDestinationName
Returns the destination name of the given URI. -
addHeader
public static void addHeader(jakarta.jms.Message message, String name, String value) throws jakarta.jms.JMSException Adds the given header to the specified message.- Throws:
jakarta.jms.JMSException
-
getHeaderNames
public static Iterator<String> getHeaderNames(jakarta.jms.Message message) throws jakarta.jms.JMSException Returns an iterator over all header names in the given message. Delegates tojmsPropertyToHeader(String)
.- Throws:
jakarta.jms.JMSException
-
getHeaders
public static Iterator<String> getHeaders(jakarta.jms.Message message, String name) throws jakarta.jms.JMSException Returns an iterator over all the header values of the given message and header name. Delegates toheaderToJmsProperty(String)
.- Throws:
jakarta.jms.JMSException
-
getDeliveryMode
Returns the delivery mode of the given URI.- See Also:
-
DeliveryMode.NON_PERSISTENT
DeliveryMode.PERSISTENT
Message.DEFAULT_DELIVERY_MODE
-
getMessageType
Returns the message type of the given URI. Defaults toJmsTransportConstants.BYTES_MESSAGE_TYPE
. -
getTimeToLive
Returns the lifetime, in milliseconds, of the given URI.- See Also:
-
Message.DEFAULT_TIME_TO_LIVE
-
getPriority
Returns the priority of the given URI.- See Also:
-
Message.DEFAULT_PRIORITY
-
getReplyToName
Returns the reply-to name of the given URI.- See Also:
-
Message.setJMSReplyTo(Destination)
-