Package org.apache.cxf.message
Class MessageUtils
java.lang.Object
org.apache.cxf.message.MessageUtils
Holder for utility methods relating to messages.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
getContextualBoolean
(Message m, String key) static boolean
getContextualBoolean
(Message m, String key, boolean defaultValue) static int
getContextualInteger
(Message m, String key, int defaultValue) static Collection<Integer>
getContextualIntegers
(Message m, String key, Collection<Integer> defaultValue) static Object
getContextualProperty
(Message m, String propPreferred, String propDefault) static String
getContextualString
(Message m, String key, String defaultValue) getContextualStrings
(Message m, String key, Set<String> defaultValue) static FaultMode
getFaultMode
(Message message) Determine the fault mode for the underlying (fault) message (for use on server side only).static int
getReponseCodeFromMessage
(Message message) Gets the response code from the message and tries to deduct one if it is not set yet.static boolean
hasNoResponseContent
(Message message) Determines if the current message has no response content.static boolean
Returns true if the underlying content format is a W3C DOM or a SAAJ message.static boolean
isEmptyPartialResponse
(Message message) Determines if the current message is an empty partial response, which is a partial response with an empty content.static boolean
Determine if message is fault.static boolean
Checks if the message is oneway or notstatic boolean
isOutbound
(Message message) Determine if message is outbound.static boolean
isPartialResponse
(Message message) Determine if the current message is a partial response.static boolean
isRequestor
(Message message) Determine if current messaging role is that of requestor.static boolean
Deprecated.replaced by {@link #PropertyUtils#isTrue(Object)}
-
Method Details
-
isOutbound
Determine if message is outbound.- Parameters:
message
- the current Message- Returns:
- true if the message direction is outbound
-
isFault
Determine if message is fault.- Parameters:
message
- the current Message- Returns:
- true if the message is a fault
-
getFaultMode
Determine the fault mode for the underlying (fault) message (for use on server side only).- Parameters:
message
- the fault message- Returns:
- the FaultMode
-
isRequestor
Determine if current messaging role is that of requestor.- Parameters:
message
- the current Message- Returns:
- true if the current messaging role is that of requestor
-
isPartialResponse
Determine if the current message is a partial response.- Parameters:
message
- the current message- Returns:
- true if the current messags is a partial response
-
isEmptyPartialResponse
Determines if the current message is an empty partial response, which is a partial response with an empty content.- Parameters:
message
- the current message- Returns:
- true if the current messags is a partial empty response
-
isTrue
Deprecated.replaced by {@link #PropertyUtils#isTrue(Object)}Returns true if a value is either the String "true" (regardless of case) or Boolean.TRUE.- Parameters:
value
-- Returns:
- true if value is either the String "true" or Boolean.TRUE
-
getContextualBoolean
-
getContextualBoolean
-
getContextualIntegers
public static Collection<Integer> getContextualIntegers(Message m, String key, Collection<Integer> defaultValue) -
getContextualInteger
-
getContextualStrings
-
getContextualString
-
getContextualProperty
-
isDOMPresent
Returns true if the underlying content format is a W3C DOM or a SAAJ message. -
getTargetMethod
-
getReponseCodeFromMessage
Gets the response code from the message and tries to deduct one if it is not set yet.- Parameters:
message
- message to get response code from- Returns:
- response code (or deducted value assuming success)
-
hasNoResponseContent
Determines if the current message has no response content. The message has no response content if either: - the request is oneway and the current message is no partial response or an empty partial response. - the request is not oneway but the current message is an empty partial response.- Parameters:
message
-- Returns:
-
isOneWay
Checks if the message is oneway or not- Parameters:
message
- the message under consideration- Returns:
- true if the message has been marked as oneway
-