Class ESMockAPIBasedRepositoryIntegTestCase.HttpStatsCollectorHandler

java.lang.Object
org.elasticsearch.repositories.blobstore.ESMockAPIBasedRepositoryIntegTestCase.HttpStatsCollectorHandler
All Implemented Interfaces:
com.sun.net.httpserver.HttpHandler, ESMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler
Enclosing class:
ESMockAPIBasedRepositoryIntegTestCase

public abstract static class ESMockAPIBasedRepositoryIntegTestCase.HttpStatsCollectorHandler
extends java.lang.Object
implements ESMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler
HTTP handler that allows collect request stats per request type. Implementors should keep track of the desired requests on maybeTrack(String, Headers).
  • Constructor Summary

    Constructors 
    Constructor Description
    HttpStatsCollectorHandler​(com.sun.net.httpserver.HttpHandler delegate)  
  • Method Summary

    Modifier and Type Method Description
    com.sun.net.httpserver.HttpHandler getDelegate()  
    void handle​(com.sun.net.httpserver.HttpExchange exchange)  
    protected abstract void maybeTrack​(java.lang.String request, com.sun.net.httpserver.Headers requestHeaders)
    Tracks the given request if it matches the criteria.
    protected void trackRequest​(java.lang.String requestType)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getDelegate

      public com.sun.net.httpserver.HttpHandler getDelegate()
      Specified by:
      getDelegate in interface ESMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler
    • trackRequest

      protected void trackRequest​(java.lang.String requestType)
    • handle

      public void handle​(com.sun.net.httpserver.HttpExchange exchange) throws java.io.IOException
      Specified by:
      handle in interface com.sun.net.httpserver.HttpHandler
      Throws:
      java.io.IOException
    • maybeTrack

      protected abstract void maybeTrack​(java.lang.String request, com.sun.net.httpserver.Headers requestHeaders)
      Tracks the given request if it matches the criteria. The request is represented as: Request = Method SP Request-URI
      Parameters:
      request - the request to be tracked if it matches the criteria
      requestHeaders - the http request headers