com.voximplant.sdk.messaging

Interface IMessenger



  • public interface IMessenger
    Interface that may be used to control messaging functions.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void addMessengerListener(IMessengerListener listener)
      Add IMessengerListener to handle messenger events.
      void createConversation(java.util.List<ConversationParticipant> participants)
      Create new conversation.
      void createConversation(java.util.List<ConversationParticipant> participants, ConversationConfig conversationConfig)
      Create new conversation with extended configuration.
      void editUser(java.util.Map<java.lang.Object,java.lang.Object> customData, java.util.Map<java.lang.Object,java.lang.Object> privateCustomData)
      Edit current user information.
      void getConversation(java.lang.String uuid)
      Get conversation by it's UUID.
      void getConversations(java.util.List<java.lang.String> uuids)
      Get multiple conversations by array of UUIDs.
      java.lang.String getMe()
      Get the Voximplant user identifier, ex 'username@appname.accname', for the current user
      void getUser(java.lang.String user)
      Get user information for the user specified by the Voximplant user identifier, ex 'username@appname.accname'.
      void getUsers(java.util.List<java.lang.String> users)
      Get user information for the users specified by the list of the Voximplant user identifiers, ex 'username@appname.accname'.
      void joinConversation(java.lang.String uuid)
      Join current user to the conversation specified by the UUID.
      void leaveConversation(java.lang.String uuid)
      Leave current user from the conversation specified by the UUID.
      void managePushNotifications(java.util.List<MessengerNotifications> notifications)
      Manage messenger push notification subscriptions.
      IConversation recreateConversation(java.util.List<ConversationParticipant> participants, java.lang.String uuid, java.lang.String title, long sequence, boolean publicJoin, java.util.List<java.lang.String> moderators, long lastUpdate, long lastRead, boolean distinct, java.util.Map<java.lang.Object,java.lang.Object> customData, long createdAt)
      Recreate conversation.
      IMessage recreateMessage(java.lang.String uuid, java.lang.String conversationUUID, java.lang.String sender, java.lang.String text, java.util.List<Payload> payload, long sequence)
      Recreate a message.
      void removeConversation(java.lang.String uuid)
      Remove the conversation specified by the UUID.
      void removeMessengerListener(IMessengerListener listener)
      Remove previously added IMessengerListener.
      void setStatus(boolean online)
      Set user presence status.
      void subscribe(java.util.List<java.lang.String> users)
      Subscribe for user information change and presence status change.
      void unSubscribe(java.util.List<java.lang.String> users)
      Unsubscribe for user information change and presence status change.
    • Method Detail

      • getMe

        java.lang.String getMe()
        Get the Voximplant user identifier, ex 'username@appname.accname', for the current user
        Returns:
        Current user identifier
      • addMessengerListener

        void addMessengerListener(IMessengerListener listener)
        Add IMessengerListener to handle messenger events.
        Parameters:
        listener - IMessengerListener listener
        See Also:
        IMessengerListener
      • removeMessengerListener

        void removeMessengerListener(IMessengerListener listener)
        Remove previously added IMessengerListener.
        Parameters:
        listener - IMessengerListener listener
        See Also:
        IMessengerListener
      • getUser

        void getUser(java.lang.String user)
        Get user information for the user specified by the Voximplant user identifier, ex 'username@appname.accname'.
        Parameters:
        user - User identifier
        See Also:
        IMessengerListener.onGetUser(IUserEvent)
      • getUsers

        void getUsers(java.util.List<java.lang.String> users)
        Get user information for the users specified by the list of the Voximplant user identifiers, ex 'username@appname.accname'.
        Parameters:
        users - List of user identifiers
        See Also:
        IMessengerListener.onGetUser(IUserEvent)
      • editUser

        void editUser(java.util.Map<java.lang.Object,java.lang.Object> customData, java.util.Map<java.lang.Object,java.lang.Object> privateCustomData)
        Edit current user information.
        Parameters:
        customData - New custom data. If null, previously set custom data will not be changed. If empty map, previously set custom data will be removed.
        privateCustomData - New private custom data. If null, previously set private custom data will not be changed. If empty map, previously set private custom data will be removed.
        See Also:
        IMessengerListener.onEditUser(IUserEvent)
      • unSubscribe

        void unSubscribe(java.util.List<java.lang.String> users)
        Unsubscribe for user information change and presence status change.
        Parameters:
        users - List of full Voximplant user identifiers, ex 'username@appname.accname'
        See Also:
        IMessengerListener.onUnsubscribe(ISubscriptionEvent)
      • setStatus

        void setStatus(boolean online)
        Set user presence status. Triggers the IMessengerListener.onSetStatus(IStatusEvent) event for all messenger objects on all connected clients which are subscribed for notifications about this user. Including this one if conditions are met.
        Parameters:
        online - True if user is available for messaging, false otherwise
      • recreateConversation

        IConversation recreateConversation(java.util.List<ConversationParticipant> participants, java.lang.String uuid, java.lang.String title, long sequence, boolean publicJoin, java.util.List<java.lang.String> moderators, long lastUpdate, long lastRead, boolean distinct, java.util.Map<java.lang.Object,java.lang.Object> customData, long createdAt)
        Recreate conversation. Note that this method does not create conversation, but restore previously created conversation.
        Parameters:
        participants - List of ConversationParticipant
        uuid - Conversation UUID
        title - Conversation title
        sequence - Sequence of last event
        publicJoin - Public join option of the conversation
        moderators - List of conversation's moderators
        lastUpdate - UNIX timestamp that specifies the time of the last event in the conversation
        lastRead - Sequence of last event that was read by user
        distinct - Distinct option of the conversation
        customData - Object with custom data, up to 5kb.
        createdAt - UNIX timestamp that specifies the time of the conversation creation
        Returns:
        IConversation object
      • recreateMessage

        IMessage recreateMessage(java.lang.String uuid, java.lang.String conversationUUID, java.lang.String sender, java.lang.String text, java.util.List<Payload> payload, long sequence)
        Recreate a message. Note that this method does not create message, but restore previously created message.
        Parameters:
        uuid - Universally unique identifier of message
        conversationUUID - UUID of the conversation this message belongs to
        sender - User id of the sender of this message
        text - Text of this message
        payload - List of Payload objects associated with the message
        sequence - Message sequence number
        Returns:
        IMessage object