Class EventHandlerAdapter

java.lang.Object
com.couchbase.client.dcp.highlevel.internal.EventHandlerAdapter
All Implemented Interfaces:
ControlEventHandler, SystemEventHandler

public class EventHandlerAdapter extends Object implements ControlEventHandler, SystemEventHandler
Bridges the gap between the various low-level callback handlers and the high-level DatabaseChangeListener.
  • Method Details

    • register

      public static EventHandlerAdapter register(Client dcpClient, EventDispatcher dispatcher)
    • onEvent

      public void onEvent(CouchbaseEvent event)
      Description copied from interface: SystemEventHandler
      Called every time when a system event happens that should be handled by consumers of the Client.
      Specified by:
      onEvent in interface SystemEventHandler
      Parameters:
      event - the system event happening.
    • onEvent

      public void onEvent(ChannelFlowController flowController, com.couchbase.client.core.deps.io.netty.buffer.ByteBuf event)
      Description copied from interface: ControlEventHandler
      Called every time when a control event happens that should be handled by consumers of the Client.

      Even if you are not doing anything with the events, make sure to release the buffer!!

      Specified by:
      onEvent in interface ControlEventHandler
      Parameters:
      flowController - the flow controller for the passed event.
      event - the control event happening.