@Override public CompositeRoute path(CharSequence path) { return (null==route) ? this.config.registerCompositeRoute(headers).path(path) : route; }
public static void publishArrayResponse(int requestContext, int sequence, int status, Pipe<ServerResponseSchema> localOutput, long channelId, byte[] typeBytes, int contentLength, byte[] contentBacking, int contentPosition, int contentMask) { int channelIdHigh = (int)(channelId>>32); int channelIdLow = (int)channelId; publishArrayResponse(requestContext, sequence, status, localOutput, channelIdHigh, channelIdLow, typeBytes, contentLength, contentBacking, contentPosition, contentMask); }
private URLTemplateParser routeParser() { //Many projects do not need this so do not build.. if (routeParser==null) { boolean trustText = false; routeParser = new URLTemplateParser(urlMap, trustText); } return routeParser; }
@Override public void write(HeaderWriter writer) { writer.write(HTTPHeaderDefaults.CONNECTION, "closed"); } };
private boolean sendError(final long channel, final int idx, int errorCode) { boolean sent = false; if (Pipe.hasRoomForWrite(errorResponsePipe)) { //will close connection as soon as error is returned. HTTPUtil.publishStatus(channel, sequences[idx], errorCode, errorResponsePipe); sequences[idx]++; sent = true; } sendRelease(channel, idx); return sent; }
public CompositeRoute registerCompositeRoute(HTTPHeader ... headers) { return new CompositeRouteImpl(conStruct, this, null, routeParser(), headers, routeCount++, pathCount); }
@Override public void transform(TrieParserReader templateParserReader, DataOutputBlobWriter<RawDataSchema> outputStream) { activeRouteDef.setIndexCount( convertEncoding(activeRouteDef.getFieldParamParser(), templateParserReader, templateParser, outputStream)); } };
@Override public CompositeRouteFinish refineText(String key, Object associatedObject, String defaultValue) { associatedObject(key,associatedObject); defaultText(key, defaultValue); return this; }
@Override public void write(HeaderWriter writer) { //writer.writeUTF8(HTTPHeaderDefaults.COOKIE, // largeCookie); writer.writeUTF8(HTTPHeaderDefaults.CONTENT_TYPE, contentType); } };
@Override public CompositeRouteFinish refineDecimal(String key, Object associatedObject, long mantissa, byte exponent) { associatedObject(key,associatedObject); defaultDecimal(key, mantissa, exponent); return this; }
@Override public CompositeRouteFinish refineInteger(String key, Object associatedObject, long defaultValue) { associatedObject(key,associatedObject); defaultInteger(key, defaultValue); return this; }
public static void publishStatus(long channelId, int sequence, int status, Pipe<ServerResponseSchema> localOutput) { int channelIdHigh = (int)(channelId>>32); int channelIdLow = (int)channelId; publishStatus(sequence, status, channelIdHigh, channelIdLow, localOutput); }
public static HTTPRequestJSONExtractionStage newInstance(GraphManager graphManager, JSONExtractorCompleted extractor, Pipe<HTTPRequestSchema> input, Pipe<HTTPRequestSchema> output, Pipe<ServerResponseSchema> err) { return new HTTPRequestJSONExtractionStage(graphManager, extractor, input, output,err); }
public void processDefaults(DataOutputBlobWriter<HTTPRequestSchema> writer) { populateDefaults.populate(writer); //TODO: upon contruction confirm that null can not happen in the path if the validator requries it.. //if we have 1 path missing some args and we have no default for that arg, then we need to run validator. }
public static HTTPClientRequestStage newInstance(GraphManager graphManager, ClientCoordinator ccm, Pipe<ClientHTTPRequestSchema>[] input, Pipe<NetPayloadSchema>[] output) { return new HTTPClientRequestStage(graphManager, ccm, input, output); }
private static int endOfHeader(TrieParserReader trieReader, DataOutputBlobWriter<HTTPRequestSchema> writer, ErrorReporter errorReporter2, long arrivalTime, long ccId, int requestContext, long postLength, int iteration) { if (iteration!=0) { //we explicitly set length to zero if it is not provided. return endOfHeadersLogic(writer, errorReporter2, requestContext, trieReader, NO_LENGTH_DEFINED == postLength ? 0 : postLength, arrivalTime, ccId); } else { //needs more data return ServerCoordinator.INCOMPLETE_RESPONSE_MASK; } }
@Override public CompositeRoute path(CharSequence path) { return route = RouteDefinitionImpl.this.config.registerCompositeRoute(ex.finish(), headers).path(path); } }
public static void publishStatus(int sequence, int status, int channelIdHigh, int channelIdLow, Pipe<ServerResponseSchema> localOutput) { int contentLength = 0; byte[] contentBacking = null; int contentPosition = 0; int contentMask = Integer.MAX_VALUE; publishArrayResponse(ServerCoordinator.END_RESPONSE_MASK, sequence, status, localOutput, channelIdHigh, channelIdLow, null, contentLength, contentBacking, contentPosition, contentMask); }
public CompositeRoute registerCompositeRoute(JSONExtractorCompleted extractor, HTTPHeader ... headers) { return new CompositeRouteImpl(conStruct, this, extractor, routeParser(), headers, routeCount++, pathCount); }
public static void publishArrayResponse(int requestContext, int sequence, int status, Pipe<ServerResponseSchema> localOutput, long channelId, byte[] typeBytes, byte[] content) { int channelIdHigh = (int)(channelId>>32); int channelIdLow = (int)channelId; publishArrayResponse(requestContext, sequence, status, localOutput, channelIdHigh, channelIdLow, typeBytes, content); }