Interface GatewayDataUpdater
-
- All Known Implementing Classes:
LegacyStoreLayout,LocalStoreLayout
public interface GatewayDataUpdaterDefines methods to handle update operations in response to events received from the Discord gateway.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Mono<Void>onChannelCreate(int shardIndex, discord4j.discordjson.json.gateway.ChannelCreate dispatch)Updates the internal state of the store according to the givenChannelCreategateway dispatch.Mono<discord4j.discordjson.json.ChannelData>onChannelDelete(int shardIndex, discord4j.discordjson.json.gateway.ChannelDelete dispatch)Updates the internal state of the store according to the givenChannelDeletegateway dispatch.Mono<discord4j.discordjson.json.ChannelData>onChannelUpdate(int shardIndex, discord4j.discordjson.json.gateway.ChannelUpdate dispatch)Updates the internal state of the store according to the givenChannelUpdategateway dispatch.Mono<Void>onGuildCreate(int shardIndex, discord4j.discordjson.json.gateway.GuildCreate dispatch)Updates the internal state of the store according to the givenGuildCreategateway dispatch.Mono<discord4j.discordjson.json.GuildData>onGuildDelete(int shardIndex, discord4j.discordjson.json.gateway.GuildDelete dispatch)Updates the internal state of the store according to the givenGuildDeletegateway dispatch.Mono<Set<discord4j.discordjson.json.EmojiData>>onGuildEmojisUpdate(int shardIndex, discord4j.discordjson.json.gateway.GuildEmojisUpdate dispatch)Updates the internal state of the store according to the givenGuildEmojisUpdategateway dispatch.Mono<Void>onGuildMemberAdd(int shardIndex, discord4j.discordjson.json.gateway.GuildMemberAdd dispatch)Updates the internal state of the store according to the givenGuildMemberAddgateway dispatch.Mono<discord4j.discordjson.json.MemberData>onGuildMemberRemove(int shardIndex, discord4j.discordjson.json.gateway.GuildMemberRemove dispatch)Updates the internal state of the store according to the givenGuildMemberRemovegateway dispatch.Mono<Void>onGuildMembersChunk(int shardIndex, discord4j.discordjson.json.gateway.GuildMembersChunk dispatch)Updates the internal state of the store according to the givenGuildMembersChunkgateway dispatch.Mono<Void>onGuildMembersCompletion(long guildId)Invoked to indicate that all members for the specified guild ID were received.Mono<discord4j.discordjson.json.MemberData>onGuildMemberUpdate(int shardIndex, discord4j.discordjson.json.gateway.GuildMemberUpdate dispatch)Updates the internal state of the store according to the givenGuildMemberUpdategateway dispatch.Mono<Void>onGuildRoleCreate(int shardIndex, discord4j.discordjson.json.gateway.GuildRoleCreate dispatch)Updates the internal state of the store according to the givenGuildRoleCreategateway dispatch.Mono<discord4j.discordjson.json.RoleData>onGuildRoleDelete(int shardIndex, discord4j.discordjson.json.gateway.GuildRoleDelete dispatch)Updates the internal state of the store according to the givenGuildRoleDeletegateway dispatch.Mono<discord4j.discordjson.json.RoleData>onGuildRoleUpdate(int shardIndex, discord4j.discordjson.json.gateway.GuildRoleUpdate dispatch)Updates the internal state of the store according to the givenGuildRoleUpdategateway dispatch.Mono<discord4j.discordjson.json.GuildData>onGuildUpdate(int shardIndex, discord4j.discordjson.json.gateway.GuildUpdate dispatch)Updates the internal state of the store according to the givenGuildUpdategateway dispatch.Mono<Void>onMessageCreate(int shardIndex, discord4j.discordjson.json.gateway.MessageCreate dispatch)Updates the internal state of the store according to the givenMessageCreategateway dispatch.Mono<discord4j.discordjson.json.MessageData>onMessageDelete(int shardIndex, discord4j.discordjson.json.gateway.MessageDelete dispatch)Updates the internal state of the store according to the givenMessageDeletegateway dispatch.Mono<Set<discord4j.discordjson.json.MessageData>>onMessageDeleteBulk(int shardIndex, discord4j.discordjson.json.gateway.MessageDeleteBulk dispatch)Updates the internal state of the store according to the givenMessageDeleteBulkgateway dispatch.Mono<Void>onMessageReactionAdd(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionAdd dispatch)Updates the internal state of the store according to the givenMessageReactionAddgateway dispatch.Mono<Void>onMessageReactionRemove(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionRemove dispatch)Updates the internal state of the store according to the givenMessageReactionRemovegateway dispatch.Mono<Void>onMessageReactionRemoveAll(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionRemoveAll dispatch)Updates the internal state of the store according to the givenMessageReactionRemoveAllgateway dispatch.Mono<Void>onMessageReactionRemoveEmoji(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionRemoveEmoji dispatch)Updates the internal state of the store according to the givenMessageReactionRemoveEmojigateway dispatch.Mono<discord4j.discordjson.json.MessageData>onMessageUpdate(int shardIndex, discord4j.discordjson.json.gateway.MessageUpdate dispatch)Updates the internal state of the store according to the givenMessageUpdategateway dispatch.Mono<PresenceAndUserData>onPresenceUpdate(int shardIndex, discord4j.discordjson.json.gateway.PresenceUpdate dispatch)Updates the internal state of the store according to the givenPresenceUpdategateway dispatch.Mono<Void>onReady(discord4j.discordjson.json.gateway.Ready dispatch)Updates the internal state of the store according to the givenReadygateway dispatch.Mono<Void>onShardInvalidation(int shardIndex, InvalidationCause cause)Handles the invalidation of a specific shard.Mono<discord4j.discordjson.json.UserData>onUserUpdate(int shardIndex, discord4j.discordjson.json.gateway.UserUpdate dispatch)Updates the internal state of the store according to the givenUserUpdategateway dispatch.Mono<discord4j.discordjson.json.VoiceStateData>onVoiceStateUpdateDispatch(int shardIndex, discord4j.discordjson.json.gateway.VoiceStateUpdateDispatch dispatch)Updates the internal state of the store according to the givenVoiceStateUpdateDispatchgateway dispatch.
-
-
-
Method Detail
-
onChannelCreate
Mono<Void> onChannelCreate(int shardIndex, discord4j.discordjson.json.gateway.ChannelCreate dispatch)
Updates the internal state of the store according to the givenChannelCreategateway dispatch. This will typically perform an insert operation on the relatedChannelData, and add the ID to the list returned byGuildData.channels()if applicable.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done
-
onChannelDelete
Mono<discord4j.discordjson.json.ChannelData> onChannelDelete(int shardIndex, discord4j.discordjson.json.gateway.ChannelDelete dispatch)
Updates the internal state of the store according to the givenChannelDeletegateway dispatch. This will typically perform a delete operation on a relatedChannelDatathat is already present in the store, and remove the ID from the list returned byGuildData.channels()if applicable.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theChannelDatabefore the deletion
-
onChannelUpdate
Mono<discord4j.discordjson.json.ChannelData> onChannelUpdate(int shardIndex, discord4j.discordjson.json.gateway.ChannelUpdate dispatch)
Updates the internal state of the store according to the givenChannelUpdategateway dispatch. This will typically perform an update operation on a relatedChannelDatathat is already present in the store.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theChannelDatabefore the update
-
onGuildCreate
Mono<Void> onGuildCreate(int shardIndex, discord4j.discordjson.json.gateway.GuildCreate dispatch)
Updates the internal state of the store according to the givenGuildCreategateway dispatch. This will typically perform an insert operation on the relatedGuildData, as well as all associated entities received in the payload, such as channels, roles, emojis, members, voice states and presences.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done
-
onGuildDelete
Mono<discord4j.discordjson.json.GuildData> onGuildDelete(int shardIndex, discord4j.discordjson.json.gateway.GuildDelete dispatch)
Updates the internal state of the store according to the givenGuildDeletegateway dispatch. This will typically perform a delete operation on a relatedGuildDatathat is already present in the store, and clean up all entities that are associated to that guild, such as the channels, the roles, the emojis, the members, the voice states and the messages.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theGuildDatabefore the deletion
-
onGuildEmojisUpdate
Mono<Set<discord4j.discordjson.json.EmojiData>> onGuildEmojisUpdate(int shardIndex, discord4j.discordjson.json.gateway.GuildEmojisUpdate dispatch)
Updates the internal state of the store according to the givenGuildEmojisUpdategateway dispatch. This will typically perform an update operation on a related collection ofEmojiDatathat is already present in the store, and update the list returned byGuildData.emojis().- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of the set ofEmojiDatabefore the update
-
onGuildMemberAdd
Mono<Void> onGuildMemberAdd(int shardIndex, discord4j.discordjson.json.gateway.GuildMemberAdd dispatch)
Updates the internal state of the store according to the givenGuildMemberAddgateway dispatch. This will typically perform an insert operation on the relatedMemberData, add the ID of the member into the list returned byGuildData.members(), and increment the count returned byGuildCreateFields.memberCount().- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done
-
onGuildMemberRemove
Mono<discord4j.discordjson.json.MemberData> onGuildMemberRemove(int shardIndex, discord4j.discordjson.json.gateway.GuildMemberRemove dispatch)
Updates the internal state of the store according to the givenGuildMemberRemovegateway dispatch. This will typically perform a delete operation on the relatedMemberData, remove the ID of the member from the list returned byGuildData.members(), and decrement the count returned byGuildCreateFields.memberCount().- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theMemberDatabefore the deletion
-
onGuildMembersChunk
Mono<Void> onGuildMembersChunk(int shardIndex, discord4j.discordjson.json.gateway.GuildMembersChunk dispatch)
Updates the internal state of the store according to the givenGuildMembersChunkgateway dispatch. This will typically perform the same kind of operations thanonGuildMemberAdd(int, GuildMemberAdd), but adapted for whole chunks of members.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done
-
onGuildMemberUpdate
Mono<discord4j.discordjson.json.MemberData> onGuildMemberUpdate(int shardIndex, discord4j.discordjson.json.gateway.GuildMemberUpdate dispatch)
Updates the internal state of the store according to the givenGuildMemberUpdategateway dispatch. This will typically perform an update operation on a relatedMemberDatathat is already present in the store.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theMemberDatabefore the update
-
onGuildRoleCreate
Mono<Void> onGuildRoleCreate(int shardIndex, discord4j.discordjson.json.gateway.GuildRoleCreate dispatch)
Updates the internal state of the store according to the givenGuildRoleCreategateway dispatch. This will typically perform an insert operation on the relatedRoleData, and add the role ID to the list returned byGuildData.roles().- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done
-
onGuildRoleDelete
Mono<discord4j.discordjson.json.RoleData> onGuildRoleDelete(int shardIndex, discord4j.discordjson.json.gateway.GuildRoleDelete dispatch)
Updates the internal state of the store according to the givenGuildRoleDeletegateway dispatch. This will typically perform a delete operation on a relatedRoleDatathat is already present in the store, and remove the role ID from the list returned byGuildData.roles()andPartialMemberData.roles().- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theRoleDatabefore the deletion
-
onGuildRoleUpdate
Mono<discord4j.discordjson.json.RoleData> onGuildRoleUpdate(int shardIndex, discord4j.discordjson.json.gateway.GuildRoleUpdate dispatch)
Updates the internal state of the store according to the givenGuildRoleUpdategateway dispatch. This will typically perform an update operation on a relatedRoleDatathat is already present in the store.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theRoleDatabefore the update
-
onGuildUpdate
Mono<discord4j.discordjson.json.GuildData> onGuildUpdate(int shardIndex, discord4j.discordjson.json.gateway.GuildUpdate dispatch)
Updates the internal state of the store according to the givenGuildUpdategateway dispatch. This will typically perform an update operation on a relatedGuildDatathat is already present in the store.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theGuildDatabefore the update
-
onShardInvalidation
Mono<Void> onShardInvalidation(int shardIndex, InvalidationCause cause)
Handles the invalidation of a specific shard. When a shard is invalidated, all cached data related to it should be considered stale and the implementation may perform some cleanup work.- Parameters:
shardIndex- the index of the shard to invalidatecause- the cause of the invalidation- Returns:
- a
Monocompleting when the operation is done
-
onMessageCreate
Mono<Void> onMessageCreate(int shardIndex, discord4j.discordjson.json.gateway.MessageCreate dispatch)
Updates the internal state of the store according to the givenMessageCreategateway dispatch. This will typically perform an insert operation on the relatedMessageData, and update thelast_message_idfield of the channel where the message was sent in.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done
-
onMessageDelete
Mono<discord4j.discordjson.json.MessageData> onMessageDelete(int shardIndex, discord4j.discordjson.json.gateway.MessageDelete dispatch)
Updates the internal state of the store according to the givenMessageDeletegateway dispatch. This will typically perform a delete operation on a relatedMessageDatathat is already present in the store.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theMessageDatabefore the deletion
-
onMessageDeleteBulk
Mono<Set<discord4j.discordjson.json.MessageData>> onMessageDeleteBulk(int shardIndex, discord4j.discordjson.json.gateway.MessageDeleteBulk dispatch)
Updates the internal state of the store according to the givenMessageDeleteBulkgateway dispatch. This will typically perform a delete operation on a related collection ofMessageDatathat is already present in the store.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of the set ofMessageDatabefore the deletion
-
onMessageReactionAdd
Mono<Void> onMessageReactionAdd(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionAdd dispatch)
Updates the internal state of the store according to the givenMessageReactionAddgateway dispatch. This will typically perform an update operation on a relatedMessageDatathat is already present in the store in order to add the reaction.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done
-
onMessageReactionRemove
Mono<Void> onMessageReactionRemove(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionRemove dispatch)
Updates the internal state of the store according to the givenMessageReactionRemovegateway dispatch. This will typically perform an update operation on a relatedMessageDatathat is already present in the store in order to remove the reaction.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done
-
onMessageReactionRemoveAll
Mono<Void> onMessageReactionRemoveAll(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionRemoveAll dispatch)
Updates the internal state of the store according to the givenMessageReactionRemoveAllgateway dispatch. This will typically perform an update operation on a relatedMessageDatathat is already present in the store in order to remove all reactions.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done
-
onMessageReactionRemoveEmoji
Mono<Void> onMessageReactionRemoveEmoji(int shardIndex, discord4j.discordjson.json.gateway.MessageReactionRemoveEmoji dispatch)
Updates the internal state of the store according to the givenMessageReactionRemoveEmojigateway dispatch. This will typically perform an update operation on a relatedMessageDatathat is already present in the store in order to remove all reactions for a specific emoji.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done
-
onMessageUpdate
Mono<discord4j.discordjson.json.MessageData> onMessageUpdate(int shardIndex, discord4j.discordjson.json.gateway.MessageUpdate dispatch)
Updates the internal state of the store according to the givenMessageUpdategateway dispatch. This will typically perform an update operation on a relatedMessageDatathat is already present in the store.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theMessageDatabefore the update
-
onPresenceUpdate
Mono<PresenceAndUserData> onPresenceUpdate(int shardIndex, discord4j.discordjson.json.gateway.PresenceUpdate dispatch)
Updates the internal state of the store according to the givenPresenceUpdategateway dispatch. This will typically perform an insert or an update operation on the relatedPresenceData, and update the relatedUserDatato reflect the new presence.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of both thePresenceDataand theUserDatabefore the update
-
onReady
Mono<Void> onReady(discord4j.discordjson.json.gateway.Ready dispatch)
Updates the internal state of the store according to the givenReadygateway dispatch. This will typically perform an insert operation on theUserDatathat represents the self-user, and allocate the resources needed to receive further events happening on this shard index.- Parameters:
dispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done
-
onUserUpdate
Mono<discord4j.discordjson.json.UserData> onUserUpdate(int shardIndex, discord4j.discordjson.json.gateway.UserUpdate dispatch)
Updates the internal state of the store according to the givenUserUpdategateway dispatch. This will typically perform an update operation on a relatedUserDatathat is already present in the store.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theUserDatabefore the update
-
onVoiceStateUpdateDispatch
Mono<discord4j.discordjson.json.VoiceStateData> onVoiceStateUpdateDispatch(int shardIndex, discord4j.discordjson.json.gateway.VoiceStateUpdateDispatch dispatch)
Updates the internal state of the store according to the givenVoiceStateUpdateDispatchgateway dispatch. This will typically perform an insert, update or delete operation on the relatedVoiceStateData.- Parameters:
shardIndex- the index of the shard where the dispatch comes fromdispatch- the dispatch data coming from Discord gateway- Returns:
- a
Monocompleting when the operation is done, optionally returning the old state of theVoiceStateDatabefore the update
-
onGuildMembersCompletion
Mono<Void> onGuildMembersCompletion(long guildId)
Invoked to indicate that all members for the specified guild ID were received. It serves as a hint to indicate to the store that information on the full member list for this specific guild may now be accurately returned, so that further calls toDataAccessor.countExactMembersInGuild(long)andDataAccessor.getExactMembersInGuild(long)with the same guild ID no longer fail.- Parameters:
guildId- the guild ID- Returns:
- a
Monocompleting when the operation is done
-
-