public class ChatLog extends java.lang.Object implements java.lang.Comparable<ChatLog>
LivechatChatLogPath
.
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)
using ChatLogObserver
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.
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 item
|
static class |
ChatLog.Rating
Definition of valid chat ratings.
|
static class |
ChatLog.Type
Definition of available chat log types.
|
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.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ChatLog chatLog)
Compares two
ChatLog by their time of creation. |
Attachment |
getAttachment()
Gets attachment in this event
|
java.lang.String |
getComment()
Gets the comment for this chat log
|
java.lang.String |
getDisplayName()
Gets display name of the visitor.
|
ChatLog.Error |
getError()
Gets error that occurred in this chat log event
|
java.io.File |
getFile()
Gets file attachment in this
ChatLog
Files being attached via ChatApiCommands.send(File) |
java.lang.String |
getFileName()
Gets file name of the file in this
ChatLog |
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 agent
|
int |
getProgress()
Gets the current transfer progress
|
ChatLog.Rating |
getRating()
Gets the rating for this chat log
|
java.lang.Long |
getTimestamp()
Time record of this event in milliseconds
|
ChatLog.Type |
getType()
Gets type of the chat log message.
|
java.net.URL |
getUploadUrl()
Gets a copy of upload
URL stored in this ChatLog event |
java.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 send
|
java.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 log
|
void |
setError(ChatLog.Error error)
Sets the error to this chat log
|
void |
setFailed(boolean failed)
Sets if chat log failed to send
|
void |
setFile(java.io.File file)
Sets file to this chat log event
|
void |
setProgress(int progress)
Sets progress for this chat log
|
void |
setRawNewRating(java.lang.String rawNewRating) |
void |
setRawRating(java.lang.String rawRating) |
java.lang.String |
toString() |
public ChatLog()
public ChatLog(java.lang.String displayName, ChatLog.Type type, java.lang.String message)
displayName
- of the visitor/agent or null if unspecifiedtype
- of the message defined in ChatLog.RawType
message
- content or null if none@Nullable public Attachment getAttachment()
@Nullable public java.lang.Long getTimestamp()
@Nullable public java.lang.String getNick()
ChatLog.Type
@Nullable public java.lang.String getDisplayName()
Display name can be configured using VisitorInfo
via ZopimChatApi.setVisitorInfo(VisitorInfo)
@NonNull public ChatLog.Type getType()
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
.
ChatLog.Type.UNKNOWN
if not found or error occurred.@Nullable public java.lang.String getMessage()
getType()
@NonNull public ChatLog.Option[] getOptions()
If no options are available it will return an empty string array
@Nullable public java.io.File getFile()
ChatLog
Files being attached via ChatApiCommands.send(File)
public void setFile(java.io.File file)
file
- to append to this chat log event@Nullable public java.lang.String getFileName()
ChatLog
@NonNull public ChatLog.Error getError()
public void setError(ChatLog.Error error)
error
- type@Nullable public java.net.URL getUploadUrl()
URL
stored in this ChatLog
event@NonNull public int getProgress()
public void setProgress(int progress)
progress
- in range 0 - 100public ChatLog.Rating getRating()
public void setRawNewRating(java.lang.String rawNewRating)
public void setRawRating(java.lang.String rawRating)
public java.lang.String getComment()
public void setComment(java.lang.String comment)
comment
- to set@Nullable public java.lang.Integer getVisitorQueue()
getType()
@Nullable public java.lang.Boolean isUnverified()
@Nullable public java.lang.Boolean isFailed()
public void setFailed(boolean failed)
failed
- true if failed, false otherwisepublic java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(@Nullable ChatLog chatLog)
ChatLog
by their time of creation. This is used for ascending sort of the incoming chat log events.compareTo
in interface java.lang.Comparable<ChatLog>
chatLog
- to compare with