Interface MessagingService


  • public interface MessagingService
    The MessagingService object is accessible from the User object, and provides access to messaging related capabilities and actions.

    The MessagingService object provides a set of APIs that allow application developers to manage text conversations along with rich media attachments.

    In general, the capabilities and the set of allowed operations are dependent on the capabilities of the messaging server. A messaging conversation doesn't have any moderator once it is started by any user.

    The client application is notified about status updates reported by the messaging server through listener that the application has added to the MessagingService object. These updates may be the result of local operations on the MessagingService object as well as remote changes initiated by either the server or other participants of any conversation.

    • Method Detail

      • isServiceAvailable

        boolean isServiceAvailable()
        A Boolean value indicating whether the messaging service is available. This value is closely connected with capabilities - if the service is not running, usually all of the capabilities related to the service won't be allowed.
        Returns:
        true if the service is currently available for use.
        See Also:
        MessagingServiceListener.onMessagingServiceAvailable(MessagingService)
      • getRoutableDomains

        java.util.List<java.lang.String> getRoutableDomains()
        Generic list of all routable domains presented as strings.

        This list helps to determine if a specific address can be used within the messaging component.

        Returns:
        list of all routable domains presented as string
        See Also:
        MessagingServiceListener.onRoutableDomainsChanged(MessagingService, List)
      • getSelfAddress

        java.lang.String getSelfAddress()
        String value containing address of currently logged in user. This value must be provided in the user configuration. Note that this address can be different than in other services.
        Returns:
        String value containing address of currently logged in user.
      • retrieveActiveConversations

        void retrieveActiveConversations​(DataRetrievalWatcher<Conversation> dataRetrievalWatcher)
        Performs a retrieval of all active conversations for the currently logged in user and watches for changes to this collection.

        This method retrieves the dynamically-updated collection of conversations that are associated with the currently logged in user. Normally the client application will only need to call this method once to install a watcher object to monitor the initial download of conversations and then continue to watch for updates to the collection.

        If the client application calls this method additional times, no actual download of conversations from the server occurs, but the watcher callbacks that report progress will fire (i.e. "progress" and "done" callbacks). However, no additions to the conversation collection will occur as a result of the subsequent calls. If a different watcher object is supplied in a subsequent call, the previous watcher object is "unlinked" from the underlying conversation object collection and will never receive any additional updates.

        To determine when it is appropriate to call the retrieveActiveConversations method, the client application should query the getRetrieveConversationCapability() method.

        Parameters:
        dataRetrievalWatcher - a DataRetrievalWatcher object, created by the application, to track the progress of the requested operation.
        See Also:
        getRetrieveConversationCapability(), getRetrieveOlderConversationCapability(), retrieveActiveConversationsForContact(DataRetrievalWatcher, Contact), refresh(MessagingCompletionHandler)
      • markMessagesAsRead

        void markMessagesAsRead​(java.util.List<Message> messages)
        Mark multiple messages as read.
        Parameters:
        messages - list of Messages to mark as read.
      • leaveConversations

        void leaveConversations​(DataRetrievalWatcher<LeaveConversationResponse> dataRetrievalWatcher,
                                java.util.List<Conversation> list)
        Leave a specified list of conversations.

        As conversations in the supplied list are processed, the onCollectionChanged callback on the supplied watcher object will fire with a list of conversations that have been left.

        Parameters:
        dataRetrievalWatcher - DataRetrievalWatcher object, created by the application, to track the progress of the requested operation.
        list - the list of conversations to leave.
        See Also:
        leaveAllConversations(DataRetrievalWatcher)
      • validateAddresses

        void validateAddresses​(DataRetrievalWatcher<AddressValidationResponse> dataRetrievalWatcher,
                               java.util.List<java.lang.String> addresses)
        Validates a list of supplied addresses to determine if they are valid messaging addresses.

        As the addresses are validated, the onCollectionChanged event on the supplied watcher object will fire with a list of addresses that have been validated.

        Parameters:
        dataRetrievalWatcher - DataRetrievalWatcher object, created by the application, to track the progress of the requested operation.
        addresses - list of addresses to validate.
      • validateAddresses

        void validateAddresses​(DataRetrievalWatcher<AddressValidationResponse> dataRetrievalWatcher,
                               Contact contact)
        Validates a supplied contact to determine if they are valid messaging addresses.

        As the addresses are validated, the onCollectionChanged event on the supplied watcher object will fire with a contact that have been validated.

        Parameters:
        dataRetrievalWatcher - DataRetrievalWatcher object, created by the application, to track the progress of the requested operation.
        contact - contact to validate.
      • searchConversations

        void searchConversations​(DataRetrievalWatcher<SearchConversation> dataRetrievalWatcher,
                                 MessagingQuery messagingQuery)
        Searches the user's conversations using specified filter criteria.
        Parameters:
        dataRetrievalWatcher - DataRetrievalWatcher object, created by the application, to track the progress of the requested operation.
        messagingQuery - MessagingQuery query object on which a search will be done.
      • setRefreshMode

        void setRefreshMode​(RefreshType refreshType,
                            MessagingCompletionHandler completionHandler)
        Sets refresh mode with completion handler. Using this method and changing refresh mode will impact how often client gets updates from the server.
        Parameters:
        refreshType - new refresh type value.
        completionHandler - MessagingCompletionHandler for this operation.
        See Also:
        RefreshType
      • getMessagingLimits

        MessagingLimits getMessagingLimits()
        Returns Messaging Limits, which are containing information about the limits of the messaging component.
        Returns:
        MessagingLimits object.
      • getCreateConversationCapability

        Capability getCreateConversationCapability()
        Returns a Capability object allowing the client application to determine if it is currently possible to create a new conversation.

        Typically this capability would only be disabled when the client is offline and cannot access the messaging server.

        Returns:
        a Capability object allowing the client application to determine if it is currently possible to create a new conversation.
        See Also:
        createConversation()
      • getMessageDeliveryReadStateMonitoringCapability

        Capability getMessageDeliveryReadStateMonitoringCapability()
        Returns a Capability object allowing the client application to determine if it is currently possible to report delivery state updates for sent messages.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server).
        • The messaging server supports send delivery receipts.
        Returns:
        a Capability object allowing the client application to determine if it is currently possible to report delivery state updates for sent messages.
      • getMessageReadReportingCapability

        Capability getMessageReadReportingCapability()
        Returns a Capability object allowing the client application to determine if it is currently possible to report read state updates for sent messages.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server).
        • The messaging server supports send read receipts.
        Returns:
        a Capability object allowing the client application to determine if it is currently possible to report read state updates for sent messages.
      • getSearchConversationCapability

        Capability getSearchConversationCapability()
        Returns a Capability object that indicates if conversations can be searched.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server).
        • The messaging server supports searching conversations.
        Returns:
        a Capability object that indicates if conversations can be searched.
        See Also:
        searchConversations(DataRetrievalWatcher, MessagingQuery)
      • getUpdateRefreshModeCapability

        Capability getUpdateRefreshModeCapability()
        Returns a Capability object that indicates if the refresh mode can be changed.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server).
        • The messaging server supports changing the refresh mode.
        Returns:
        a Capability object that indicates if the refresh mode can be changed.
        See Also:
        setRefreshMode(RefreshType, MessagingCompletionHandler)
      • getValidateParticipantAddressesCapability

        Capability getValidateParticipantAddressesCapability()
        Returns a Capability object that indicates if participant addresses can be validated.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server).
        • The messaging server supports validation of participant addresses.
        Returns:
        a Capability object that indicates if participant addresses can be validated.
        See Also:
        validateAddresses(DataRetrievalWatcher, List)
      • getRemoveConversationCapability

        Capability getRemoveConversationCapability​(Conversation conversation)
        Returns a Capability object that indicates if a specified conversation can be removed.

        This capability is Allowed when all of the following conditions are true:

        • The conversation argument is a valid Conversation object.
        • he Conversation is in a "draft" state.
        Parameters:
        conversation - a valid Conversation object @{link Conversation}.
        Returns:
        a Capability object that indicates if a specified conversation can be removed.
        See Also:
        removeConversation(Conversation, MessagingCompletionHandler)
      • getAutomaticallyUpdateLastAccessTimeCapability

        Capability getAutomaticallyUpdateLastAccessTimeCapability()
        Returns a Capability object that indicates if conversation last access timestamps will be updated automatically.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server).
        • The messaging server supports automatic update of conversation last access timestamps.
        Returns:
        a Capability object that indicates if conversation last access timestamps will be updated automatically.
        See Also:
        Conversation.getLastAccessedTime(), Conversation.setLastAccessTime(MessagingCompletionHandler)
      • getSelfAddress

        java.lang.String getSelfAddress​(MessagingProviderType messagingProviderType)
        String value containing address of currently logged in user. This value must be provided in the user configuration. Note that this address can be different than in other services.
        Parameters:
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        Returns:
        String value containing address of currently logged in user.
      • validateAddresses

        void validateAddresses​(DataRetrievalWatcher<AddressValidationResponse> dataRetrievalWatcher,
                               java.util.List<java.lang.String> addresses,
                               MessagingProviderType messagingProviderType)
        Validates a list of supplied addresses to determine if they are valid messaging addresses.

        As the addresses are validated, the onCollectionChanged event on the supplied watcher object will fire with a list of addresses that have been validated.

        Parameters:
        dataRetrievalWatcher - DataRetrievalWatcher object, created by the application, to track the progress of the requested operation.
        addresses - list of addresses to validate.
        messagingProviderType - type of the provider @{link MessagingProviderType}.
      • validateAddresses

        void validateAddresses​(DataRetrievalWatcher<AddressValidationResponse> dataRetrievalWatcher,
                               Contact contact,
                               MessagingProviderType messagingProviderType)
        Validates a supplied contact to determine if they are valid messaging addresses.

        As the addresses are validated, the onCollectionChanged event on the supplied watcher object will fire with a contact that have been validated.

        Parameters:
        dataRetrievalWatcher - DataRetrievalWatcher object, created by the application, to track the progress of the requested operation.
        contact - contact to validate.
        messagingProviderType - type of the provider @{link MessagingProviderType}.
      • getMessagingLimits

        MessagingLimits getMessagingLimits​(MessagingProviderType messagingProviderType)
        Returns Messaging Limits, which are containing information about the limits of the messaging component.
        Parameters:
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        Returns:
        MessagingLimits object.
      • getCreateConversationCapability

        Capability getCreateConversationCapability​(MessagingProviderType messagingProviderType)
        Returns a Capability object allowing the client application to determine if it is currently possible to create a new conversation.

        Typically this capability would only be disabled when the client is offline and cannot access the messaging server.

        Parameters:
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        Returns:
        a Capability object allowing the client application to determine if it is currently possible to create a new conversation.
        See Also:
        createConversation(MessagingProviderType)
      • getMessageDeliveryReadStateMonitoringCapability

        Capability getMessageDeliveryReadStateMonitoringCapability​(MessagingProviderType messagingProviderType)
        Returns a Capability object allowing the client application to determine if it is currently possible to report delivery state updates for sent messages for the specific messaging provider.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server) for the specific messaging provider.
        • The messaging server supports send delivery receipts for the specific messaging provider.
        Parameters:
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        Returns:
        a Capability object allowing the client application to determine if it is currently possible to report delivery state updates for sent messages.
      • getMessageReadReportingCapability

        Capability getMessageReadReportingCapability​(MessagingProviderType messagingProviderType)
        Returns a Capability object allowing the client application to determine if it is currently possible to report read state updates for sent messages for the specific messaging provider.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server) for the specific messaging provider.
        • The messaging server supports send read receipts for the specific messaging provider.
        Parameters:
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        Returns:
        a Capability object allowing the client application to determine if it is currently possible to report read state updates for sent messages.
      • getRetrieveOlderConversationCapability

        Capability getRetrieveOlderConversationCapability​(MessagingProviderType messagingProviderType)
        Returns a Capability object that indicates if older conversations can be retrieved from the server for the provider.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server).
        • The messaging server supports retrieving conversations.
        • The messaging server has older conversations available to download.

        The client application should call retrieveActiveConversations(DataRetrievalWatcher) to retrieve older conversations from the server.

        Parameters:
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        Returns:
        a Capability object that indicates if the older conversations can be retrieved from the server.
        See Also:
        retrieveActiveConversations(DataRetrievalWatcher)
      • getSearchConversationCapability

        Capability getSearchConversationCapability​(MessagingProviderType messagingProviderType)
        Returns a Capability object that indicates if conversations can be searched.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server).
        • The messaging server supports searching conversations.
        Parameters:
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        Returns:
        a Capability object that indicates if conversations can be searched.
        See Also:
        searchConversations(DataRetrievalWatcher, MessagingQuery)
      • getUpdateRefreshModeCapability

        Capability getUpdateRefreshModeCapability​(MessagingProviderType messagingProviderType)
        Returns a Capability object that indicates if the refresh mode can be changed.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server).
        • The messaging server supports changing the refresh mode.
        Parameters:
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        Returns:
        a Capability object that indicates if the refresh mode can be changed.
        See Also:
        setRefreshMode(RefreshType, MessagingCompletionHandler)
      • getValidateParticipantAddressesCapability

        Capability getValidateParticipantAddressesCapability​(MessagingProviderType messagingProviderType)
        Returns a Capability object that indicates if participant addresses can be validated.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server).
        • The messaging server supports validation of participant addresses.
        Parameters:
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        Returns:
        a Capability object that indicates if participant addresses can be validated.
        See Also:
        validateAddresses(DataRetrievalWatcher, List, MessagingProviderType)
      • getRemoveConversationCapability

        Capability getRemoveConversationCapability​(Conversation conversation,
                                                   MessagingProviderType messagingProviderType)
        Returns a Capability object that indicates if a specified conversation can be removed.

        This capability is Allowed when all of the following conditions are true:

        • The conversation argument is a valid Conversation object.
        • he Conversation is in a "draft" state.
        Parameters:
        conversation - a valid Conversation object @{link Conversation}.
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        Returns:
        a Capability object that indicates if a specified conversation can be removed.
        See Also:
        removeConversation(Conversation, MessagingCompletionHandler)
      • getAutomaticallyUpdateLastAccessTimeCapability

        Capability getAutomaticallyUpdateLastAccessTimeCapability​(MessagingProviderType messagingProviderType)
        Returns a Capability object that indicates if conversation last access timestamps will be updated automatically.

        This capability is Allowed when all of the following conditions are true:

        • The messaging service is online (has an active connection to the server).
        • The messaging server supports automatic update of conversation last access timestamps.
        Parameters:
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        Returns:
        a Capability object that indicates if conversation last access timestamps will be updated automatically.
        See Also:
        Conversation.getLastAccessedTime(), Conversation.setLastAccessTime(MessagingCompletionHandler)
      • getHtmlCapability

        Capability getHtmlCapability()
        Returns a Capability object allowing the client application to determine HTML capability.

        Typically this capability would only be enabled when messaging server supports HTML.

        If there is one messaging provider configured this selector will operate on the configured provider. Otherwise the MessagingProviderType.AVAYA_MULTIMEDIA_MESSAGING provider will be used.

        Returns:
        a Capability object that indicates if the client application can use HTML.
      • getHtmlCapability

        Capability getHtmlCapability​(MessagingProviderType messagingProviderType)
        Returns a Capability object allowing the client application to determine HTML capability for the specified provider.

        Typically this capability would only be enabled when messaging server supports HTML.

        Parameters:
        messagingProviderType - type of the provider MessagingProviderType.
        Returns:
        a Capability object that indicates if a specified provider is HTML capable.
        See Also:
        getHtmlCapability()
      • getConversationForProviderId

        void getConversationForProviderId​(MessagingProviderType messagingProviderType,
                                          java.lang.String providerConversationId,
                                          ConversationCompletionHandler completionHandler)
        Gets a Conversation associated with provider conversation ID.

        This method can be used to find a conversation object corresponding to push notification.

        Parameters:
        messagingProviderType - type of the provider @{link MessagingProviderType}.
        providerConversationId - provider level conversation ID.
        completionHandler - ConversationCompletionHandler for this operation.
      • isMessageReadReportingSupported

        boolean isMessageReadReportingSupported()
        Does the last connected messaging service support reporting the message read status?
        Returns:
        true if the last connected service supported message read reporting.
      • isMessageDeliveryReadStateMonitoringSupported

        boolean isMessageDeliveryReadStateMonitoringSupported()
        Does the last connected messaging service support reporting the message delivery status?
        Returns:
        true if the last connected service supported message delivery read state monitoring.