Class ESMockAPIBasedRepositoryIntegTestCase.ErroneousHttpHandler
java.lang.Object
org.elasticsearch.repositories.blobstore.ESMockAPIBasedRepositoryIntegTestCase.ErroneousHttpHandler
- All Implemented Interfaces:
com.sun.net.httpserver.HttpHandler
,ESMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler
- Enclosing class:
- ESMockAPIBasedRepositoryIntegTestCase
protected abstract static class ESMockAPIBasedRepositoryIntegTestCase.ErroneousHttpHandler extends java.lang.Object implements ESMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler
HTTP handler that injects random service errors
Note: it is not a good idea to allow this handler to simulate too many errors as it would
slow down the test suite.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ErroneousHttpHandler(com.sun.net.httpserver.HttpHandler delegate, int maxErrorsPerRequest)
-
Method Summary
Modifier and Type Method Description protected boolean
canFailRequest(com.sun.net.httpserver.HttpExchange exchange)
com.sun.net.httpserver.HttpHandler
getDelegate()
void
handle(com.sun.net.httpserver.HttpExchange exchange)
protected void
handleAsError(com.sun.net.httpserver.HttpExchange exchange)
protected abstract java.lang.String
requestUniqueId(com.sun.net.httpserver.HttpExchange exchange)
-
Constructor Details
-
ErroneousHttpHandler
protected ErroneousHttpHandler(com.sun.net.httpserver.HttpHandler delegate, int maxErrorsPerRequest)
-
-
Method Details
-
handle
public void handle(com.sun.net.httpserver.HttpExchange exchange) throws java.io.IOException- Specified by:
handle
in interfacecom.sun.net.httpserver.HttpHandler
- Throws:
java.io.IOException
-
handleAsError
protected void handleAsError(com.sun.net.httpserver.HttpExchange exchange) throws java.io.IOException- Throws:
java.io.IOException
-
requestUniqueId
protected abstract java.lang.String requestUniqueId(com.sun.net.httpserver.HttpExchange exchange) -
canFailRequest
protected boolean canFailRequest(com.sun.net.httpserver.HttpExchange exchange) -
getDelegate
public com.sun.net.httpserver.HttpHandler getDelegate()- Specified by:
getDelegate
in interfaceESMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler
-