Class ChatLog

  • All Implemented Interfaces:

    public class ChatLog
    extends java.lang.Object
    implements java.lang.Comparable<ChatLog>
    This is a model class for chat log that will be created by 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 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.

    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 item
      static class  ChatLog.Rating
      Definition of valid chat ratings.
      static class  ChatLog.Type
      Definition of available chat log types.
    • Constructor Summary

      Constructor and Description
      ChatLog(java.lang.String displayName, ChatLog.Type type, java.lang.String message)
      Constructor for chat log message that allows creation of a local message.
    • 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.
        displayName - of the visitor/agent or null if unspecified
        type - of the message defined in ChatLog.RawType
        message - content or null if none
    • Method Detail

      • getAttachment

        public Attachment getAttachment()
        Gets attachment in this event
        attachment model
      • getTimestamp

        public java.lang.Long getTimestamp()
        Time record of this event in milliseconds
      • 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.
        See Also:
      • 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.

        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.
        message body
        See Also:
      • getOptions

        public ChatLog.Option[] getOptions()
        Gets an array of options when a questionnaire chat log message is questionnaire sent by an agent

        If no options are available it will return an empty string array

        options available for the questionnaire
        See Also:
        Shortcuts Agent Dashboard
      • setFile

        public void setFile( file)
        Sets file to this chat log event
        file - to append to this chat log event
      • getFileName

        public java.lang.String getFileName()
        Gets file name of the file in this ChatLog
        file name
      • getError

        public ChatLog.Error getError()
        Gets error that occurred in this chat log event
        error type
      • setError

        public void setError(ChatLog.Error error)
        Sets the error to this chat log
        error - type
      • getUploadUrl

        public getUploadUrl()
        Gets a copy of upload URL stored in this ChatLog event
        url in this log
      • getProgress

        public int getProgress()
        Gets the current transfer progress
        progress values 0 - 100
      • setProgress

        public void setProgress(int progress)
        Sets progress for this chat log
        progress - in range 0 - 100
      • getRating

        public ChatLog.Rating getRating()
        Gets the rating for this chat log
        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
        comment on the chat
      • setComment

        public void setComment(java.lang.String comment)
        Sets the comment for this chat log
        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.
        number of visitors in queue
        See Also:
      • 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.
        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
        false if the succeeded, true if it failed, null if unspecified
      • setFailed

        public void setFailed(boolean failed)
        Sets if chat log failed to send
        failed - true if failed, false otherwise
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • compareTo

        public int compareTo(ChatLog chatLog)
        Compares two ChatLog by their time of creation. This is used for ascending sort of the incoming chat log events.
        Specified by:
        compareTo in interface java.lang.Comparable<ChatLog>
        chatLog - to compare with
        -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