public class JSONHTTPFramer extends HTTPFramer
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 and Description |
---|
JSONHTTPFramer(Trace appTrace)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
makeBadURLReply, makeConnectReply, makeDisconnectReply, makeSequenceErrorReply, makeXmitReply
public JSONHTTPFramer(Trace appTrace)
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 HTTPFramer
message
- 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 HTTPFramer
body
- The HTTP message body in question.Copyright © 2017. All rights reserved.