public void handleOutbound(Context ctx) throws ServletException, IOException {
Payload payload = ctx.getPayload();
HttpServletRequest request = ctx.getHttpServletRequest();
HttpServletResponse response = ctx.getHttpServletResponse();
MonitorEntity entity = new MonitorEntity();
String userIp = m_util.getRemoteIp(request);
if (userIp != null) {
String errorCode = payload.getErrorCode();
String httpStatus = payload.getHttpStatus();
Cat.logEvent("ip", "hit", Event.SUCCESS, userIp);
entity.setDuration(payload.getDuration());
entity.setErrorCode(errorCode);
entity.setHttpStatus(httpStatus);
entity.setIp(userIp);
entity.setTargetUrl(payload.getTargetUrl());
entity.setTimestamp(System.currentTimeMillis());
m_manager.offer(entity);
} else {
Cat.logEvent("unknownIp", "single", Event.SUCCESS, null);
m_logger.info("unknown http request, x-forwarded-for:" + request.getHeader("x-forwarded-for"));
}