public class BrokerMessage
extends java.lang.Object
getService()
,
getConversation()
and
getUnitofWork()
methods can be used to navigate to the context
of the received message.Constructor and Description |
---|
BrokerMessage()
Creates a Message object with an empty message.
|
BrokerMessage(byte[] msg)
Creates a Message object initialized with the passed byte array.
|
BrokerMessage(java.lang.String msg)
Creates a BrokerMessage object initialized with the passed String
object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getClientUID()
Returns the client's user ID.
|
Conversation |
getConversation()
Returns the corresponding Conversation object.
|
byte[] |
getMessage()
Returns the current message as a byte array.
|
BrokerService |
getService()
Returns the BrokerService object to which the message belongs.
|
UnitofWork |
getUnitofWork()
Returns the corresponding UnitofWork object.
|
void |
reply(BrokerMessage msg)
Sends a reply to a previously received message.
|
void |
setMessage(byte[] s)
Sets the current message to the passed byte array.
|
void |
setMessage(java.lang.String s)
Sets the current message to the passed string.
|
java.lang.String |
toString()
Returns the current message as a string.
|
public BrokerMessage()
public BrokerMessage(byte[] msg)
msg
- the message as byte array.public BrokerMessage(java.lang.String msg)
msg
- the message as a String object.public java.lang.String toString()
toString
in class java.lang.Object
null
.public java.lang.String getClientUID()
null
.public byte[] getMessage()
null
.public void setMessage(byte[] s)
s
- the message as byte array.public void setMessage(java.lang.String s)
s
- the message as string.public BrokerService getService()
public Conversation getConversation()
null
is returned.null
.public UnitofWork getUnitofWork()
null
is returned.null
.public void reply(BrokerMessage msg) throws BrokerException
msg
- BrokerMessage to send.BrokerException
- A Broker exception.java.lang.IllegalArgumentException
- Thrown if the parameter is invalid.