com.voximplant.sdk.messaging

Interface IConversation



  • public interface IConversation
    Interface that may be used to manage conversation.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void addModerators(java.util.List<java.lang.String> moderators)
      Add new moderators to the conversation.
      void addParticipants(java.util.List<ConversationParticipant> participants)
      Add new participants to the conversation.
      void editParticipants(java.util.List<ConversationParticipant> participants)
      Edit participants' access rights.
      long getCreatedTime()
      Get UNIX timestamp that specifies the time of the conversation creation.
      java.util.Map<java.lang.Object,java.lang.Object> getCustomData()
      Get object with custom data, up to 5kb.
      long getLastRead()
      Get sequence of last event that was read by user.
      long getLastSequence()
      Returns sequence of last event that was read by user.
      long getLastUpdateTime()
      Get UNIX timestamp that specifies the time of the last event in the conversation.
      java.util.List<java.lang.String> getModerators()
      Get conversation moderator names list.
      java.util.List<ConversationParticipant> getParticipants()
      Get conversation participants list alongside with their rights.
      java.lang.String getTitle()
      Get current conversation title.
      java.lang.String getUUID()
      Get universally unique identifier of current conversation.
      boolean isDistinct()
      Check if the conversation is distinct.
      boolean isPublicJoin()
      Check if public join is enabled.
      void markAsDelivered(long sequence)
      Mark event with the specified sequence as handled by current logged-in device.
      void markAsRead(long sequence)
      Mark the event with the specified sequence as 'read'.
      void remove()
      Remove current conversation.
      void removeModerators(java.util.List<java.lang.String> moderators)
      Remove moderators from the conversation.
      void removeParticipants(java.util.List<ConversationParticipant> participants)
      Remove participants from the conversation.
      void retransmitEvents(long eventsFrom, long eventsTo)
      Request events in the specified sequence range to be sent from server into this client.
      IMessage sendMessage(java.lang.String text, java.util.List<Payload> payload)
      Send message to the conversation.
      void setCustomData(java.util.Map<java.lang.Object,java.lang.Object> customData)
      Set new custom data for the conversation.
      void setDistinct(boolean distinct)
      Set distinct property of the conversation.
      void setPublicJoin(boolean publicJoin)
      Set public join property of the conversation.
      void setTitle(java.lang.String title)
      Set current conversation title.
      boolean typing()
      Calling this method will inform backend that user is typing some text.
      void update()
      Send conversation changes to the server.
    • Method Detail

      • getCreatedTime

        long getCreatedTime()
        Get UNIX timestamp that specifies the time of the conversation creation.
        Returns:
        UNIX timestamp
      • getCustomData

        java.util.Map<java.lang.Object,java.lang.Object> getCustomData()
        Get object with custom data, up to 5kb.
        Returns:
        Custom data of the conversation
      • isDistinct

        boolean isDistinct()
        Check if the conversation is distinct. If two conversations are created with same set of users and moderators and both have 'distinct' flag, second create call will fail with the UUID of conversation already created. Note that changing users or moderators list will clear 'distinct' flag.
        Returns:
        True if the conversation is distinct, false otherwise
      • getLastRead

        long getLastRead()
        Get sequence of last event that was read by user. Used to display unread messages, events etc.
        Returns:
        Sequence of last event that was read by user
      • getModerators

        java.util.List<java.lang.String> getModerators()
        Get conversation moderator names list.
        Returns:
        Conversation moderator names list
      • getParticipants

        java.util.List<ConversationParticipant> getParticipants()
        Get conversation participants list alongside with their rights.
        Returns:
        Conversation participants list alongside with their rights
      • isPublicJoin

        boolean isPublicJoin()
        Check if public join is enabled. If set to true, anyone can join conversation by UUID.
        Returns:
        True if piblic join is enabled, false otherwise
      • getTitle

        java.lang.String getTitle()
        Get current conversation title.
        Returns:
        The conversation title
      • getUUID

        java.lang.String getUUID()
        Get universally unique identifier of current conversation.
        Returns:
        UUID of the conversation
      • getLastUpdateTime

        long getLastUpdateTime()
        Get UNIX timestamp that specifies the time of the last event in the conversation.
        Returns:
        UNIX timestamp
      • getLastSequence

        long getLastSequence()
        Returns sequence of last event that was read by user.
        Returns:
        Sequence of last event that was read by user
      • setTitle

        void setTitle(java.lang.String title)
        Set current conversation title. Note that setting this property does not send changes to the server. Use the 'update' to send all changes at once.
        Parameters:
        title - New conversation title
      • setPublicJoin

        void setPublicJoin(boolean publicJoin)
        Set public join property of the conversation. Note that setting this property does not send changes to the server. Use the 'update' to send all changes at once
        Parameters:
        publicJoin - If set to 'true', anyone can join conversation by UUID
      • setDistinct

        void setDistinct(boolean distinct)
        Set distinct property of the conversation. Note that changing users or moderators list will clear 'distinct' flag of the conversation. Note that setting this property does not send changes to the server. Use the update() to send all changes at once
        Parameters:
        distinct - If two conversations are created with same set of users and moderators and both have 'distinct' flag, second create call will fail with the UUID of conversation already created.
      • setCustomData

        void setCustomData(java.util.Map<java.lang.Object,java.lang.Object> customData)
        Set new custom data for the conversation. Note that setting this property does not send changes to the server. Use the update() to send all changes at once
        Parameters:
        customData - Custom data of the conversation
      • update

        void update()
        Send conversation changes to the server. The changes sent are: title, public join flag, distinct flag and custom data.
      • addModerators

        void addModerators(java.util.List<java.lang.String> moderators)
        Add new moderators to the conversation. Duplicated users are ignored. Will fail if any user does not exist. Triggers the IMessengerListener.onEditConversation(IConversationEvent) event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.
        Parameters:
        moderators - List of moderators to be added to the conversation
      • removeModerators

        void removeModerators(java.util.List<java.lang.String> moderators)
        Remove moderators from the conversation. Duplicated users are ignored. Will fail if any user does not exist. Triggers the IMessengerListener.onEditConversation(IConversationEvent) event for all messenger objects on all clients, including this one. Clients that are not connected will receive it later.
        Parameters:
        moderators - List of moderators to be removed from the conversation
      • retransmitEvents

        void retransmitEvents(long eventsFrom, long eventsTo)
        Request events in the specified sequence range to be sent from server into this client. Used to get history or get missed events in case of network disconnect. Please note that server will not push any events that was missed due to the client being offline. Client should use this method to request all events based on the last event sequence received from the server and last event sequence saved locally (if any).
        Parameters:
        eventsFrom - First event in range sequence, inclusive
        eventsTo - Last event in range sequence, inclusive
        See Also:
        IMessengerListener.onRetransmitEvents(IRetransmitEvent)
      • typing

        boolean typing()
        Calling this method will inform backend that user is typing some text. Calls within 10s interval from the last call are discarded.
        Returns:
        True is message was actually sent, false if it was discarded
        See Also:
        IMessengerListener.onTyping(IConversationServiceEvent)
      • markAsDelivered

        void markAsDelivered(long sequence)
        Mark event with the specified sequence as handled by current logged-in device. If single user is logged in on multiple devices, this can be used to display delivery status
        Parameters:
        sequence - Sequence number of the event to be marked as delivered
        See Also:
        IMessengerListener.isDelivered(IConversationServiceEvent)
      • markAsRead

        void markAsRead(long sequence)
        Mark the event with the specified sequence as 'read'. This affects 'lastRead' and is used to display unread messages and events.
        Parameters:
        sequence - Sequence number of the event to be marked as read
        See Also:
        IMessengerListener.isRead(IConversationServiceEvent)