Class CDPSessionImpl

All Implemented Interfaces:
CDPSession

public class CDPSessionImpl extends ChannelOwner implements CDPSession
  • Field Details

  • Constructor Details

    • CDPSessionImpl

      protected CDPSessionImpl(ChannelOwner parent, String type, String guid, com.google.gson.JsonObject initializer)
  • Method Details

    • handleEvent

      void handleEvent(String event, com.google.gson.JsonObject parameters)
      Overrides:
      handleEvent in class ChannelOwner
    • send

      public com.google.gson.JsonObject send(String method)
      Specified by:
      send in interface CDPSession
      Parameters:
      method - Protocol method name.
    • send

      public com.google.gson.JsonObject send(String method, com.google.gson.JsonObject params)
      Specified by:
      send in interface CDPSession
      Parameters:
      method - Protocol method name.
      params - Optional method parameters.
    • on

      public void on(String event, Consumer<com.google.gson.JsonObject> handler)
      Description copied from interface: CDPSession
      Register an event handler for events with the specified event name. The given handler will be called for every event with the given name.
      Specified by:
      on in interface CDPSession
      Parameters:
      event - CDP event name.
      handler - Event handler.
    • off

      public void off(String event, Consumer<com.google.gson.JsonObject> handler)
      Description copied from interface: CDPSession
      Unregister an event handler for events with the specified event name. The given handler will not be called anymore for events with the given name.
      Specified by:
      off in interface CDPSession
      Parameters:
      event - CDP event name.
      handler - Event handler.
    • detach

      public void detach()
      Description copied from interface: CDPSession
      Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be used to send messages.
      Specified by:
      detach in interface CDPSession