public class cMsgMessageFull extends cMsgMessage implements java.io.Serializable
allFields, bytes, context, dateFormatter, domain, expandedPayload, hasPayload, info, isBigEndian, isGetRequest, isGetResponse, isNullGetResponse, items, length, noHistoryAdditions, nullGetServerResponse, offset, payloadFieldsOnly, payloadText, receiver, receiverHost, receiverTime, reliableSend, reserved, sender, senderHost, senderTime, senderToken, subject, sysMsgId, systemFieldsOnly, text, type, userInt, userTime, version, wasSent
Constructor and Description |
---|
cMsgMessageFull()
Constructor.
|
cMsgMessageFull(cMsgMessage m)
Constructor using existing cMsgMessage type of message.
|
cMsgMessageFull(java.io.File file)
Constructor reading file generated by writing cMsgMessage.toString() output.
|
cMsgMessageFull(java.lang.String XML)
Constructor using XML string generated by cMsgMessage.toString().
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clone this object.
|
void |
compressPayload()
If this message is expanded (has items in its payload hashmap),
then unexpand or compress the payload by removing all payload hashmap items.
|
cMsgMessageFull |
copy()
Creates a complete copy of this message.
|
static cMsgMessageFull |
createDeliverableMessage()
Creates a deliverable message with blank fields so no NullPointerExceptions
are thrown when creating a message in a subdomain that is delivered to the
client.
|
void |
expandPayload()
If this message is unexpanded (has a non-null payloadText field but
no items in its payload hashmap), then expand the payload text into
a hashmap containing all cMsgPayloadItems.
|
boolean |
isExpandedPayload()
Does this message have a payload that consists of objects in a hashmap
(ie.
|
boolean |
isNullGetServerResponse()
Is this message a result of the local server having no subscribers
to the send part of a sendAndGet?
|
void |
makeNullResponse(cMsgMessageFull msg)
Converts existing message to null response of supplied message.
|
void |
makeResponse(cMsgMessageFull msg)
Converts existing message to response of supplied message.
|
cMsgMessageFull |
nullResponse()
Creates a proper response message to this message which was sent by a client calling
sendAndGet.
|
static cMsgMessage |
parseXml(java.lang.String XML)
This method parses an XML string representing a cMsg message
(using a DOM parser) and turns it into a cMsg message.
|
cMsgMessageFull |
response()
Creates a proper response message to this message which was sent by a client calling
sendAndGet.
|
void |
setContext(cMsgMessageContextInterface context)
Sets the object containing information about the context of the
callback receiving this message.
|
void |
setDomain(java.lang.String domain)
Set domain this message exists in.
|
void |
setExpandedPayload(boolean ep)
Set the "expanded-payload" bit of a message.
|
int |
setFieldsFromText(java.lang.String text,
int flag)
This method takes a string representation of the whole compound payload,
including the system (hidden) fields of the message,
as it gets sent over the network and converts it into the standard message
payload.
|
void |
setGetRequest(boolean getRequest)
Specify whether this message is a "sendAndGet" request.
|
void |
setInfo(int info)
Set the info member.
|
void |
setNoHistoryAdditions(boolean noHistoryAdditions)
Sets the message to NOT record sender history if arg is true,
even if the history length max is not exceeded.
|
void |
setNullGetServerResponse(boolean ngsr)
Set the "nullGetServerResponse" bit of a message.
|
void |
setPayloadText(java.lang.String payloadText)
Sets the String representation of the compound payload of this message.
|
void |
setReceiver(java.lang.String receiver)
Set message receiver.
|
void |
setReceiverHost(java.lang.String receiverHost)
Set message receiver's host computer.
|
void |
setReceiverTime(java.util.Date time)
Set time message was receivered.
|
void |
setSender(java.lang.String sender)
Set message sender.
|
void |
setSenderHost(java.lang.String senderHost)
Set message sender's host computer.
|
void |
setSenderTime(java.util.Date time)
Set time message was sent.
|
void |
setSenderToken(int senderToken)
Set sender's token.
|
void |
setSysMsgId(int sysMsgId)
Set system intVal of message.
|
void |
setVersion(int version)
Sets the version number of this message.
|
addHistoryToPayloadText, addPayloadItem, clearPayload, copy, copyPayload, getByteArray, getByteArrayEndian, getByteArrayLength, getByteArrayLengthFull, getByteArrayOffset, getContext, getDomain, getHistoryLengthMax, getInfo, getItemsText, getPayloadItem, getPayloadItems, getPayloadNames, getPayloadSize, getPayloadText, getReceiver, getReceiverHost, getReceiverTime, getReliableSend, getSender, getSenderHost, getSenderTime, getSenderToken, getSubject, getSysMsgId, getText, getType, getUserInt, getUserTime, getVersion, hasPayload, hasPayload, isGetRequest, isGetResponse, isNullGetResponse, makeNullResponse, makeResponse, needToSwap, noHistoryAdditions, payloadPrintout, payloadToString, removePayloadItem, removePayloadItem, resetByteArrayLength, resetPayload, setByteArray, setByteArray, setByteArray, setByteArrayEndian, setByteArrayLength, setByteArrayNoCopy, setByteArrayNoCopy, setByteArrayOffset, setGetResponse, setHistoryLengthMax, setNullGetResponse, setReliableSend, setSubject, setText, setType, setUserInt, setUserTime, setUserTime, toString, toString, updatePayloadText
public cMsgMessageFull()
public cMsgMessageFull(cMsgMessage m)
m
- regular message to create a full message frompublic cMsgMessageFull(java.lang.String XML) throws cMsgException
XML
- XML stringcMsgException
- if trouble parsing stringpublic cMsgMessageFull(java.io.File file) throws cMsgException
file
- file containing XML description of messagecMsgException
- if trouble reading file or parsing file contentspublic static cMsgMessageFull createDeliverableMessage()
public static cMsgMessage parseXml(java.lang.String XML) throws cMsgException
XML
- xml string representation of cMsg messagecMsgException
- problems parsing XMLpublic java.lang.Object clone()
clone
in class cMsgMessage
public cMsgMessageFull copy()
copy
in class cMsgMessage
public cMsgMessageFull response() throws cMsgException
response
in class cMsgMessage
cMsgException
- if this message was not sent from a "sendAndGet" method callpublic cMsgMessageFull nullResponse() throws cMsgException
nullResponse
in class cMsgMessage
cMsgException
- if this message was not sent from a "sendAndGet" method callpublic void makeResponse(cMsgMessageFull msg)
msg
- message this message will be made a response topublic void makeNullResponse(cMsgMessageFull msg)
msg
- message this message will be made a null response topublic void setSysMsgId(int sysMsgId)
sysMsgId
- system intVal of message.public void setDomain(java.lang.String domain)
domain
- domain this message exists in.public void setGetRequest(boolean getRequest)
getRequest
- true if this message is a "sendAndGet" requestpublic void setInfo(int info)
info
- value of info memberpublic void setVersion(int version)
cMsgConstants.version
.version
- version number of messagepublic void setSender(java.lang.String sender)
sender
- message sender.public void setSenderHost(java.lang.String senderHost)
senderHost
- message sender's host computer.public void setSenderTime(java.util.Date time)
time
- time message sent.public void setSenderToken(int senderToken)
senderToken
- sender's token.public void setReceiver(java.lang.String receiver)
receiver
- message receiver.public void setReceiverHost(java.lang.String receiverHost)
receiverHost
- message receiver's host computer.public void setReceiverTime(java.util.Date time)
time
- time message received.public void setContext(cMsgMessageContextInterface context)
context
- object containing information about the context of the
callback receiving this messagepublic void setNoHistoryAdditions(boolean noHistoryAdditions)
noHistoryAdditions
- if true the message does NOT record sender historypublic void setPayloadText(java.lang.String payloadText)
payloadText
- payloadText of this message.public boolean isNullGetServerResponse()
cMsgMessage.isNullGetServerResponse()
available to others.isNullGetServerResponse
in class cMsgMessage
public void setNullGetServerResponse(boolean ngsr)
cMsgMessage.setNullGetServerResponse(boolean)
available to others.setNullGetServerResponse
in class cMsgMessage
ngsr
- boolean which is true if msg is result of the local server
having no subscribers to the send part of a sendAndGet, else false.public boolean isExpandedPayload()
cMsgMessage.isExpandedPayload()
available to others.isExpandedPayload
in class cMsgMessage
public void setExpandedPayload(boolean ep)
setExpandedPayload
in class cMsgMessage
ep
- boolean which is true if msg has an expanded payload, else falsecMsgMessage.setExpandedPayload(boolean)
available to others.public void expandPayload()
cMsgMessage.expandPayload()
available to others.expandPayload
in class cMsgMessage
public void compressPayload()
public int setFieldsFromText(java.lang.String text, int flag) throws cMsgException
cMsgMessage.setFieldsFromText(java.lang.String, int)
available to others.setFieldsFromText
in class cMsgMessage
text
- string sent over network to be unmarshalledflag
- if cMsgMessage.systemFieldsOnly
, set system msg fields only,
if cMsgMessage.payloadFieldsOnly
set payload msg fields only,
and if cMsgMessage.allFields
set bothcMsgException
- if the text is in a bad format or the text arg is null