@Override protected void fillHttpOutputData(Schema httpOutputSchema, GenericRecord outputRecord, HttpUriRequest rawRequest, ResponseStatus status) throws IOException { ApacheHttpResponseStatus apacheStatus = (ApacheHttpResponseStatus) status; HttpRequestResponseRecord record = new HttpRequestResponseRecord(); record.setRequestUrl(rawRequest.getURI().toASCIIString()); record.setMethod(rawRequest.getMethod()); record.setStatusCode(apacheStatus.getStatusCode()); record.setContentType(apacheStatus.getContentType()); record.setBody(apacheStatus.getContent() == null? null: ByteBuffer.wrap(apacheStatus.getContent())); outputRecord.put(HTTP_REQUEST_RESPONSE_FIELD, record); } }
@Override protected void fillHttpOutputData(Schema schema, GenericRecord outputRecord, RestRequest restRequest, ResponseStatus status) throws IOException { R2ResponseStatus r2ResponseStatus = (R2ResponseStatus) status; HttpRequestResponseRecord record = new HttpRequestResponseRecord(); record.setRequestUrl(restRequest.getURI().toASCIIString()); record.setMethod(restRequest.getMethod()); record.setStatusCode(r2ResponseStatus.getStatusCode()); record.setContentType(r2ResponseStatus.getContentType()); record.setBody(r2ResponseStatus.getContent() == null? null: r2ResponseStatus.getContent().asByteBuffer()); outputRecord.put("HttpRequestResponse", record); }
@Override public HttpRequestResponseRecord build() { try { HttpRequestResponseRecord record = new HttpRequestResponseRecord(); record.requestUrl = fieldSetFlags()[0] ? this.requestUrl : (java.lang.String) defaultValue(fields()[0]); record.method = fieldSetFlags()[1] ? this.method : (java.lang.String) defaultValue(fields()[1]); record.contentType = fieldSetFlags()[2] ? this.contentType : (java.lang.String) defaultValue(fields()[2]); record.statusCode = fieldSetFlags()[3] ? this.statusCode : (java.lang.Integer) defaultValue(fields()[3]); record.body = fieldSetFlags()[4] ? this.body : (java.nio.ByteBuffer) defaultValue(fields()[4]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
@Override protected void fillHttpOutputData(Schema httpOutputSchema, GenericRecord outputRecord, HttpUriRequest rawRequest, ResponseStatus status) throws IOException { ApacheHttpResponseStatus apacheStatus = (ApacheHttpResponseStatus) status; HttpRequestResponseRecord record = new HttpRequestResponseRecord(); record.setRequestUrl(rawRequest.getURI().toASCIIString()); record.setMethod(rawRequest.getMethod()); record.setStatusCode(apacheStatus.getStatusCode()); record.setContentType(apacheStatus.getContentType()); record.setBody(apacheStatus.getContent() == null? null: ByteBuffer.wrap(apacheStatus.getContent())); outputRecord.put(HTTP_REQUEST_RESPONSE_FIELD, record); } }
@Override protected void fillHttpOutputData(Schema schema, GenericRecord outputRecord, RestRequest restRequest, ResponseStatus status) throws IOException { R2ResponseStatus r2ResponseStatus = (R2ResponseStatus) status; HttpRequestResponseRecord record = new HttpRequestResponseRecord(); record.setRequestUrl(restRequest.getURI().toASCIIString()); record.setMethod(restRequest.getMethod()); record.setStatusCode(r2ResponseStatus.getStatusCode()); record.setContentType(r2ResponseStatus.getContentType()); record.setBody(r2ResponseStatus.getContent() == null? null: r2ResponseStatus.getContent().asByteBuffer()); outputRecord.put("HttpRequestResponse", record); }
@Override public HttpRequestResponseRecord build() { try { HttpRequestResponseRecord record = new HttpRequestResponseRecord(); record.requestUrl = fieldSetFlags()[0] ? this.requestUrl : (java.lang.String) defaultValue(fields()[0]); record.method = fieldSetFlags()[1] ? this.method : (java.lang.String) defaultValue(fields()[1]); record.contentType = fieldSetFlags()[2] ? this.contentType : (java.lang.String) defaultValue(fields()[2]); record.statusCode = fieldSetFlags()[3] ? this.statusCode : (java.lang.Integer) defaultValue(fields()[3]); record.body = fieldSetFlags()[4] ? this.body : (java.nio.ByteBuffer) defaultValue(fields()[4]); return record; } catch (Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }