Class OpenSearchMockAPIBasedRepositoryIntegTestCase.ErroneousHttpHandler
java.lang.Object
org.opensearch.repositories.blobstore.OpenSearchMockAPIBasedRepositoryIntegTestCase.ErroneousHttpHandler
- All Implemented Interfaces:
com.sun.net.httpserver.HttpHandler,OpenSearchMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler
- Enclosing class:
- OpenSearchMockAPIBasedRepositoryIntegTestCase
protected abstract static class OpenSearchMockAPIBasedRepositoryIntegTestCase.ErroneousHttpHandler extends java.lang.Object implements OpenSearchMockAPIBasedRepositoryIntegTestCase.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 protectedErroneousHttpHandler(com.sun.net.httpserver.HttpHandler delegate, int maxErrorsPerRequest) -
Method Summary
Modifier and Type Method Description protected booleancanFailRequest(com.sun.net.httpserver.HttpExchange exchange)com.sun.net.httpserver.HttpHandlergetDelegate()voidhandle(com.sun.net.httpserver.HttpExchange exchange)protected voidhandleAsError(com.sun.net.httpserver.HttpExchange exchange)protected abstract java.lang.StringrequestUniqueId(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:
handlein 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:
getDelegatein interfaceOpenSearchMockAPIBasedRepositoryIntegTestCase.DelegatingHttpHandler
-