Package ai.tock.bot.engine.user
Interface UserTimelineDAO
-
- All Implemented Interfaces:
public interface UserTimelineDAOTo access UserTimelines.
-
-
Method Summary
Modifier and Type Method Description abstract Unitsave(UserTimeline userTimeline, BotDefinition botDefinition, Boolean asynchronousProcess)Saves the timeline. abstract Unitsave(UserTimeline userTimeline, String namespace)Saves the timeline. abstract UnitupdatePlayerId(String namespace, PlayerId oldPlayerId, PlayerId newPlayerId)Update playerId for dialog and user timelines. abstract UserTimelineloadWithLastValidDialog(String namespace, PlayerId userId, PlayerId priorUserId, String groupId, Function1<String, StoryDefinition> storyDefinitionProvider)Loads with last dialog. abstract UserTimelineloadWithoutDialogs(String namespace, PlayerId userId)Loads without the dialogs. abstract List<UserTimeline>loadByTemporaryIdsWithoutDialogs(String namespace, List<String> temporaryIds)Loads without the dialogs. abstract Unitremove(String namespace, PlayerId playerId)Remove the timeline and the associated dialogs. abstract UnitremoveClient(String namespace, String clientId)Remove all timelines and associated dialogs of a client. abstract List<Dialog>getClientDialogs(String namespace, String clientId, Function1<String, StoryDefinition> storyDefinitionProvider)Returns the dialogs of specified client id. abstract List<Dialog>getDialogsUpdatedFrom(String namespace, Instant from, Function1<String, StoryDefinition> storyDefinitionProvider)Returns all dialogs updated after the specified Instant. abstract List<Snapshot>getSnapshots(Id<Dialog> dialogId)Gets the snapshots of a dialog. abstract StringgetLastStoryId(String namespace, PlayerId playerId)Returns the last story id of the specified user, if any. abstract List<ArchivedEntityValue>getArchivedEntityValues(Id<EntityStateValue> stateValueId, Map<Id<Action>, Action> oldActionsMap)Returns the archived values for the state id. -
-
Method Detail
-
save
abstract Unit save(UserTimeline userTimeline, BotDefinition botDefinition, Boolean asynchronousProcess)
Saves the timeline.
- Parameters:
userTimeline- the timeline to savebotDefinition- the bot definition (in order to add stats about the bot)asynchronousProcess- boolean to disable/enable asynchronous saving
-
save
abstract Unit save(UserTimeline userTimeline, String namespace)
Saves the timeline.
- Parameters:
userTimeline- the timeline to savenamespace- the namespace of the current bot
-
updatePlayerId
abstract Unit updatePlayerId(String namespace, PlayerId oldPlayerId, PlayerId newPlayerId)
Update playerId for dialog and user timelines.
-
loadWithLastValidDialog
abstract UserTimeline loadWithLastValidDialog(String namespace, PlayerId userId, PlayerId priorUserId, String groupId, Function1<String, StoryDefinition> storyDefinitionProvider)
Loads with last dialog. If no timeline exists, creates a new one.
- Parameters:
namespace- the namespace of the botuserId- the user id of the last messagepriorUserId- not null if this user has an other id beforegroupId- not null if this is a conversation groupstoryDefinitionProvider- provides StoryDefinition from story ids.
-
loadWithoutDialogs
abstract UserTimeline loadWithoutDialogs(String namespace, PlayerId userId)
Loads without the dialogs. If no timeline, create a new one.
-
loadByTemporaryIdsWithoutDialogs
abstract List<UserTimeline> loadByTemporaryIdsWithoutDialogs(String namespace, List<String> temporaryIds)
Loads without the dialogs.
-
remove
abstract Unit remove(String namespace, PlayerId playerId)
Remove the timeline and the associated dialogs.
-
removeClient
abstract Unit removeClient(String namespace, String clientId)
Remove all timelines and associated dialogs of a client.
-
getClientDialogs
abstract List<Dialog> getClientDialogs(String namespace, String clientId, Function1<String, StoryDefinition> storyDefinitionProvider)
Returns the dialogs of specified client id.
-
getDialogsUpdatedFrom
abstract List<Dialog> getDialogsUpdatedFrom(String namespace, Instant from, Function1<String, StoryDefinition> storyDefinitionProvider)
Returns all dialogs updated after the specified Instant.
-
getSnapshots
abstract List<Snapshot> getSnapshots(Id<Dialog> dialogId)
Gets the snapshots of a dialog.
-
getLastStoryId
abstract String getLastStoryId(String namespace, PlayerId playerId)
Returns the last story id of the specified user, if any.
-
getArchivedEntityValues
abstract List<ArchivedEntityValue> getArchivedEntityValues(Id<EntityStateValue> stateValueId, Map<Id<Action>, Action> oldActionsMap)
Returns the archived values for the state id.
- Parameters:
stateValueId- the state idoldActionsMap- the option action map in order to retrieve the action of archived entity values.
-
-
-
-