-
- All Implemented Interfaces:
-
io.getstream.chat.android.offline.event.handler.chat.ChatEventHandler
public abstract class BaseChatEventHandler implements ChatEventHandler
More specific ChatEventHandler implementation that gives you a separation between CidEvent and HasChannel events.
The channel will be removed from the set after receiving ChannelDeletedEvent, NotificationChannelDeletedEvent, ChannelHiddenEvent events.
The channel will be watched and added to the set after receiving ChannelVisibleEvent event.
Other events will be skipped.
-
-
Constructor Summary
Constructors Constructor Description BaseChatEventHandler()
-
Method Summary
Modifier and Type Method Description abstract EventHandlingResulthandleNotificationAddedToChannelEvent(NotificationAddedToChannelEvent event, FilterObject filter)Handles NotificationAddedToChannelEvent event. EventHandlingResulthandleMemberAddedEvent(MemberAddedEvent event, FilterObject filter, Channel cachedChannel)Handles MemberAddedEvent event. EventHandlingResulthandleMemberRemovedEvent(MemberRemovedEvent event, FilterObject filter, Channel cachedChannel)Handles MemberRemovedEvent event. abstract EventHandlingResulthandleChannelUpdatedByUserEvent(ChannelUpdatedByUserEvent event, FilterObject filter)Handles ChannelUpdatedByUserEvent event. abstract EventHandlingResulthandleChannelUpdatedEvent(ChannelUpdatedEvent event, FilterObject filter)Handles ChannelUpdatedEvent event. EventHandlingResulthandleChannelVisibleEvent(ChannelVisibleEvent event, FilterObject filter)Handles ChannelVisibleEvent event. EventHandlingResulthandleNotificationMessageNewEvent(NotificationMessageNewEvent event, FilterObject filter)Handles NotificationMessageNewEvent event. EventHandlingResulthandleNotificationRemovedFromChannelEvent(NotificationRemovedFromChannelEvent event, FilterObject filter)Handles NotificationRemovedFromChannelEvent event. EventHandlingResulthandleChannelEvent(HasChannel event, FilterObject filter)Handles HasChannel event which contains specific Channel object. EventHandlingResulthandleCidEvent(CidEvent event, FilterObject filter, Channel cachedChannel)Handles CidEvent event which is associated with a specific Channel which can be tracked using CidEvent.cid. EventHandlingResulthandleChatEvent(ChatEvent event, FilterObject filter, Channel cachedChannel)Computes the event handling result. -
-
Method Detail
-
handleNotificationAddedToChannelEvent
abstract EventHandlingResult handleNotificationAddedToChannelEvent(NotificationAddedToChannelEvent event, FilterObject filter)
Handles NotificationAddedToChannelEvent event. It runs in background.
-
handleMemberAddedEvent
EventHandlingResult handleMemberAddedEvent(MemberAddedEvent event, FilterObject filter, Channel cachedChannel)
Handles MemberAddedEvent event. It runs in background.
-
handleMemberRemovedEvent
EventHandlingResult handleMemberRemovedEvent(MemberRemovedEvent event, FilterObject filter, Channel cachedChannel)
Handles MemberRemovedEvent event. It runs in background.
-
handleChannelUpdatedByUserEvent
abstract EventHandlingResult handleChannelUpdatedByUserEvent(ChannelUpdatedByUserEvent event, FilterObject filter)
Handles ChannelUpdatedByUserEvent event. It runs in background.
-
handleChannelUpdatedEvent
abstract EventHandlingResult handleChannelUpdatedEvent(ChannelUpdatedEvent event, FilterObject filter)
Handles ChannelUpdatedEvent event. It runs in background.
-
handleChannelVisibleEvent
EventHandlingResult handleChannelVisibleEvent(ChannelVisibleEvent event, FilterObject filter)
Handles ChannelVisibleEvent event. By default returns EventHandlingResult.WatchAndAdd.
- Parameters:
event- ChannelVisibleEvent to handle.filter- FilterObject for query channels collection.
-
handleNotificationMessageNewEvent
EventHandlingResult handleNotificationMessageNewEvent(NotificationMessageNewEvent event, FilterObject filter)
Handles NotificationMessageNewEvent event. It runs in background.
-
handleNotificationRemovedFromChannelEvent
EventHandlingResult handleNotificationRemovedFromChannelEvent(NotificationRemovedFromChannelEvent event, FilterObject filter)
Handles NotificationRemovedFromChannelEvent event. It runs in background.
-
handleChannelEvent
EventHandlingResult handleChannelEvent(HasChannel event, FilterObject filter)
Handles HasChannel event which contains specific Channel object.
- Parameters:
event- ChatEvent that may contain updates for the set of channels.filter- FilterObject associated with the set of channels.
-
handleCidEvent
EventHandlingResult handleCidEvent(CidEvent event, FilterObject filter, Channel cachedChannel)
Handles CidEvent event which is associated with a specific Channel which can be tracked using CidEvent.cid.
- Parameters:
event- ChatEvent that may contain updates for the set of channels.filter- FilterObject associated with the set of channels.cachedChannel- optional cached Channel object if exists.
-
handleChatEvent
EventHandlingResult handleChatEvent(ChatEvent event, FilterObject filter, Channel cachedChannel)
Computes the event handling result.
- Parameters:
event- ChatEvent that may contain updates for the set of channels.filter- FilterObject associated with the set of channels.cachedChannel- optional cached Channel object.
-
-
-
-