Class MessageUtils

java.lang.Object
org.apache.synapse.transport.netty.util.MessageUtils

public class MessageUtils extends Object
Class MessageUtils contains helper methods that are used to build the payload.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    buildMessage(org.apache.axis2.context.MessageContext msgCtx)
     
    static void
    buildMessage(org.apache.axis2.context.MessageContext msgCtx, boolean earlyBuild)
     
    static org.apache.axis2.transport.MessageFormatter
    getMessageFormatter(org.apache.axis2.context.MessageContext msgContext)
    This selects the formatter for a given message format based on the the content type of the received message.
    static String
    Get MIME content type out of content-type header.
    static org.apache.axiom.om.OMOutputFormat
    getOMOutputFormat(org.apache.axis2.context.MessageContext msgContext)
     
    static boolean
    Function to check given inputstream is empty or not Used to check whether content of the payload input stream is empty or not.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MessageUtils

      public MessageUtils()
  • Method Details

    • buildMessage

      public static void buildMessage(org.apache.axis2.context.MessageContext msgCtx) throws IOException
      Throws:
      IOException
    • buildMessage

      public static void buildMessage(org.apache.axis2.context.MessageContext msgCtx, boolean earlyBuild) throws IOException
      Throws:
      IOException
    • getMIMEContentType

      public static String getMIMEContentType(String contentType)
      Get MIME content type out of content-type header.
      Parameters:
      contentType - content type header value
      Returns:
      MIME content type
    • isEmptyPayloadStream

      public static boolean isEmptyPayloadStream(InputStream inputStream) throws IOException
      Function to check given inputstream is empty or not Used to check whether content of the payload input stream is empty or not.
      Parameters:
      inputStream - target inputstream
      Returns:
      true if it is a empty stream
      Throws:
      IOException
    • getMessageFormatter

      public static org.apache.axis2.transport.MessageFormatter getMessageFormatter(org.apache.axis2.context.MessageContext msgContext)
      This selects the formatter for a given message format based on the the content type of the received message. content-type to builder mapping can be specified through the Axis2.xml.
      Parameters:
      msgContext - axis2 MessageContext
      Returns:
      the formatter registered against the given content-type
    • getOMOutputFormat

      public static org.apache.axiom.om.OMOutputFormat getOMOutputFormat(org.apache.axis2.context.MessageContext msgContext)