public static AccessLog create(H.Request req) { AccessLog log = new AccessLog(); log.method = req.method(); log.url = req.url(); log.remoteAddress = req.ip(); log.userAgent = req.userAgentStr(); log.time = DateTime.now().toString(); return log; }
public static AccessLog create(H.Request req) { AccessLog log = new AccessLog(); log.method = req.method(); log.url = req.url(); log.remoteAddress = req.ip(); log.userAgent = req.userAgentStr(); log.time = DateTime.now().toString(); return log; }
} else { session.remove(KEY_EXPIRE_INDICATOR); boolean skipUpdateExpiration = S.eq(pingPath, request.url()); if (skipUpdateExpiration) { newTimestamp = oldTimestamp;
final WebSocketContext wsCtx = new WebSocketContext(req.url(), connection, connectionManager, context, connectionManager.app()); if (logger.isTraceEnabled()) { logger.trace("websocket context[%s] created for %s", connection.sessionId(), context.req().url());
} else { session.remove(KEY_EXPIRE_INDICATOR); boolean skipUpdateExpiration = S.eq(pingPath, request.url()); if (skipUpdateExpiration) { newTimestamp = oldTimestamp;
final WebSocketContext wsCtx = new WebSocketContext(req.url(), connection, connectionManager, context, connectionManager.app()); if (logger.isTraceEnabled()) { logger.trace("websocket context[%s] created for %s", connection.sessionId(), context.req().url());
protected String amendSuffix(String path, ActContext context) { if (path.contains(".")) { return path; } H.Format fmt = context.accept(); if (UNKNOWN == fmt) { fmt = HTML; } if (isAcceptFormatSupported(fmt)) { return S.concat(path, ".", fmt.name()); } if (context instanceof ActionContext) { ActionContext actionContext = $.cast(context); H.Request req = actionContext.req(); throw E.unsupport("Error handling %s request to %s - Request accept not supported: %s", req.method(), req.url(), fmt); } throw E.unsupport("Request accept not supported: %s", fmt); }
protected String amendSuffix(String path, ActContext context) { if (path.contains(".")) { return path; } H.Format fmt = context.accept(); if (UNKNOWN == fmt) { fmt = HTML; } if (isAcceptFormatSupported(fmt)) { return S.concat(path, ".", fmt.name()); } if (context instanceof ActionContext) { ActionContext actionContext = $.cast(context); H.Request req = actionContext.req(); throw E.unsupport("Error handling %s request to %s - Request accept not supported: %s", req.method(), req.url(), fmt); } throw E.unsupport("Request accept not supported: %s", fmt); }
private void cacheUrl(ActionContext context) { String url = context.req().url(); context.cache(KEY_REFERER, url, 60 * 5); }
/** * Return a {@link UrlPath} of this context. * * Note this method is used only by {@link Router} for dynamic path * matching. * * @return a {@link UrlPath} of this context */ public UrlPath urlPath() { if (null == urlPath) { urlPath = UrlPath.of(null == processedUrl ? req().url() : processedUrl); } return urlPath; }
private String processedUrl() { return null == processedUrl ? req().url() : processedUrl; }
/** * Return a {@link UrlPath} of this context. * * Note this method is used only by {@link Router} for dynamic path * matching. * * @return a {@link UrlPath} of this context */ public UrlPath urlPath() { if (null == urlPath) { urlPath = UrlPath.of(null == processedUrl ? req().url() : processedUrl); } return urlPath; }
private void cacheUrl(ActionContext context) { String url = context.req().url(); context.cache(KEY_REFERER, url, 60 * 5); }
public void registerNewConnection(WebSocketConnection connection, ActionContext context) { bySessionId.register(context.session().id(), connection); String username = context.username(); if (null == username) { username = context.paramVal(wsTicketKey); } if (null != username) { byUsername.register(username, connection); } String url = context.req().url(); byUrl.register(url, connection); }
public static RouteInfo of(ActionContext context) { H.Method m = context.req().method(); String path = context.req().url(); RequestHandler handler = context.handler(); if (null == handler) { handler = UNKNOWN_HANDLER; } return new RouteInfo(m, path, handler); }
private String processedUrl() { return null == processedUrl ? req().url() : processedUrl; }
private String cacheKey(ActionContext context) { H.Request req = context.req(); return S.concat(req.method(), req.url(), req.ip()); } }
public void registerNewConnection(WebSocketConnection connection, ActionContext context) { bySessionId.register(context.session().id(), connection); String username = context.username(); if (null == username) { username = context.paramVal(wsTicketKey); } if (null != username) { byUsername.register(username, connection); } String url = context.req().url(); byUrl.register(url, connection); }
private String cacheKey(ActionContext context) { H.Request req = context.req(); return S.concat(req.method(), req.url(), req.ip()); } }
public static RouteInfo of(ActionContext context) { H.Method m = context.req().method(); String path = context.req().url(); RequestHandler handler = context.handler(); if (null == handler) { handler = UNKNOWN_HANDLER; } return new RouteInfo(m, path, handler); }