Class ChatLog
- java.lang.Object
-
- com.zopim.android.sdk.model.ChatLog
-
- All Implemented Interfaces:
- java.lang.Comparable<ChatLog>
public class ChatLog extends java.lang.Object implements java.lang.Comparable<ChatLog>
This is a model class for chat log that will be created byLivechatChatLogPath
.It is used to tell update to the chat log event of a chat session. Contains visitor/agent messages, system events and triggers.
You can subscribe to chat log broadcast via
com.zopim.android.sdk.data.DataSource#addChatLogObserver(java.util.Observer)
usingChatLogObserver
This class is a model that will be serialised to JSON and deserialised from JSON to this model. As such it does not follow the m naming prefix for fields.
- See Also:
- Agent Dashboard, Triggers Dashboard
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
ChatLog.Error
Error type that can occur.static class
ChatLog.Option
Model definition of an agent questionnaire option itemstatic class
ChatLog.Rating
Definition of valid chat ratings.static class
ChatLog.Type
Definition of available chat log types.
-
Constructor Summary
Constructors Constructor and Description ChatLog()
ChatLog(java.lang.String displayName, ChatLog.Type type, java.lang.String message)
Constructor for chat log message that allows creation of a local message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
compareTo(ChatLog chatLog)
Compares twoChatLog
by their time of creation.Attachment
getAttachment()
Gets attachment in this eventjava.lang.String
getComment()
Gets the comment for this chat logjava.lang.String
getDisplayName()
Gets display name of the visitor.ChatLog.Error
getError()
Gets error that occurred in this chat log eventjava.io.File
getFile()
Gets file attachment in thisChatLog
Files being attached viaChatApiCommands.send(File)
java.lang.String
getFileName()
Gets file name of the file in thisChatLog
java.lang.String
getMessage()
Gets message body of this chat log event.java.lang.String
getNick()
Gets a nick name of the chat log participant.ChatLog.Option[]
getOptions()
Gets an array of options when a questionnaire chat log message is questionnaire sent by an agentint
getProgress()
Gets the current transfer progressChatLog.Rating
getRating()
Gets the rating for this chat logjava.lang.Long
getTimestamp()
Time record of this event in millisecondsChatLog.Type
getType()
Gets type of the chat log message.java.net.URL
getUploadUrl()
Gets a copy of uploadURL
stored in thisChatLog
eventjava.lang.Integer
getVisitorQueue()
Gets number of visitors in the queue being currently served in this chat session.java.lang.Boolean
isFailed()
Tells if this chat log failed to sendjava.lang.Boolean
isUnverified()
Tells if this chat log event has been received and verified by the server.void
setComment(java.lang.String comment)
Sets the comment for this chat logvoid
setError(ChatLog.Error error)
Sets the error to this chat logvoid
setFailed(boolean failed)
Sets if chat log failed to sendvoid
setFile(java.io.File file)
Sets file to this chat log eventvoid
setProgress(int progress)
Sets progress for this chat logvoid
setRawNewRating(java.lang.String rawNewRating)
void
setRawRating(java.lang.String rawRating)
java.lang.String
toString()
-
-
-
Constructor Detail
-
ChatLog
public ChatLog()
-
ChatLog
public ChatLog(java.lang.String displayName, ChatLog.Type type, java.lang.String message)
Constructor for chat log message that allows creation of a local message.- Parameters:
displayName
- of the visitor/agent or null if unspecifiedtype
- of the message defined inChatLog.RawType
message
- content or null if none
-
-
Method Detail
-
getAttachment
public Attachment getAttachment()
Gets attachment in this event- Returns:
- attachment model
-
getTimestamp
public java.lang.Long getTimestamp()
Time record of this event in milliseconds- Returns:
- timestamp
-
getNick
public java.lang.String getNick()
Gets a nick name of the chat log participant. It can be used as unique id for visitors or agents depending of the chat log type.- Returns:
- nick
- See Also:
ChatLog.Type
-
getDisplayName
public java.lang.String getDisplayName()
Gets display name of the visitor.Display name can be configured using
VisitorInfo
viaZopimChatApi.setVisitorInfo(VisitorInfo)
- Returns:
- name of the visitor
-
getType
public ChatLog.Type getType()
Gets type of the chat log message.Chat log type will be different based on the log event. Eg. it can be a visitor message, system event or a trigger. See definition of available types are are defined in
ChatLog.Type
.- Returns:
- type of the chat log event.
ChatLog.Type.UNKNOWN
if not found or error occurred.
-
getMessage
public java.lang.String getMessage()
Gets message body of this chat log event. It can be null based on the type of the chat log.- Returns:
- message body
- See Also:
ChatLog.getType()
-
getOptions
public ChatLog.Option[] getOptions()
Gets an array of options when a questionnaire chat log message is questionnaire sent by an agentIf no options are available it will return an empty string array
- Returns:
- options available for the questionnaire
- See Also:
- Shortcuts Agent Dashboard
-
getFile
public java.io.File getFile()
Gets file attachment in thisChatLog
Files being attached viaChatApiCommands.send(File)
- Returns:
- file attached
-
setFile
public void setFile(java.io.File file)
Sets file to this chat log event- Parameters:
file
- to append to this chat log event
-
getFileName
public java.lang.String getFileName()
Gets file name of the file in thisChatLog
- Returns:
- file name
-
getError
public ChatLog.Error getError()
Gets error that occurred in this chat log event- Returns:
- error type
-
setError
public void setError(ChatLog.Error error)
Sets the error to this chat log- Parameters:
error
- type
-
getUploadUrl
public java.net.URL getUploadUrl()
Gets a copy of uploadURL
stored in thisChatLog
event- Returns:
- url in this log
-
getProgress
public int getProgress()
Gets the current transfer progress- Returns:
- progress values 0 - 100
-
setProgress
public void setProgress(int progress)
Sets progress for this chat log- Parameters:
progress
- in range 0 - 100
-
getRating
public ChatLog.Rating getRating()
Gets the rating for this chat log- Returns:
- rating of the chat
-
setRawNewRating
public void setRawNewRating(java.lang.String rawNewRating)
-
setRawRating
public void setRawRating(java.lang.String rawRating)
-
getComment
public java.lang.String getComment()
Gets the comment for this chat log- Returns:
- comment on the chat
-
setComment
public void setComment(java.lang.String comment)
Sets the comment for this chat log- Parameters:
comment
- to set
-
getVisitorQueue
public java.lang.Integer getVisitorQueue()
Gets number of visitors in the queue being currently served in this chat session. It can be null based on the type of the chat log.- Returns:
- number of visitors in queue
- See Also:
ChatLog.getType()
-
isUnverified
public java.lang.Boolean isUnverified()
Tells if this chat log event has been received and verified by the server. All events that originate from the device will start as unverified until they get transited to the server and verified.- Returns:
- true if verified, false if not verified, null if not specified
-
isFailed
public java.lang.Boolean isFailed()
Tells if this chat log failed to send- Returns:
- false if the succeeded, true if it failed, null if unspecified
-
setFailed
public void setFailed(boolean failed)
Sets if chat log failed to send- Parameters:
failed
- true if failed, false otherwise
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(ChatLog chatLog)
Compares twoChatLog
by their time of creation. This is used for ascending sort of the incoming chat log events.- Specified by:
compareTo
in interfacejava.lang.Comparable<ChatLog>
- Parameters:
chatLog
- to compare with- Returns:
- -1 if chatLog param is more recent event, 1 if this is more recent, 0 if their time is the same or there was an error
-
-