Interface RealTimeEventListener


@API(status=STABLE) public interface RealTimeEventListener
Interface definition for a callback to be invoked when a real-time event is received from the datafeed.
See Also:
  • Method Details

    • isAcceptingEvent

      @API(status=EXPERIMENTAL) default boolean isAcceptingEvent(V4Event event, UserV2 botInfo) throws EventException
      Check if the event is accepted to be handled. By default, all the event that is created by the bot itself will not be accepted to be handled by the listener. If you want to handle the self-created events or you want to apply your own filters for the events, you should override this method.
      Parameters:
      event - Event to be verified.
      botInfo - General bot info object.
      Returns:
      The event is accepted or not.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onMessageSent

      default void onMessageSent(V4Initiator initiator, V4MessageSent event) throws EventException
      Called when a MESSAGESENT event is received.
      Parameters:
      initiator - Event initiator.
      event - Message sent payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onSharedPost

      default void onSharedPost(V4Initiator initiator, V4SharedPost event) throws EventException
      Called when a SHAREDPOST event is received.
      Parameters:
      initiator - Event initiator.
      event - Shared post payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onInstantMessageCreated

      default void onInstantMessageCreated(V4Initiator initiator, V4InstantMessageCreated event) throws EventException
      Called when an INSTANTMESSAGECREATED event is received.
      Parameters:
      initiator - Event initiator.
      event - Instant Message Created payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onRoomCreated

      default void onRoomCreated(V4Initiator initiator, V4RoomCreated event) throws EventException
      Called when a ROOMCREATED event is received.
      Parameters:
      initiator - Event initiator.
      event - Room Created payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onRoomUpdated

      default void onRoomUpdated(V4Initiator initiator, V4RoomUpdated event) throws EventException
      Called when a ROOMUPDATED event is received.
      Parameters:
      initiator - Event initiator.
      event - Room Updated payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onRoomDeactivated

      default void onRoomDeactivated(V4Initiator initiator, V4RoomDeactivated event) throws EventException
      Called when a ROOMDEACTIVATED event is received.
      Parameters:
      initiator - Event initiator.
      event - Room Deactivated payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onRoomReactivated

      default void onRoomReactivated(V4Initiator initiator, V4RoomReactivated event) throws EventException
      Called when a ROOMREACTIVATED event is received.
      Parameters:
      initiator - Event initiator.
      event - Room Reactivated payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onUserRequestedToJoinRoom

      default void onUserRequestedToJoinRoom(V4Initiator initiator, V4UserRequestedToJoinRoom event) throws EventException
      Called when an USERREQUESTEDTOJOINROOM event is received.
      Parameters:
      initiator - Event initiator.
      event - User Requested To Join Room payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onUserJoinedRoom

      default void onUserJoinedRoom(V4Initiator initiator, V4UserJoinedRoom event) throws EventException
      Called when an USERJOINEDROOM event is received.
      Parameters:
      initiator - Event initiator.
      event - User Joined Room payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onUserLeftRoom

      default void onUserLeftRoom(V4Initiator initiator, V4UserLeftRoom event) throws EventException
      Called when an USERLEFTROOM event is received.
      Parameters:
      initiator - Event initiator.
      event - User Left Room payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onRoomMemberPromotedToOwner

      default void onRoomMemberPromotedToOwner(V4Initiator initiator, V4RoomMemberPromotedToOwner event) throws EventException
      Called when a ROOMMEMBERPROMOTEDTOOWNER event is received.
      Parameters:
      initiator - Event initiator.
      event - Room Member Promoted To Owner payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onRoomMemberDemotedFromOwner

      default void onRoomMemberDemotedFromOwner(V4Initiator initiator, V4RoomMemberDemotedFromOwner event) throws EventException
      Called when a ROOMMEMBERDEMOTEDFROMOWNER event is received.
      Parameters:
      initiator - Event initiator.
      event - Room Member Demoted From Owner payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onConnectionRequested

      default void onConnectionRequested(V4Initiator initiator, V4ConnectionRequested event) throws EventException
      Called when a CONNECTIONREQUESTED event is received.
      Parameters:
      initiator - Event initiator.
      event - Connection Requested payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onConnectionAccepted

      default void onConnectionAccepted(V4Initiator initiator, V4ConnectionAccepted event) throws EventException
      Called when a CONNECTIONACCEPTED event is received.
      Parameters:
      initiator - Event initiator.
      event - Connection Accepted payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onMessageSuppressed

      default void onMessageSuppressed(V4Initiator initiator, V4MessageSuppressed event) throws EventException
      Called when a MESSAGESUPPRESSED event is received.
      Parameters:
      initiator - Event initiator.
      event - Message Suppressed payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.
    • onSymphonyElementsAction

      default void onSymphonyElementsAction(V4Initiator initiator, V4SymphonyElementsAction event) throws EventException
      Called when a SYMPHONYELEMENTSACTION event is received.
      Parameters:
      initiator - Event initiator.
      event - Symphony Elements Action payload.
      Throws:
      EventException - Throw this exception if this method should fail the current events processing and re-queue the events in datafeed. Other exceptions will be caught silently.