Package org.apache.abdera.protocol.server

Examples of org.apache.abdera.protocol.server.ResponseContext


  }
 
  public ResponseContext filter(
    RequestContext request,
    FilterChain chain) {
      ResponseContext response = super.filter(request,chain);
      DHContext context = getDHContext(request);
      response.setHeader(
        Constants.CONTENT_ENCRYPTED,
        context.getResponseString());
      return response;
  }
View Full Code Here


    RequestContext request) {}

  public ResponseContext filter(
    RequestContext request,
    FilterChain chain) {
      ResponseContext response = super.filter(request, chain);
      String method = request.getMethod();
      // include a Accept-Encryption header in the response to GET, HEAD and OPTIONS requests
      // the header will specify all the information the client needs to construct
      // it's own DH context and encrypt the request
      if ("GET".equalsIgnoreCase(method) ||
          "HEAD".equalsIgnoreCase(method) ||
          "OPTIONS".equalsIgnoreCase(method)) {
        DHContext context =
          (DHContext) request.getAttribute(
            Scope.SESSION,
            "dhcontext");
        if (context == null) {
          context = new DHContext();
          request.setAttribute(Scope.SESSION, "dhcontext", context);
        }
        response.setHeader(
          Constants.ACCEPT_ENCRYPTION,
          context.getRequestString());
      }
      return response;
  }
View Full Code Here

* parameter
*/
public class JSONFilter implements Filter {

    public ResponseContext filter(RequestContext request, FilterChain chain) {
        ResponseContext resp = chain.next(request);
        String format = request.getParameter("format");
        return (resp.getContentType() != null && jsonPreferred(request, resp.getContentType().toString())) || (format != null && format
            .equalsIgnoreCase("json")) ? new JsonResponseContext(resp, request.getAbdera()) : resp;
    }
View Full Code Here

                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.getEntry(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processEntry(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.postEntry(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processEntry(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.putEntry(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processEntry(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.deleteEntry(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processEntry(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.headEntry(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processEntry(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

                EasyMock.replay(requestMock);
               
                EasyMock.expect(adapterMock.optionsEntry(requestMock)).andReturn(responseMock);
                EasyMock.replay(adapterMock);
               
                ResponseContext response = processor.processEntry(requestMock, adapterMock);
                assertNotNull(response);
        }
View Full Code Here

    public ResponseContext search(RequestContext request, Map<String, String> parameters) {
        List<T> searchResults = this.doSearch(request, parameters);
        Feed feed = this.createFeed(request, parameters, searchResults);
        Document<Feed> document = feed.getDocument();
        ResponseContext response = new BaseResponseContext<Document<Feed>>(document);
        return response;
    }
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.server.ResponseContext

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.