Package com.linkedin.r2.filter

Examples of com.linkedin.r2.filter.FilterChain


    TransportDispatcher dispatcher = new DelegatingTransportDispatcher(new RestLiServer(config,
                                                                                        resourceFactory,
                                                                                        engine));

    final FilterChain fc = FilterChains.empty().addLast(new SimpleLoggingFilter());
    final HttpServer server = new HttpServerFactory(fc).createServer(port,
                                                               HttpServerFactory.DEFAULT_CONTEXT_PATH,
                                                               NUM_THREADS,
                                                               dispatcher,
                                                               enableAsync,
View Full Code Here


    TransportClient client = getRawClient(properties, sslContext, sslParameters);

    List<String> httpResponseCompressionOperations = ConfigValueExtractor.buildList(properties.remove(HTTP_RESPONSE_COMPRESSION_OPERATIONS),
                                                                                    LIST_SEPARATOR);

    FilterChain filters;
    if (!httpResponseCompressionOperations.isEmpty())
    {
      String requestCompressionSchemaName = buildRequestEncodingSchemaName();
      String responseCompressionSchemaName = buildAcceptEncodingSchemaNames();
      filters = _filters.addLast(new ClientCompressionFilter(requestCompressionSchemaName,
View Full Code Here

  {
    final Request req = request();
    final RestResponse res = new RestResponseBuilder().setStatus(RestStatus.NOT_FOUND).build();

    final CaptureLastCallFilter captureFilter = new CaptureLastCallFilter();
    final FilterChain fc = getFilterChain().addFirst(captureFilter);

    // Record a response for the request we will fire
    getDb().record(req, res);

    // We should be able to fire just the request - the response should be replayed from the
View Full Code Here

{
  @Test
  public void testRpcRequestFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRpcRequest(fc);

    assertRpcCounts    (1, 0, 0, filter);
    assertRestCounts   (0, 0, 0, filter);
View Full Code Here

  @Test
  public void testRpcResponseFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRpcResponse(fc);

    assertRpcCounts    (0, 1, 0, filter);
    assertRestCounts   (0, 0, 0, filter);
View Full Code Here

  @Test
  public void testRpcErrorFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRpcError(fc);

    assertRpcCounts    (0, 0, 1, filter);
    assertRestCounts   (0, 0, 0, filter);
View Full Code Here

  @Test
  public void testRestRequestFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRestRequest(fc);

    assertRpcCounts    (0, 0, 0, filter);
    assertRestCounts   (1, 0, 0, filter);
View Full Code Here

  @Test
  public void testRestResponseFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRestResponse(fc);

    assertRpcCounts    (0, 0, 0, filter);
    assertRestCounts   (0, 1, 0, filter);
View Full Code Here

  @Test
  public void testRestErrorFilter()
  {
    final RpcRestCountFilter filter = new RpcRestCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRestError(fc);

    assertRpcCounts    (0, 0, 0, filter);
    assertRestCounts   (0, 0, 1, filter);
View Full Code Here

  @Test
  public void testRequestFilter()
  {
    final MessageCountFilter filter = new MessageCountFilter();
    final FilterChain fc = FilterChains.create(filter);

    fireRpcRequest(fc);
    assertMessageCounts(1, 0, 0, filter);

    filter.reset();
View Full Code Here

TOP

Related Classes of com.linkedin.r2.filter.FilterChain

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.