use of org.apache.synapse.transport.nhttp.Axis2HttpRequest in project wso2-synapse by wso2.
the class ClientConnectionDebug method recordRequestStartTime.
public void recordRequestStartTime(NHttpClientConnection conn, Axis2HttpRequest axis2Req) {
if (conn != null) {
this.connectionCreationTime = (Long) conn.getContext().getAttribute(ClientHandler.CONNECTION_CREATION_TIME);
try {
HttpRequest request = axis2Req.getRequest();
RequestLine requestLine = request.getRequestLine();
this.lastRequestProtocol = requestLine.getProtocolVersion().toString();
this.lastRequestHTTPMethod = requestLine.getMethod();
this.headers = request.getAllHeaders();
} catch (IOException ignore) {
} catch (HttpException ignore) {
}
}
if (this.lastRequestStartTime != 0) {
if (previousRequestAttempts == null) {
previousRequestAttempts = new StringBuffer();
} else {
previousRequestAttempts.append(fieldSeparator);
}
previousRequestAttempts.append("Attempt-Info").append(keyValueSeparator).append("{");
previousRequestAttempts.append("Req-Start-Time").append(keyValueSeparator).append(format(this.lastRequestStartTime));
previousRequestAttempts.append(fieldSeparator);
previousRequestAttempts.append("Req-URL").append(keyValueSeparator).append(this.lastRequestEPR).append("}");
}
this.lastRequestStartTime = System.currentTimeMillis();
this.lastRequestEPR = axis2Req.getEpr().toString();
}
Aggregations