|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.elkoserver.foundation.net.HTTPFramer
org.elkoserver.foundation.actor.JSONHTTPFramer
public class JSONHTTPFramer
HTTP message framer for JSON messages transported via HTTP.
This class treats the content of each HTTP POST to the /xmit/ URL as a bundle of one or more JSON messages to be handled.
| Constructor Summary | |
|---|---|
JSONHTTPFramer(Trace appTrace)
Constructor. |
|
| Method Summary | |
|---|---|
String |
makeSelectReplySegment(Object message,
int seqNumber,
boolean start,
boolean end)
Produce the HTTP for responding to an HTTP GET of the /select/ URL by sending a message to the client. |
Iterator |
postBodyUnpacker(String body)
Get an iterator that can extract the JSON message or messages (if any) from the body of an HTTP message. |
| Methods inherited from class org.elkoserver.foundation.net.HTTPFramer |
|---|
makeBadURLReply, makeConnectReply, makeDisconnectReply, makeSequenceErrorReply, makeXmitReply |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JSONHTTPFramer(Trace appTrace)
| Method Detail |
|---|
public String makeSelectReplySegment(Object message,
int seqNumber,
boolean start,
boolean end)
The actual HTTP reply body sent is constructed by concatenating the results of one or more coordinated calls to this method, one call for each message that is to be sent. In the first of these calls, the 'start' flag must be true. In the last, the 'end' flag must be true. (If only one message is being sent, this method should be called exactly once with both 'start' and 'end' set to true.)
makeSelectReplySegment in class HTTPFramermessage - The message to be sent.seqNumber - The sequence number for the next select request.start - true if this message is the first in a batch of messages.end - true if this message is the last in a batch of messages.
public Iterator postBodyUnpacker(String body)
postBodyUnpacker in class HTTPFramerbody - The HTTP message body in question.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||