com.ibm.ia.connectivity.context

Interface MessageContext



  • public interface MessageContext

    Defines the functions that allow message classifiers and transformations to inspect the the context in which an inbound message was delivered.

    See MessageContextProvider for notes about using the message context in message classification and transformation.

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String HTTP
      The protocol name for HTTP or HTTPS.
      static java.lang.String JMS
      The protocol name for JMS messaging.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.String getBindingName()
      Returns the name of the inbound binding.
      java.lang.String getContextPath()
      Returns the part of the URL that indicates the context of the request.
      java.lang.String getEndpointName()
      Returns the name of the inbound endpoint.
      java.lang.String getHeader(java.lang.String name)
      Returns the value of the named protocol header or message property.
      java.lang.String getHeaderName(int index)
      Returns the name of a protocol header or message property from its index in the result of getHeaderNames().
      int getHeaderNameCount()
      Returns the number of protocol header or message property names included with the message.
      java.util.List<java.lang.String> getHeaderNames()
      Returns the names of the protocol headers or message properties included with the message.
      java.util.List<java.lang.String> getHeaders(java.lang.String name)
      Returns all the values of the named protocol header or message property.
      java.lang.String getJMSCorrelationID()
      Returns the JMS correlation ID, if applicable.
      java.lang.String getJMSMessageID()
      Returns the JMS message ID, if applicable.
      java.lang.String getJMSType()
      Returns the JMS message type, if applicable.
      long getMessageReceivedTimestamp()
      Returns the approximate system time at which the message was received by inbound connectivity as a long value.
      java.lang.String getMessageReceivedTimestampISO8601()
      Returns the approximate system time at which the message was received by inbound connectivity using ISO 8601 with the solution default time zone.
      java.lang.String getMessageReceivedTimestampISO8601(java.lang.String zoneID)
      Returns the approximate system time at which the message was received by inbound connectivity using ISO 8601 with the specified time zone.
      long getMessageTimestamp()
      Returns the timestamp associated with the message as a long value, if applicable.
      java.lang.String getMessageTimestampISO8601()
      Returns the timestamp associated with the message using ISO 8601 with the solution default time zone.
      java.lang.String getMessageTimestampISO8601(java.lang.String zoneID)
      Returns the timestamp associated with the message using ISO 8601 with the specified time zone.
      java.lang.String getPathInfo()
      Returns the part of the URL that follows the servlet path.
      java.lang.String getProtocol()
      Returns the name of the protocol by which the message is received.
      java.lang.String getQueryString()
      Returns the part of the URL that contains the query string.
      java.lang.String getRequestURL()
      Returns the URL that the client used to send the message, if applicable.
      java.lang.String getServletPath()
      Returns the part of the URL that follows the context path and indicates the servlet that handled the request.
      java.lang.String getSolutionName()
      Returns the name of the solution.
      java.lang.String getSolutionVersion()
      Returns the version of the solution.
    • Field Detail

      • HTTP

        static final java.lang.String HTTP

        The protocol name for HTTP or HTTPS.

        See Also:
        Constant Field Values
      • JMS

        static final java.lang.String JMS

        The protocol name for JMS messaging.

        See Also:
        Constant Field Values
    • Method Detail

      • getProtocol

        java.lang.String getProtocol()

        Returns the name of the protocol by which the message is received.

        Returns:
        The protocol name.
      • getSolutionName

        java.lang.String getSolutionName()

        Returns the name of the solution.

        Returns:
        The solution name.
      • getSolutionVersion

        java.lang.String getSolutionVersion()

        Returns the version of the solution.

        Returns:
        The solution version.
      • getBindingName

        java.lang.String getBindingName()

        Returns the name of the inbound binding.

        Returns:
        The inbound binding name.
      • getEndpointName

        java.lang.String getEndpointName()

        Returns the name of the inbound endpoint.

        Returns:
        The inbound endpoint name.
      • getMessageTimestamp

        long getMessageTimestamp()

        Returns the timestamp associated with the message as a long value, if applicable.

        HTTP
        Returns the timestamp represented by the Date header, if present.
        JMS
        Returns the JMSTimestamp of the message, if present.

        Returns 0 if the timestamp cannot be determined or is not provided.

        Returns:
        Milliseconds since the epoch, 1970-01-01T00:00:00Z
      • getMessageTimestampISO8601

        java.lang.String getMessageTimestampISO8601()

        Returns the timestamp associated with the message using ISO 8601 with the solution default time zone.

        HTTP
        Returns the timestamp represented by the Date header, if present.
        JMS
        Returns the JMSTimestamp of the message, if present.

        Returns the empty string if the timestamp cannot be determined or is not provided.

        Returns:
        ISO 8601 date and time string.
      • getMessageTimestampISO8601

        java.lang.String getMessageTimestampISO8601(java.lang.String zoneID)

        Returns the timestamp associated with the message using ISO 8601 with the specified time zone.

        HTTP
        Returns the timestamp represented by the Date header, if present.
        JMS
        Returns the JMSTimestamp of the message, if present.

        Returns the empty string if the timestamp cannot be determined or is not provided.

        Parameters:
        zoneId - time zone name (null or empty string for the solution default)
        Returns:
        ISO 8601 date and time string.
      • getMessageReceivedTimestamp

        long getMessageReceivedTimestamp()

        Returns the approximate system time at which the message was received by inbound connectivity as a long value.

        Returns:
        Milliseconds since the epoch, 1970-01-01T00:00:00Z
      • getMessageReceivedTimestampISO8601

        java.lang.String getMessageReceivedTimestampISO8601()

        Returns the approximate system time at which the message was received by inbound connectivity using ISO 8601 with the solution default time zone.

        Returns:
        ISO 8601 date and time string.
      • getMessageReceivedTimestampISO8601

        java.lang.String getMessageReceivedTimestampISO8601(java.lang.String zoneID)

        Returns the approximate system time at which the message was received by inbound connectivity using ISO 8601 with the specified time zone.

        Parameters:
        zoneId - time zone name (null or empty string for the solution default)
        Returns:
        ISO 8601 date and time string.
      • getJMSType

        java.lang.String getJMSType()

        Returns the JMS message type, if applicable.

        HTTP
        Returns the empty string.
        JMS
        Returns the JMSType of the message, if present.

        Returns the empty string if the value cannot be determined.

        Returns:
        The message type value.
      • getJMSMessageID

        java.lang.String getJMSMessageID()

        Returns the JMS message ID, if applicable.

        HTTP
        Returns the empty string.
        JMS
        Returns the JMSMessageID of the message, if present.

        Returns the empty string if the value cannot be determined.

        Returns:
        The message type value.
      • getJMSCorrelationID

        java.lang.String getJMSCorrelationID()

        Returns the JMS correlation ID, if applicable.

        HTTP
        Returns the empty string.
        JMS
        Returns the JMSCorrelationID of the message, if present.

        Returns the empty string if the value cannot be determined.

        Returns:
        The message type value.
      • getHeaderNames

        java.util.List<java.lang.String> getHeaderNames()

        Returns the names of the protocol headers or message properties included with the message.

        HTTP
        Returns the names of the supplied HTTP headers.
        JMS
        Returns the names of the JMS message properties.
        Returns:
        The list of header or property names.
      • getHeaderNameCount

        int getHeaderNameCount()

        Returns the number of protocol header or message property names included with the message. This is the size of the result of getHeaderNames().

        Returns:
        The number of header or property names.
      • getHeaderName

        java.lang.String getHeaderName(int index)

        Returns the name of a protocol header or message property from its index in the result of getHeaderNames().

        Parameters:
        index - the index of the name to retrieve; 0 <= index < getHeaderNameCount()
        Returns:
        The header or property name.
      • getHeader

        java.lang.String getHeader(java.lang.String name)

        Returns the value of the named protocol header or message property.

        HTTP
        Returns the value of the first matching HTTP header.
        JMS
        Returns the String value of the JMS message property.

        Returns the empty string if the value cannot be determined or is not provided.

        Parameters:
        name - the name of the header or property.
        Returns:
        The header or property value.
      • getHeaders

        java.util.List<java.lang.String> getHeaders(java.lang.String name)

        Returns all the values of the named protocol header or message property.

        HTTP
        Returns the values of the matching HTTP headers.
        JMS
        Returns a list containing the single String value of the JMS message property.

        Returns the empty list if the value cannot be determined or is not provided.

        Parameters:
        name - the name of the header or property.
        Returns:
        A list containing the header or property values
      • getRequestURL

        java.lang.String getRequestURL()

        Returns the URL that the client used to send the message, if applicable.

        HTTP
        Returns the HTTP request URL.
        JMS
        Returns the empty string.

        Returns the empty string if the value cannot be determined.

        Returns:
        The request URL as a string.
      • getContextPath

        java.lang.String getContextPath()

        Returns the part of the URL that indicates the context of the request.

        HTTP
        Returns the context path of the HTTP request URL. Returns the empty string if the request context is the root context.
        JMS
        Returns the empty string.

        Returns the empty string if the value cannot be determined.

        Returns:
        The context path of the request URL.
      • getServletPath

        java.lang.String getServletPath()

        Returns the part of the URL that follows the context path and indicates the servlet that handled the request.

        HTTP
        Returns the servlet path of the HTTP request URL. Returns the empty string if the servlet path is empty.
        JMS
        Returns the empty string.

        Returns the empty string if the value cannot be determined.

        Returns:
        The servlet path from the request URL.
      • getPathInfo

        java.lang.String getPathInfo()

        Returns the part of the URL that follows the servlet path.

        HTTP
        Returns the path information of the HTTP request URL. Returns the empty string if the path information path is empty.
        JMS
        Returns the empty string.

        Returns the empty string if the value cannot be determined.

        Returns:
        The path information from the request URL.
      • getQueryString

        java.lang.String getQueryString()

        Returns the part of the URL that contains the query string.

        HTTP
        Returns the query string of the HTTP request URL. Returns the empty string if there no query string is provided.
        JMS
        Returns the empty string.

        Returns the empty string if the value cannot be determined.

        Returns:
        The query string from the request URL.

© Copyright IBM 2017