public class ChatLog extends Object implements 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 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(String displayName,
ChatLog.Type type,
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
|
String |
getComment()
Gets the comment for this chat log
|
String |
getDisplayName()
Gets display name of the visitor.
|
ChatLog.Error |
getError()
Gets error that occurred in this chat log event
|
File |
getFile()
Gets file attachment in this
ChatLog
Files being attached via ChatApiCommands.send(File) |
String |
getFileName()
Gets file name of the file in this
ChatLog |
String |
getMessage()
Gets message body of this chat log event.
|
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
|
Long |
getTimestamp()
Time record of this event in milliseconds
|
ChatLog.Type |
getType()
Gets type of the chat log message.
|
URL |
getUploadUrl()
|
Integer |
getVisitorQueue()
Gets number of visitors in the queue being currently served in this chat session.
|
Boolean |
isFailed()
Tells if this chat log failed to send
|
Boolean |
isUnverified()
Tells if this chat log event has been received and verified by the server.
|
void |
setComment(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(File file)
Sets file to this chat log event
|
void |
setProgress(int progress)
Sets progress for this chat log
|
void |
setRating(ChatLog.Rating rating)
Sets the rating for this chat log
|
String |
toString() |
public ChatLog()
public ChatLog(String displayName, ChatLog.Type type, 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 Long getTimestamp()
@Nullable public String getNick()
ChatLog.Type
@Nullable public 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 String getMessage()
getType()
@NonNull public ChatLog.Option[] getOptions()
If no options are available it will return an empty string array
@Nullable public File getFile()
ChatLog
Files being attached via ChatApiCommands.send(File)
public void setFile(File file)
file
- to append to this chat log event@Nullable public String getFileName()
ChatLog
@NonNull public ChatLog.Error getError()
public void setError(ChatLog.Error error)
error
- type@NonNull public int getProgress()
public void setProgress(int progress)
progress
- in range 0 - 100public ChatLog.Rating getRating()
public void setRating(ChatLog.Rating rating)
rating
- to setpublic String getComment()
public void setComment(String comment)
comment
- to set@Nullable public Integer getVisitorQueue()
getType()
@Nullable public Boolean isUnverified()
@Nullable public Boolean isFailed()
public void setFailed(boolean failed)
failed
- true if failed, false otherwisepublic 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 Comparable<ChatLog>
chatLog
- to compare with