JPT Message object
Message class is widely used in jpt.
Message object is being used in
all brower based communication, that means all communications except
tracker annoucement will all use this class to transmit information between server and client.
For any client that want to communicate with server, please read this document carefully before implementing your own data receiver.
There are only two kinds of messages, either
FAIL, no more.
The Java class is like
GSON to serialize the object, so the corresponding JSON will be:
For any requests that not only go through the whole procedure without any error, but also achieved what it requested, server will return a message with
In some cases, a SUCCESS message will not contain data field. But most of the cases will contain data field with specific data object.
For instance, a SUCCESSed request for adding a thread will return the persisted target thread content, in which its related beans like user and parent post will also be embeded.
For all other cases, server will return a message with
In most of the situation, message with
FAIL will not contain
For instance a FAILed request for adding a thread will return the reason of failing the request.
- If contain data field, there might have nested information embeded in the out-most bean. This is for accelerate the request in case of doing redundant request for directly related bean. For detailed bean structure, please refer to entity.
- All request except
Messageobject. If you get something else, there must be cracker in between client and server.