Package org.apache.catalina.connector

Examples of org.apache.catalina.connector.Response


   @Override
   public AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject)
   throws AuthException
   {
      Request request = (Request) messageInfo.getRequestMessage();
      Response response = (Response) messageInfo.getResponseMessage();

      Principal principal;
      context = request.getContext();

      X509Certificate certs[] = (X509Certificate[])
      request.getAttribute(CERTIFICATES_ATTR);
      if ((certs == null) || (certs.length < 1)) {
         request.getCoyoteRequest().action
         (ActionCode.ACTION_REQ_SSL_CERTIFICATE, null);
         certs = (X509Certificate[])
         request.getAttribute(CERTIFICATES_ATTR);
      }
      if ((certs == null) || (certs.length < 1)) {
         log.debug("  No certificates included with this request");
         try
         {
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED,
                  sm.getString("authenticator.certificates"));
         }
         catch (IOException e)
         {
            log.error(e.getLocalizedMessage(),e);
         }
         return (AuthStatus.FAILURE);
      }

      // Authenticate the specified certificate chain
      principal = context.getRealm().authenticate(certs);
      if (principal == null) {
         log.debug("  Realm.authenticate() returned false");
         try
         {
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED,
                  sm.getString("authenticator.unauthorized"));
         }
         catch (IOException e)
         {
            log.error(e.getLocalizedMessage(),e);
View Full Code Here


    /**
     * write a specific response header - x-O{xxx}
     */
    protected String responseHeader(Request request,String header) {
        Response response = request.getResponse() ;
        if (null != response) {
            String[] values = response.getHeaderValues(header);
            if(values.length > 0) {
                StringBuffer buf = new StringBuffer();
                for (int i = 0; i < values.length; i++) {
                    String string = values[i];
                    buf.append(string) ;
View Full Code Here

        getTomcatInstance().start();

        MockFilterChain filterChain = new MockFilterChain();

        // TEST
        remoteIpFilter.doFilter(request, new Response(), filterChain);
        return filterChain.getRequest();
    }
View Full Code Here

   {
      Valve valve = setupPipeline(manager, handler);
      MockRequest request = new MockRequest();
      request.setRequestedSessionId(sessionId);
      request.setContext((Context) manager.getContainer());
      Response response = new Response();
      request.setResponse(response);
      valve.invoke(request, response);
      // StandardHostValve calls request.getSession(false) on way out, so we will too
      request.getSession(false);
      request.recycle();
View Full Code Here

      Session session = mgr.createSession(NON_FAILOVER_ID);
      MockRequest req = new MockRequest();
      req.setSession(session.getSession());
      req.setRequestedSessionId(session.getId());
     
      Response res = new Response();
     
      jvmRouteValve.invoke(req, res);
     
      assertSame(req, mockValve.getInvokedRequest());
      assertSame(res, mockValve.getInvokedResponse());
View Full Code Here

      Session session = mgr.createSession(FAILOVER_ID);
      MockRequest req = new MockRequest();
      req.setSession(session.getSession());
      req.setRequestedSessionId(session.getId());
     
      Response res = new Response();
     
      jvmRouteValve.invoke(req, res);
     
      assertSame(req, mockValve.getInvokedRequest());
      assertSame(res, mockValve.getInvokedResponse());
View Full Code Here

      MockRequest req = new MockRequest();
      req.setSession(session.getSession());
      req.setRequestedSessionId(session.getId());
      req.setRequestedSessionIdFromURL(true);
     
      Response res = new Response();
     
      jvmRouteValve.invoke(req, res);
     
      assertSame(req, mockValve.getInvokedRequest());
      assertSame(res, mockValve.getInvokedResponse());
View Full Code Here

      Session session = mgr.createSession(NON_FAILOVER_ID);
      MockRequest req = new MockRequest();
      req.setSession(session.getSession());
      req.setRequestedSessionId(FAILOVER_ID);
     
      Response res = new Response();
     
      jvmRouteValve.invoke(req, res);
     
      assertSame(req, mockValve.getInvokedRequest());
      assertSame(res, mockValve.getInvokedResponse());
View Full Code Here

      MockRequest req = new MockRequest();
      req.setSession(session.getSession());
      req.setRequestedSessionId(FAILOVER_ID);
      req.setRequestedSessionIdFromURL(true);
     
      Response res = new Response();
     
      jvmRouteValve.invoke(req, res);
     
      assertSame(req, mockValve.getInvokedRequest());
      assertSame(res, mockValve.getInvokedResponse());
View Full Code Here

      Session session = mgr.createSession(FAILOVER_ID);
      MockRequest req = new MockRequest();
      req.setSession(session.getSession());
      req.setRequestedSessionId(NON_FAILOVER_ID);
     
      Response res = new Response();
     
      jvmRouteValve.invoke(req, res);
     
      assertSame(req, mockValve.getInvokedRequest());
      assertSame(res, mockValve.getInvokedResponse());
View Full Code Here

TOP

Related Classes of org.apache.catalina.connector.Response

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.