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 Summary
Modifier and TypeMethodDescriptiondefault boolean
isAcceptingEvent
(V4Event event, UserV2 botInfo) Check if the event is accepted to be handled.default void
onConnectionAccepted
(V4Initiator initiator, V4ConnectionAccepted event) Called when a CONNECTIONACCEPTED event is received.default void
onConnectionRequested
(V4Initiator initiator, V4ConnectionRequested event) Called when a CONNECTIONREQUESTED event is received.default void
onInstantMessageCreated
(V4Initiator initiator, V4InstantMessageCreated event) Called when an INSTANTMESSAGECREATED event is received.default void
onMessageSent
(V4Initiator initiator, V4MessageSent event) Called when a MESSAGESENT event is received.default void
onMessageSuppressed
(V4Initiator initiator, V4MessageSuppressed event) Called when a MESSAGESUPPRESSED event is received.default void
onRoomCreated
(V4Initiator initiator, V4RoomCreated event) Called when a ROOMCREATED event is received.default void
onRoomDeactivated
(V4Initiator initiator, V4RoomDeactivated event) Called when a ROOMDEACTIVATED event is received.default void
onRoomMemberDemotedFromOwner
(V4Initiator initiator, V4RoomMemberDemotedFromOwner event) Called when a ROOMMEMBERDEMOTEDFROMOWNER event is received.default void
onRoomMemberPromotedToOwner
(V4Initiator initiator, V4RoomMemberPromotedToOwner event) Called when a ROOMMEMBERPROMOTEDTOOWNER event is received.default void
onRoomReactivated
(V4Initiator initiator, V4RoomReactivated event) Called when a ROOMREACTIVATED event is received.default void
onRoomUpdated
(V4Initiator initiator, V4RoomUpdated event) Called when a ROOMUPDATED event is received.default void
onSharedPost
(V4Initiator initiator, V4SharedPost event) Called when a SHAREDPOST event is received.default void
onSymphonyElementsAction
(V4Initiator initiator, V4SymphonyElementsAction event) Called when a SYMPHONYELEMENTSACTION event is received.default void
onUserJoinedRoom
(V4Initiator initiator, V4UserJoinedRoom event) Called when an USERJOINEDROOM event is received.default void
onUserLeftRoom
(V4Initiator initiator, V4UserLeftRoom event) Called when an USERLEFTROOM event is received.default void
onUserRequestedToJoinRoom
(V4Initiator initiator, V4UserRequestedToJoinRoom event) Called when an USERREQUESTEDTOJOINROOM event is received.
-
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
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.
-
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
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
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
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
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.
-