Class RoutingResponseHandler

java.lang.Object
org.neo4j.driver.internal.handlers.RoutingResponseHandler
All Implemented Interfaces:
ResponseHandler

public class RoutingResponseHandler extends Object implements ResponseHandler
  • Constructor Details

    • RoutingResponseHandler

      public RoutingResponseHandler(ResponseHandler delegate, org.neo4j.driver.internal.BoltServerAddress address, AccessMode accessMode, org.neo4j.driver.internal.RoutingErrorHandler errorHandler)
  • Method Details

    • onSuccess

      public void onSuccess(Map<String,Value> metadata)
      Specified by:
      onSuccess in interface ResponseHandler
    • onFailure

      public void onFailure(Throwable error)
      Specified by:
      onFailure in interface ResponseHandler
    • onRecord

      public void onRecord(Value[] fields)
      Specified by:
      onRecord in interface ResponseHandler
    • canManageAutoRead

      public boolean canManageAutoRead()
      Description copied from interface: ResponseHandler
      Tells whether this response handler is able to manage auto-read of the underlying connection using Connection.enableAutoRead() and Connection.disableAutoRead().

      Implementations can use auto-read management to apply network-level backpressure when receiving a stream of records. There should only be a single such handler active for a connection at one point in time. Otherwise, handlers can interfere and turn on/off auto-read racing with each other. InboundMessageDispatcher is responsible for tracking these handlers and disabling auto-read management to maintain just a single auto-read managing handler per connection.

      Specified by:
      canManageAutoRead in interface ResponseHandler
    • disableAutoReadManagement

      public void disableAutoReadManagement()
      Description copied from interface: ResponseHandler
      If this response handler is able to manage auto-read of the underlying connection, then this method signals it to stop changing auto-read setting for the connection.
      Specified by:
      disableAutoReadManagement in interface ResponseHandler