Class JmsTransportUtils

java.lang.Object
org.springframework.ws.transport.jms.support.JmsTransportUtils

public abstract class JmsTransportUtils extends Object
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 Details

    • headerToJmsProperty

      public static String headerToJmsProperty(String headerName)
      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

      public static String jmsPropertyToHeader(String propertyName)
      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 a jms URI.
      Parameters:
      destination - the destination
      Returns:
      a jms URI
      Throws:
      URISyntaxException
      jakarta.jms.JMSException
    • getDestinationName

      public static String getDestinationName(URI uri)
      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 to jmsPropertyToHeader(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 to headerToJmsProperty(String).
      Throws:
      jakarta.jms.JMSException
    • getDeliveryMode

      public static int getDeliveryMode(URI uri)
      Returns the delivery mode of the given URI.
      See Also:
      • DeliveryMode.NON_PERSISTENT
      • DeliveryMode.PERSISTENT
      • Message.DEFAULT_DELIVERY_MODE
    • getMessageType

      public static int getMessageType(URI uri)
      Returns the message type of the given URI. Defaults to JmsTransportConstants.BYTES_MESSAGE_TYPE.
      See Also:
    • getTimeToLive

      public static long getTimeToLive(URI uri)
      Returns the lifetime, in milliseconds, of the given URI.
      See Also:
      • Message.DEFAULT_TIME_TO_LIVE
    • getPriority

      public static int getPriority(URI uri)
      Returns the priority of the given URI.
      See Also:
      • Message.DEFAULT_PRIORITY
    • getReplyToName

      public static String getReplyToName(URI uri)
      Returns the reply-to name of the given URI.
      See Also:
      • Message.setJMSReplyTo(Destination)