Class MessageUtils
java.lang.Object
org.apache.synapse.transport.netty.util.MessageUtils
Class MessageUtils contains helper methods that are used to build the payload.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbuildMessage(org.apache.axis2.context.MessageContext msgCtx) static voidbuildMessage(org.apache.axis2.context.MessageContext msgCtx, boolean earlyBuild) static org.apache.axis2.transport.MessageFormattergetMessageFormatter(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 StringgetMIMEContentType(String contentType) Get MIME content type out of content-type header.static org.apache.axiom.om.OMOutputFormatgetOMOutputFormat(org.apache.axis2.context.MessageContext msgContext) static booleanisEmptyPayloadStream(InputStream inputStream) Function to check given inputstream is empty or not Used to check whether content of the payload input stream is empty or not.
-
Constructor Details
-
MessageUtils
public MessageUtils()
-
-
Method Details
-
buildMessage
- Throws:
IOException
-
buildMessage
public static void buildMessage(org.apache.axis2.context.MessageContext msgCtx, boolean earlyBuild) throws IOException - Throws:
IOException
-
getMIMEContentType
Get MIME content type out of content-type header.- Parameters:
contentType- content type header value- Returns:
- MIME content type
-
isEmptyPayloadStream
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)
-