-
public interface ChatSession
-
-
Method Summary
Modifier and Type Method Description abstract Unitconfigure(GlobalConfig config)abstract ConnectionDetailsProvidergetConnectionDetailsProvider()Returns ConnectionDetailsProvider object abstract Result<Boolean>connect(ChatDetails chatDetails)Connects to a chat session with the specified chat details. abstract Result<Boolean>disconnect()Disconnects the current chat session. abstract Result<Boolean>suspendWebSocketConnection()Disconnects the websocket and suspends reconnection attempts. abstract Result<Boolean>resumeWebSocketConnection()Resumes a suspended websocket and attempts to reconnect. abstract Result<Boolean>reset()Resets the current state which will disconnect the webSocket and remove all session related data without disconnecting the participant from the chat contact. abstract Result<Boolean>sendMessage(ContentType contentType, String message)Sends a message. abstract Result<Boolean>resendFailedMessage(String messageId)Retry a message that failed to be sent. abstract Result<Boolean>sendEvent(ContentType contentType, String event)Sends an event. abstract Result<Boolean>sendAttachment(Uri fileUri)Sends an attachment. abstract Result<URL>downloadAttachment(String attachmentId, String filename)Downloads an attachment. abstract Result<URL>getAttachmentDownloadUrl(String attachmentId)Returns the S3 download URL for an attachment. abstract Result<TranscriptResponse>getTranscript(ScanDirection scanDirection, SortKey sortKey, Integer maxResults, String nextToken, String startPosition)Gets the transcript. abstract Result<Boolean>sendMessageReceipt(TranscriptItem transcriptItem, MessageReceiptType receiptType)Sends a message receipt. abstract Result<View>describeView(String viewToken)Retrieves the view for the specified view token. abstract Function1<Boolean, Unit>getOnChatSessionStateChanged()Checks if a chat session is currently active. abstract UnitsetOnChatSessionStateChanged(Function1<Boolean, Unit> onChatSessionStateChanged)Checks if a chat session is currently active. abstract Function0<Unit>getOnConnectionEstablished()abstract UnitsetOnConnectionEstablished(Function0<Unit> onConnectionEstablished)abstract Function0<Unit>getOnConnectionReEstablished()abstract UnitsetOnConnectionReEstablished(Function0<Unit> onConnectionReEstablished)abstract Function0<Unit>getOnConnectionBroken()abstract UnitsetOnConnectionBroken(Function0<Unit> onConnectionBroken)abstract Function0<Unit>getOnDeepHeartBeatFailure()abstract UnitsetOnDeepHeartBeatFailure(Function0<Unit> onDeepHeartBeatFailure)abstract Function1<TranscriptItem, Unit>getOnMessageReceived()abstract UnitsetOnMessageReceived(Function1<TranscriptItem, Unit> onMessageReceived)abstract Function1<TranscriptData, Unit>getOnTranscriptUpdated()abstract UnitsetOnTranscriptUpdated(Function1<TranscriptData, Unit> onTranscriptUpdated)abstract Function1<Event, Unit>getOnTyping()abstract UnitsetOnTyping(Function1<Event, Unit> onTyping)abstract Function1<Event, Unit>getOnMessageDelivered()abstract UnitsetOnMessageDelivered(Function1<Event, Unit> onMessageDelivered)abstract Function1<Event, Unit>getOnMessageRead()abstract UnitsetOnMessageRead(Function1<Event, Unit> onMessageRead)abstract Function1<Event, Unit>getOnParticipantIdle()abstract UnitsetOnParticipantIdle(Function1<Event, Unit> onParticipantIdle)abstract Function1<Event, Unit>getOnParticipantReturned()abstract UnitsetOnParticipantReturned(Function1<Event, Unit> onParticipantReturned)abstract Function1<Event, Unit>getOnParticipantInvited()abstract UnitsetOnParticipantInvited(Function1<Event, Unit> onParticipantInvited)abstract Function1<Event, Unit>getOnAutoDisconnection()abstract UnitsetOnAutoDisconnection(Function1<Event, Unit> onAutoDisconnection)abstract Function1<Event, Unit>getOnChatRehydrated()abstract UnitsetOnChatRehydrated(Function1<Event, Unit> onChatRehydrated)abstract Function1<Event, Unit>getOnParticipantJoined()abstract UnitsetOnParticipantJoined(Function1<Event, Unit> onParticipantJoined)abstract Function1<Event, Unit>getOnParticipantLeft()abstract UnitsetOnParticipantLeft(Function1<Event, Unit> onParticipantLeft)abstract Function1<Event, Unit>getOnTransferSucceeded()abstract UnitsetOnTransferSucceeded(Function1<Event, Unit> onTransferSucceeded)abstract Function1<Event, Unit>getOnTransferFailed()abstract UnitsetOnTransferFailed(Function1<Event, Unit> onTransferFailed)abstract Function1<Event, Unit>getOnChatEnded()abstract UnitsetOnChatEnded(Function1<Event, Unit> onChatEnded)abstract BooleangetIsChatSessionActive()abstract UnitsetIsChatSessionActive(Boolean isChatSessionActive)-
-
Method Detail
-
configure
abstract Unit configure(GlobalConfig config)
-
getConnectionDetailsProvider
abstract ConnectionDetailsProvider getConnectionDetailsProvider()
Returns ConnectionDetailsProvider object
-
connect
abstract Result<Boolean> connect(ChatDetails chatDetails)
Connects to a chat session with the specified chat details.
- Parameters:
chatDetails- The details of the chat.
-
disconnect
abstract Result<Boolean> disconnect()
Disconnects the current chat session.
-
suspendWebSocketConnection
abstract Result<Boolean> suspendWebSocketConnection()
Disconnects the websocket and suspends reconnection attempts.
-
resumeWebSocketConnection
abstract Result<Boolean> resumeWebSocketConnection()
Resumes a suspended websocket and attempts to reconnect.
-
reset
abstract Result<Boolean> reset()
Resets the current state which will disconnect the webSocket and remove all session related data without disconnecting the participant from the chat contact.
-
sendMessage
abstract Result<Boolean> sendMessage(ContentType contentType, String message)
Sends a message.
- Parameters:
contentType- The content type of the message.message- The message content.
-
resendFailedMessage
abstract Result<Boolean> resendFailedMessage(String messageId)
Retry a message that failed to be sent.
- Parameters:
messageId- The Id of the message that failed to be sent.
-
sendEvent
abstract Result<Boolean> sendEvent(ContentType contentType, String event)
Sends an event.
- Parameters:
contentType- The content type of the event.event- The event content.
-
sendAttachment
abstract Result<Boolean> sendAttachment(Uri fileUri)
Sends an attachment.
-
downloadAttachment
abstract Result<URL> downloadAttachment(String attachmentId, String filename)
Downloads an attachment.
- Parameters:
attachmentId- The ID of the attachment to download.filename- The name of the file to save the attachment as.
-
getAttachmentDownloadUrl
abstract Result<URL> getAttachmentDownloadUrl(String attachmentId)
Returns the S3 download URL for an attachment.
- Parameters:
attachmentId- The ID of the attachment.
-
getTranscript
abstract Result<TranscriptResponse> getTranscript(ScanDirection scanDirection, SortKey sortKey, Integer maxResults, String nextToken, String startPosition)
Gets the transcript.
- Parameters:
scanDirection- The direction of the scan.sortKey- The sort key.maxResults- The maximum number of results.nextToken- The next token.startPosition- The start position.
-
sendMessageReceipt
abstract Result<Boolean> sendMessageReceipt(TranscriptItem transcriptItem, MessageReceiptType receiptType)
Sends a message receipt.
- Parameters:
transcriptItem- The transcript item.receiptType- The type of the receipt.
-
describeView
abstract Result<View> describeView(String viewToken)
Retrieves the view for the specified view token.
- Parameters:
viewToken- An encrypted token originating from the interactive message of a ShowView block operation.
-
getOnChatSessionStateChanged
abstract Function1<Boolean, Unit> getOnChatSessionStateChanged()
Checks if a chat session is currently active.
-
setOnChatSessionStateChanged
abstract Unit setOnChatSessionStateChanged(Function1<Boolean, Unit> onChatSessionStateChanged)
Checks if a chat session is currently active.
-
getOnConnectionEstablished
abstract Function0<Unit> getOnConnectionEstablished()
-
setOnConnectionEstablished
abstract Unit setOnConnectionEstablished(Function0<Unit> onConnectionEstablished)
-
getOnConnectionReEstablished
abstract Function0<Unit> getOnConnectionReEstablished()
-
setOnConnectionReEstablished
abstract Unit setOnConnectionReEstablished(Function0<Unit> onConnectionReEstablished)
-
getOnConnectionBroken
abstract Function0<Unit> getOnConnectionBroken()
-
setOnConnectionBroken
abstract Unit setOnConnectionBroken(Function0<Unit> onConnectionBroken)
-
getOnDeepHeartBeatFailure
abstract Function0<Unit> getOnDeepHeartBeatFailure()
-
setOnDeepHeartBeatFailure
abstract Unit setOnDeepHeartBeatFailure(Function0<Unit> onDeepHeartBeatFailure)
-
getOnMessageReceived
abstract Function1<TranscriptItem, Unit> getOnMessageReceived()
-
setOnMessageReceived
abstract Unit setOnMessageReceived(Function1<TranscriptItem, Unit> onMessageReceived)
-
getOnTranscriptUpdated
abstract Function1<TranscriptData, Unit> getOnTranscriptUpdated()
-
setOnTranscriptUpdated
abstract Unit setOnTranscriptUpdated(Function1<TranscriptData, Unit> onTranscriptUpdated)
-
getOnTyping
abstract Function1<Event, Unit> getOnTyping()
-
setOnTyping
abstract Unit setOnTyping(Function1<Event, Unit> onTyping)
-
getOnMessageDelivered
abstract Function1<Event, Unit> getOnMessageDelivered()
-
setOnMessageDelivered
abstract Unit setOnMessageDelivered(Function1<Event, Unit> onMessageDelivered)
-
getOnMessageRead
abstract Function1<Event, Unit> getOnMessageRead()
-
setOnMessageRead
abstract Unit setOnMessageRead(Function1<Event, Unit> onMessageRead)
-
getOnParticipantIdle
abstract Function1<Event, Unit> getOnParticipantIdle()
-
setOnParticipantIdle
abstract Unit setOnParticipantIdle(Function1<Event, Unit> onParticipantIdle)
-
getOnParticipantReturned
abstract Function1<Event, Unit> getOnParticipantReturned()
-
setOnParticipantReturned
abstract Unit setOnParticipantReturned(Function1<Event, Unit> onParticipantReturned)
-
getOnParticipantInvited
abstract Function1<Event, Unit> getOnParticipantInvited()
-
setOnParticipantInvited
abstract Unit setOnParticipantInvited(Function1<Event, Unit> onParticipantInvited)
-
getOnAutoDisconnection
abstract Function1<Event, Unit> getOnAutoDisconnection()
-
setOnAutoDisconnection
abstract Unit setOnAutoDisconnection(Function1<Event, Unit> onAutoDisconnection)
-
getOnChatRehydrated
abstract Function1<Event, Unit> getOnChatRehydrated()
-
setOnChatRehydrated
abstract Unit setOnChatRehydrated(Function1<Event, Unit> onChatRehydrated)
-
getOnParticipantJoined
abstract Function1<Event, Unit> getOnParticipantJoined()
-
setOnParticipantJoined
abstract Unit setOnParticipantJoined(Function1<Event, Unit> onParticipantJoined)
-
getOnParticipantLeft
abstract Function1<Event, Unit> getOnParticipantLeft()
-
setOnParticipantLeft
abstract Unit setOnParticipantLeft(Function1<Event, Unit> onParticipantLeft)
-
getOnTransferSucceeded
abstract Function1<Event, Unit> getOnTransferSucceeded()
-
setOnTransferSucceeded
abstract Unit setOnTransferSucceeded(Function1<Event, Unit> onTransferSucceeded)
-
getOnTransferFailed
abstract Function1<Event, Unit> getOnTransferFailed()
-
setOnTransferFailed
abstract Unit setOnTransferFailed(Function1<Event, Unit> onTransferFailed)
-
getOnChatEnded
abstract Function1<Event, Unit> getOnChatEnded()
-
setOnChatEnded
abstract Unit setOnChatEnded(Function1<Event, Unit> onChatEnded)
-
getIsChatSessionActive
abstract Boolean getIsChatSessionActive()
-
setIsChatSessionActive
abstract Unit setIsChatSessionActive(Boolean isChatSessionActive)
-
-
-
-