Class MockHttpTransport

java.lang.Object
org.opensearch.common.component.AbstractLifecycleComponent
org.opensearch.test.MockHttpTransport
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, org.opensearch.common.component.LifecycleComponent, org.opensearch.common.lease.Releasable, org.opensearch.http.HttpServerTransport, org.opensearch.node.ReportingService<org.opensearch.http.HttpInfo>

public class MockHttpTransport
extends org.opensearch.common.component.AbstractLifecycleComponent
implements org.opensearch.http.HttpServerTransport
A dummy http transport used by tests when not wanting to actually bind to a real address.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  MockHttpTransport.TestPlugin
    Marker plugin used by MockNode to enable MockHttpTransport.

    Nested classes/interfaces inherited from interface org.opensearch.http.HttpServerTransport

    org.opensearch.http.HttpServerTransport.Dispatcher

    Nested classes/interfaces inherited from interface org.opensearch.node.ReportingService

    org.opensearch.node.ReportingService.Info
  • Field Summary

    Fields inherited from class org.opensearch.common.component.AbstractLifecycleComponent

    lifecycle

    Fields inherited from interface org.opensearch.http.HttpServerTransport

    HTTP_SERVER_WORKER_THREAD_NAME_PREFIX
  • Constructor Summary

    Constructors 
    Constructor Description
    MockHttpTransport()  
  • Method Summary

    Modifier and Type Method Description
    org.opensearch.common.transport.BoundTransportAddress boundAddress()  
    protected void doClose()  
    protected void doStart()  
    protected void doStop()  
    org.opensearch.http.HttpInfo info()  
    org.opensearch.http.HttpStats stats()  

    Methods inherited from class org.opensearch.common.component.AbstractLifecycleComponent

    addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.opensearch.common.component.LifecycleComponent

    addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop

    Methods inherited from interface org.opensearch.common.lease.Releasable

    close
  • Constructor Details

  • Method Details

    • doStart

      protected void doStart()
      Specified by:
      doStart in class org.opensearch.common.component.AbstractLifecycleComponent
    • doStop

      protected void doStop()
      Specified by:
      doStop in class org.opensearch.common.component.AbstractLifecycleComponent
    • doClose

      protected void doClose()
      Specified by:
      doClose in class org.opensearch.common.component.AbstractLifecycleComponent
    • boundAddress

      public org.opensearch.common.transport.BoundTransportAddress boundAddress()
      Specified by:
      boundAddress in interface org.opensearch.http.HttpServerTransport
    • info

      public org.opensearch.http.HttpInfo info()
      Specified by:
      info in interface org.opensearch.http.HttpServerTransport
      Specified by:
      info in interface org.opensearch.node.ReportingService<org.opensearch.http.HttpInfo>
    • stats

      public org.opensearch.http.HttpStats stats()
      Specified by:
      stats in interface org.opensearch.http.HttpServerTransport