protected void definePayload() { definePayload(null,0,0,0); }
/** * * @param graphManager * @param inputs _in_ Input pipes with HTTPRequestSchema * @param outputs _out_ Output pipes as several ServerResponseSchema * @param httpSpec * @param otherInputs _in_ Multiple other input pipes to respond to */ public ByteArrayPayloadResponseStage(GraphManager graphManager, Pipe<HTTPRequestSchema>[] inputs, Pipe<ServerResponseSchema>[] outputs, HTTPSpecification<T, R, V, H> httpSpec, Pipe[] otherInputs) { super(graphManager, join(inputs,otherInputs), outputs); this.httpSpec = httpSpec; this.inputs = inputs; this.outputs = outputs; this.graphManager = graphManager; assert(inputs.length == inputs.length); }
payloadLength = -1; status = 200; byte[] etagBytes = payload(graphManager, params, verb); //should return error and take args? assert(payloadLength>=0) : "definePayload must be called by payload"; int length = prefixCount()+payloadLength+suffixCount(); contentType(), length, isChunked, isServer, appendPrefix(PipeWriter.outputStream(output)); appendRemainingPayload(output);
@Override public void run() { while ((activeChannelId != -1) && (null!=activeOutput) && PipeWriter.hasRoomForWrite(activeOutput) ) { PipeWriter.presumeWriteFragment(activeOutput, ServerResponseSchema.MSG_TOCHANNEL_100); PipeWriter.writeLong(activeOutput,ServerResponseSchema.MSG_TOCHANNEL_100_FIELD_CHANNELID_21, activeChannelId); PipeWriter.writeInt(activeOutput,ServerResponseSchema.MSG_TOCHANNEL_100_FIELD_SEQUENCENO_23, activeSequenceNo); DataOutputBlobWriter<ServerResponseSchema> outputStream = PipeWriter.outputStream(activeOutput); DataOutputBlobWriter.openField(outputStream); appendRemainingPayload(activeOutput); } //only do when previous is complete. if (null == activeOutput) { int i = this.inputs.length; while ((--i >= 0) && (activeChannelId == -1)) { process(inputs[i], outputs[i]); } } }
(outputStream.remaining()-suffixCount()) )) >= 1) { if (sendLength>0) { appendSuffix(outputStream);
if (!sendResponse(output, fieldRevision, paramStream, (HTTPVerbDefaults)httpSpec.verbs[fieldVerb])) {