public UserTimelineDAO
To access class UserTimelines.
class UserTimelinevoid save(@NotNull
UserTimeline userTimeline,
@NotNull
BotDefinition botDefinition)
Saves the timeline.
userTimeline - the timeline to savebotDefinition - the bot definition (in order to add stats about the bot)void save(@NotNull
UserTimeline userTimeline,
@NotNull
java.lang.String namespace)
Saves the timeline.
userTimeline - the timeline to savenamespace - the namespace of the current botvoid updatePlayerId(@NotNull
java.lang.String namespace,
@NotNull
PlayerId oldPlayerId,
@NotNull
PlayerId newPlayerId)
Update playerId for dialog and user timelines.
@NotNull UserTimeline loadWithLastValidDialog(@NotNull java.lang.String namespace, @NotNull PlayerId userId, @Nullable PlayerId priorUserId, @Nullable java.lang.String groupId, @NotNull kotlin.jvm.functions.Function1<? super java.lang.String,? extends ai.tock.bot.definition.StoryDefinition> storyDefinitionProvider)
Loads with last dialog. If no timeline exists, creates a new one.
namespace - the namespace of the botuserId - the user id of the last messagepriorUserId - not null if this user ahs an other id beforegroupId - not null if this is a conversation groupstoryDefinitionProvider - provides interface StoryDefinition from story ids.@NotNull UserTimeline loadWithoutDialogs(@NotNull java.lang.String namespace, @NotNull PlayerId userId)
Loads without the dialogs. If no timeline, create a new one.
@NotNull
java.util.List<ai.tock.bot.engine.user.UserTimeline> loadByTemporaryIdsWithoutDialogs(@NotNull
java.lang.String namespace,
@NotNull
java.util.List<java.lang.String> temporaryIds)
Loads without the dialogs.
void remove(@NotNull
java.lang.String namespace,
@NotNull
PlayerId playerId)
Remove the timeline and the associated dialogs.
void removeClient(@NotNull
java.lang.String namespace,
@NotNull
java.lang.String clientId)
Remove all timelines and associated dialogs of a client.
@NotNull
java.util.List<ai.tock.bot.engine.dialog.Dialog> getClientDialogs(@NotNull
java.lang.String namespace,
@NotNull
java.lang.String clientId,
@NotNull
kotlin.jvm.functions.Function1<? super java.lang.String,? extends ai.tock.bot.definition.StoryDefinition> storyDefinitionProvider)
Returns the dialogs of specified client id.
@NotNull
java.util.List<ai.tock.bot.engine.dialog.Dialog> getDialogsUpdatedFrom(@NotNull
java.lang.String namespace,
@NotNull
java.time.Instant from,
@NotNull
kotlin.jvm.functions.Function1<? super java.lang.String,? extends ai.tock.bot.definition.StoryDefinition> storyDefinitionProvider)
Returns all dialogs updated after the specified Instant.
@NotNull
java.util.List<ai.tock.bot.engine.dialog.Snapshot> getSnapshots(@NotNull
org.litote.kmongo.Id<ai.tock.bot.engine.dialog.Dialog> dialogId)
Gets the snapshots of a dialog.
@Nullable
java.lang.String getLastStoryId(@NotNull
java.lang.String namespace,
@NotNull
PlayerId playerId)
Returns the last story id of the specified user, if any.
@NotNull
java.util.List<ai.tock.bot.engine.dialog.ArchivedEntityValue> getArchivedEntityValues(@NotNull
org.litote.kmongo.Id<ai.tock.bot.engine.dialog.EntityStateValue> stateValueId,
@NotNull
java.util.Map<org.litote.kmongo.Id,? extends ai.tock.bot.engine.action.Action> oldActionsMap)
Returns the archived values for the state id.
stateValueId - the state idoldActionsMap - the option action map in order to retrieve the action of archived entity values.