@Signature public void attribute(String name, Object value) { request.setAttribute(name, value); }
String value = matcher.group(1); request.getRequest().setAttribute(name, value);
@Override public void handle(final String target, final Request baseRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { try { baseRequest.setHandled(true); String type = baseRequest.getContentType(); boolean multipart = false; if (type != null && type.toLowerCase().startsWith(MediaType.multipart.name())) { baseRequest.setAttribute(Request.__MULTIPART_CONFIG_ELEMENT, multiPartConfig); multipart = true; } ServletServletRequest nreq = new ServletServletRequest(request, tmpdir, multipart) .with(upgrade(baseRequest, request, response, webSocketServerFactory)); dispatcher.handle(nreq, new JettyResponse(nreq, response)); } catch (IOException | ServletException | RuntimeException ex) { baseRequest.setHandled(false); log.error("execution of: " + target + " resulted in error", ex); throw ex; } catch (Throwable ex) { baseRequest.setHandled(false); log.error("execution of: " + target + " resulted in error", ex); throw new IllegalStateException(ex); } }
@Override public void doHandle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (isMultipartRequest(request)) { baseRequest.setAttribute(Request.__MULTIPART_CONFIG_ELEMENT, multipartConfig); } super.doHandle(target, baseRequest, request, response); }
@Override public void onRequestBegin(Request request) { request.setAttribute(REQUEST_BEGIN_ATTRIBUTE, System.nanoTime()); }
@Override public void onResponseBegin(Request request) { request.setAttribute(RESPONSE_CONTENT_TIMESTAMPS_ATTRIBUTE, new ArrayList<Long>()); }
@Override public void onRequestBegin(Request request) { request.setAttribute(REQUEST_BEGIN_ATTRIBUTE, System.nanoTime()); }
public void parsedRequestAttribute(String key, int value) throws IOException { _request.setAttribute(key, Integer.toString(value)); }
public void parsedSslSession(Buffer sslSession) throws IOException { _request.setAttribute("javax.servlet.request.ssl_session", sslSession.toString()); }
public void parsedRequestAttribute(String key, Buffer value) throws IOException { if (value==null) _request.removeAttribute(key); else _request.setAttribute(key,value.toString()); }
/** * @see org.eclipse.jetty.continuation.Continuation#setAttribute(java.lang.String, java.lang.Object) */ public void setAttribute(String name, Object attribute) { _connection.getRequest().setAttribute(name,attribute); }
@SuppressWarnings("unchecked") @Override public void onRequestEnd(Request request) { long requestBeginTime = (Long) request.getAttribute(REQUEST_BEGIN_ATTRIBUTE); request.setAttribute(REQUEST_BEGIN_TO_END_ATTRIBUTE, System.nanoTime() - requestBeginTime); }
/** * @see org.eclipse.jetty.continuation.Continuation#setAttribute(java.lang.String, java.lang.Object) */ public void setAttribute(String name, Object attribute) { _connection.getRequest().setAttribute(name,attribute); }
/** * @see org.eclipse.jetty.continuation.Continuation#setAttribute(java.lang.String, java.lang.Object) */ public void setAttribute(String name, Object attribute) { _connection.getRequest().setAttribute(name,attribute); }
@Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // add the repository provide to the request attributes if (LOGGER.isDebugEnabled()) { LOGGER.debug("Setting RepositoryProvider on Request to: " + repoProvider); } baseRequest.setAttribute(RepositoryProvider.KEY, repoProvider); // now let the delegate handle it super.handle(target, baseRequest, request, response); }
@SuppressWarnings("unchecked") @Override public void onBeforeDispatch(Request request) { long requestBeginTime = (Long) request.getAttribute(REQUEST_BEGIN_ATTRIBUTE); request.setAttribute(REQUEST_BEGIN_TO_DISPATCH_ATTRIBUTE, System.nanoTime() - requestBeginTime); }
@SuppressWarnings("unchecked") @Override public void onBeforeDispatch(Request request) { long requestBeginTime = (Long) request.getAttribute(REQUEST_BEGIN_ATTRIBUTE); request.setAttribute(REQUEST_BEGIN_TO_DISPATCH_ATTRIBUTE, System.nanoTime() - requestBeginTime); }
@Override protected void completeBearerAuthentication(KeycloakPrincipal<RefreshableKeycloakSecurityContext> principal, String method) { this.principal = principal; RefreshableKeycloakSecurityContext securityContext = principal.getKeycloakSecurityContext(); Set<String> roles = AdapterUtils.getRolesFromSecurityContext(securityContext); if (log.isDebugEnabled()) { log.debug("Completing bearer authentication. Bearer roles: " + roles); } request.setAttribute(KeycloakSecurityContext.class.getName(), securityContext); }
protected Authentication register(Request request, KeycloakPrincipal<RefreshableKeycloakSecurityContext> principal) { request.setAttribute(AdapterDeploymentContext.class.getName(), deploymentContext); Authentication authentication = request.getAuthentication(); if (!(authentication instanceof KeycloakAuthentication)) { UserIdentity userIdentity = createIdentity(principal); authentication = createAuthentication(userIdentity, request); request.setAuthentication(authentication); } return authentication; }
protected Authentication register(Request request, KeycloakPrincipal<RefreshableKeycloakSecurityContext> principal) { request.setAttribute(AdapterDeploymentContext.class.getName(), deploymentContext); Authentication authentication = request.getAuthentication(); if (!(authentication instanceof KeycloakAuthentication)) { UserIdentity userIdentity = createIdentity(principal); authentication = createAuthentication(userIdentity, request); request.setAuthentication(authentication); } return authentication; }