public final class MessageUtility
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
compare(byte[] bytes1,
byte[] bytes2)
Compares two byte arrays.
|
static boolean |
compare(javax.jms.BytesMessage msg1,
javax.jms.BytesMessage msg2)
Compares two bytes messages.
|
static boolean |
compare(javax.jms.MapMessage msg1,
javax.jms.MapMessage msg2)
Compares two map messages.
|
static boolean |
compare(javax.jms.Message msg1,
javax.jms.Message msg2)
Compares two messages.
|
static boolean |
compare(javax.jms.ObjectMessage msg1,
javax.jms.ObjectMessage msg2)
Compares two object messages.
|
static boolean |
compare(javax.jms.StreamMessage msg1,
javax.jms.StreamMessage msg2)
Compares two stream messages.
|
static boolean |
compare(java.lang.String s1,
java.lang.String s2)
Compares two strings.
|
static boolean |
compare(javax.jms.TextMessage msg1,
javax.jms.TextMessage msg2)
Compares two text messages.
|
static MessageImpl |
copyMessage(javax.jms.Message msg,
boolean reset)
Copies header, properties and body of
msg to a new
message of the same type. |
public static boolean compare(java.lang.String s1, java.lang.String s2)
null
values.s1
- s2
- true
if s1
and
s2
are null
or
s1.equals(s2)
evaluates to true
.
In all other cases returns false
.public static boolean compare(byte[] bytes1, byte[] bytes2)
null
values.bytes1
- bytes2
- true
if bytes1
and
bytes2
have the same lengths and content.
In all other cases returns false
.public static boolean compare(javax.jms.Message msg1, javax.jms.Message msg2) throws javax.jms.JMSException
msg1
- msg2
- true
if all header fields in msg1
have the same values as the corresponded header fields in
msg2
, and all properties from msg1
exists and have the same values in msg2
, and
msg2
does not have properties that do not exist in
msg1
.javax.jms.JMSException
public static boolean compare(javax.jms.BytesMessage msg1, javax.jms.BytesMessage msg2) throws javax.jms.JMSException
msg1
- msg2
- true
if the body of msg1
has the same value as the body of msg2
, and
compare((Message)msg1, msg2)
evaluates to true
.
In all other cases returns false
.javax.jms.JMSException
public static boolean compare(javax.jms.MapMessage msg1, javax.jms.MapMessage msg2) throws javax.jms.JMSException
msg1
- msg2
- true
if the body of msg1
has the same value as the body of msg2
, and
compare((Message)msg1, msg2)
evaluates to true
.
In all other cases returns false
.javax.jms.JMSException
public static boolean compare(javax.jms.ObjectMessage msg1, javax.jms.ObjectMessage msg2) throws javax.jms.JMSException
msg1.getObject().equals(msg2.getObject)
evaluates to
true
or both bodies are null
.msg1
- msg2
- true
if the body of msg1
has the same value as the body of msg2
, and
compare((Message)msg1, msg2)
evaluates to true
.
In all other cases returns false
.javax.jms.JMSException
public static boolean compare(javax.jms.StreamMessage msg1, javax.jms.StreamMessage msg2) throws javax.jms.JMSException
msg1
- msg2
- true
if the body of msg1
has the same value as the body of msg2
, and
compare((Message)msg1, msg2)
evaluates to true
.
In all other cases returns false
.javax.jms.JMSException
public static boolean compare(javax.jms.TextMessage msg1, javax.jms.TextMessage msg2) throws javax.jms.JMSException
msg1.getText().equals(msg2.getText())
evaluates to
true
or both bodies are null
.msg1
- msg2
- true
if the body of msg1
has the same value as the body of msg2
, and
compare((Message)msg1, msg2)
evaluates to true
.
In all other cases returns false
.javax.jms.JMSException
public static MessageImpl copyMessage(javax.jms.Message msg, boolean reset) throws javax.jms.JMSException
msg
to a new
message of the same type.msg
- to be copied fromreset
- true
if the copy should be in read only mode. If msg
is already in read-only
mode this parameter is redundant.msg
javax.jms.JMSException