Package com.avaya.clientservices.messaging

## Interface MessagingServiceListener

-     public interface MessagingServiceListener

  Interface that can be used to retrieve status updates from the `MessagingService`. One or more listeners can be registered with `MessagingService` to retrieve status updates.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `onMessagingLimitsChanged​(MessagingService messagingService, MessagingLimits messagingLimits)` | Called to report that the messaging limits have changed.
    `void` | `onMessagingProviderAvailable​(MessagingService messagingService, MessagingProviderType messagingProviderType)` | Report that the messaging provider has successfully started or restored.
    `void` | `onMessagingProviderCapabilitiesChanged​(MessagingService messagingService, MessagingProviderType messagingProviderType)` | Report that messaging provider capabilities have changed.
    `void` | `onMessagingProviderFailed​(MessagingService messagingService, MessagingError error, MessagingProviderType messagingProviderType)` | Called to report that messaging provider has failed.
    `void` | `onMessagingProviderLimitsChanged​(MessagingService messagingService, MessagingLimits messagingLimits, MessagingProviderType messagingProviderType)` | Called to report that the messaging provider limits have changed.
    `void` | `onMessagingProviderNumberOfConversationsWithUnreadContentChanged​(MessagingService messagingService, int numberOfConversationsWithUnreadContent, MessagingProviderType messagingProviderType)` | Called to report that a NumberOfConversationsWithUnreadContent on provider has changed.
    `void` | `onMessagingProviderNumberOfConversationsWithUnreadContentSinceLastAccessChanged​(MessagingService messagingService, int numberOfConversationsWithUnreadContentSinceLastAccess, MessagingProviderType messagingProviderType)` | Called to report that the NumberOfConversationsWithUnreadContentSinceLastAccess on provider has changed.
    `void` | `onMessagingProviderRoutableDomainsChanged​(MessagingService messagingService, java.util.List<java.lang.String> supportedDomains, MessagingProviderType messagingProviderType)` | Called to report that messaging provider routable domains have changed.
    `void` | `onMessagingProviderUnavailable​(MessagingService messagingService, MessagingProviderType messagingProviderType)` | Report that the messaging provider has been successfully closed or its work was interrupted, for example by a network or server problem.
    `void` | `onMessagingPushNotificationActivated​(MessagingService messagingService, MessagingProviderType messagingProviderType)` | Called to report that AMM Push Notification is activated successfully
    `void` | `onMessagingPushNotificationActivationFailed​(MessagingService messagingService, PushNotificationProcessingError error, boolean willRetry, MessagingProviderType messagingProviderType)` | Called to report that AMM Push Notification activation failed
    `void` | `onMessagingPushNotificationDeactivated​(MessagingService messagingService, MessagingProviderType messagingProviderType)` | Called to report that AMM Push Notification is deactivated successfully
    `void` | `onMessagingPushNotificationDeactivationFailed​(MessagingService messagingService, PushNotificationProcessingError error, boolean willRetry, MessagingProviderType messagingProviderType)` | Called to report that AMM Push Notification deactivation failed
    `void` | `onMessagingPushNotificationEncryptionInfoReceived​(MessagingService messagingService, PushNotificationEncryptionInfo encryptionInfo, MessagingProviderType messagingProviderType)` | Called to provide the Encryption info to UI layer for decrypting the future Push notification's payload
    `void` | `onMessagingServiceAvailable​(MessagingService messagingService)` | Report that the messaging service has successfully started or restored.
    `void` | `onMessagingServiceCapabilitiesChanged​(MessagingService messagingService)` | Report that messaging service capabilities have changed.
    `void` | `onMessagingServiceFailed​(MessagingService messagingService, MessagingException error)` | Called to report that messaging has failed.
    `void` | `onMessagingServiceMatchedContactsChanged​(MessagingService messagingService)` | Deprecated. THIS METHOD WILL BE REMOVED IN RELEASE VERSION 3.3.
    `void` | `onMessagingServiceUnavailable​(MessagingService messagingService)` | Report that the messaging service has been successfully closed or its work was interrupted, for example by a network or server problem.
    `void` | `onNumberOfConversationsWithUnreadContentChanged​(MessagingService messagingService, int numberOfConversationsWithUnreadContent)` | Called to report that a NumberOfConversationsWithUnreadContent has changed.
    `void` | `onNumberOfConversationsWithUnreadContentSinceLastAccessChanged​(MessagingService messagingService, int numberOfConversationsWithUnreadContentSinceLastAccess)` | Called to report that the NumberOfConversationsWithUnreadContentSinceLastAccess has changed.
    `void` | `onRoutableDomainsChanged​(MessagingService messagingService, java.util.List<java.lang.String> supportedDomains)` | Called to report that messaging routable domains have changed.

- - ### Method Detail

    - #### onMessagingServiceAvailable

          void onMessagingServiceAvailable​(MessagingService messagingService)

      Report that the messaging service has successfully started or restored.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
      See Also:
        `onMessagingServiceUnavailable(MessagingService)`, `MessagingService.isServiceAvailable()`

    - #### onMessagingServiceUnavailable

          void onMessagingServiceUnavailable​(MessagingService messagingService)

      Report that the messaging service has been successfully closed or its work was interrupted, for example by a network or server problem.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
      See Also:
        `onMessagingServiceAvailable(MessagingService)`, `MessagingService.isServiceAvailable()`

    - #### onMessagingServiceCapabilitiesChanged

          void onMessagingServiceCapabilitiesChanged​(MessagingService messagingService)

      Report that messaging service capabilities have changed.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
      See Also:
        `MessagingService.getCreateConversationCapability()`, `MessagingService.getMessageDeliveryReadStateMonitoringCapability()`, `MessagingService.getMessageReadReportingCapability()`, `MessagingService.getRetrieveConversationCapability()`, `MessagingService.getSearchConversationCapability()`, `MessagingService.getUpdateRefreshModeCapability()`, `MessagingService.getValidateParticipantAddressesCapability()`, `MessagingService.getClearLocalDataCapability()`, `MessagingService.getAutomaticallyUpdateLastAccessTimeCapability()`, `MessagingService.getRemoveConversationCapability(Conversation)`

    - #### onMessagingLimitsChanged

          void onMessagingLimitsChanged​(MessagingService messagingService,
                                        MessagingLimits messagingLimits)

      Called to report that the messaging limits have changed.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `messagingLimits` - `MessagingLimits` the messaging limits object.
      See Also:
        `MessagingService.getMessagingLimits()`

    - #### onRoutableDomainsChanged

          void onRoutableDomainsChanged​(MessagingService messagingService,
                                        java.util.List<java.lang.String> supportedDomains)

      Called to report that messaging routable domains have changed.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `supportedDomains` - list of routable domains.
      See Also:
        `MessagingService.getRoutableDomains()`

    - #### onNumberOfConversationsWithUnreadContentChanged

          void onNumberOfConversationsWithUnreadContentChanged​(MessagingService messagingService,
                                                               int numberOfConversationsWithUnreadContent)

      Called to report that a NumberOfConversationsWithUnreadContent has changed.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `numberOfConversationsWithUnreadContent` - the number of conversations with unread content.
      See Also:
        `MessagingService.getNumberOfConversationsWithUnreadContent()`

    - #### onNumberOfConversationsWithUnreadContentSinceLastAccessChanged

          void onNumberOfConversationsWithUnreadContentSinceLastAccessChanged​(MessagingService messagingService,
                                                                              int numberOfConversationsWithUnreadContentSinceLastAccess)

      Called to report that the NumberOfConversationsWithUnreadContentSinceLastAccess has changed.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `numberOfConversationsWithUnreadContentSinceLastAccess` - the number representing the number of conversations with unread content since the last time the user accessed them.
      See Also:
        `MessagingService.getNumberOfConversationsWithUnreadContentSinceLastAccessChanged()`

    - #### onMessagingServiceMatchedContactsChanged

          void onMessagingServiceMatchedContactsChanged​(MessagingService messagingService)

      Deprecated.
      THIS METHOD WILL BE REMOVED IN RELEASE VERSION 3.3.
      Called to report the messaging participant matched contacts changed. This could be a result of change on contact list (i.e. a new contact was added which was present in an existing conversation). The matched contact can be used for an additional operation, which is not available on the messaging participant - for example making a call, etc.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.

    - #### onMessagingServiceFailed

          void onMessagingServiceFailed​(MessagingService messagingService,
                                        MessagingException error)

      Called to report that messaging has failed. When messaging recovers from error state, `onMessagingServiceAvailable(MessagingService)` will be called.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `error` - Information about failure details.

    - #### onMessagingProviderAvailable

          void onMessagingProviderAvailable​(MessagingService messagingService,
                                            MessagingProviderType messagingProviderType)

      Report that the messaging provider has successfully started or restored.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `messagingProviderType` - provider type.
      See Also:
        `onMessagingServiceUnavailable(MessagingService)`, `MessagingService.isServiceAvailable()`

    - #### onMessagingProviderUnavailable

          void onMessagingProviderUnavailable​(MessagingService messagingService,
                                              MessagingProviderType messagingProviderType)

      Report that the messaging provider has been successfully closed or its work was interrupted, for example by a network or server problem.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `messagingProviderType` - provider type.
      See Also:
        `onMessagingServiceAvailable(MessagingService)`, `MessagingService.isServiceAvailable()`

    - #### onMessagingProviderCapabilitiesChanged

          void onMessagingProviderCapabilitiesChanged​(MessagingService messagingService,
                                                      MessagingProviderType messagingProviderType)

      Report that messaging provider capabilities have changed.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `messagingProviderType` - provider type.
      See Also:
        `MessagingService.getCreateConversationCapability(MessagingProviderType)`, `MessagingService.getMessageDeliveryReadStateMonitoringCapability(MessagingProviderType)`, `MessagingService.getMessageReadReportingCapability(MessagingProviderType)`, `MessagingService.getRetrieveConversationCapability(MessagingProviderType)`, `MessagingService.getSearchConversationCapability(MessagingProviderType)`, `MessagingService.getUpdateRefreshModeCapability(MessagingProviderType)`, `MessagingService.getValidateParticipantAddressesCapability(MessagingProviderType)`, `MessagingService.getClearLocalDataCapability(MessagingProviderType)`, `MessagingService.getAutomaticallyUpdateLastAccessTimeCapability(MessagingProviderType)`, `MessagingService.getRemoveConversationCapability(Conversation, MessagingProviderType)`

    - #### onMessagingProviderLimitsChanged

          void onMessagingProviderLimitsChanged​(MessagingService messagingService,
                                                MessagingLimits messagingLimits,
                                                MessagingProviderType messagingProviderType)

      Called to report that the messaging provider limits have changed.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `messagingLimits` - `MessagingLimits` the messaging limits object.
        `messagingProviderType` - provider type.
      See Also:
        `MessagingService.getMessagingLimits()`

    - #### onMessagingProviderRoutableDomainsChanged

          void onMessagingProviderRoutableDomainsChanged​(MessagingService messagingService,
                                                         java.util.List<java.lang.String> supportedDomains,
                                                         MessagingProviderType messagingProviderType)

      Called to report that messaging provider routable domains have changed.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `supportedDomains` - list of routable domains.
        `messagingProviderType` - provider type.
      See Also:
        `MessagingService.getRoutableDomains()`

    - #### onMessagingProviderNumberOfConversationsWithUnreadContentChanged

          void onMessagingProviderNumberOfConversationsWithUnreadContentChanged​(MessagingService messagingService,
                                                                                int numberOfConversationsWithUnreadContent,
                                                                                MessagingProviderType messagingProviderType)

      Called to report that a NumberOfConversationsWithUnreadContent on provider has changed.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `numberOfConversationsWithUnreadContent` - the number of conversations with unread content.
        `messagingProviderType` - provider type.
      See Also:
        `MessagingService.getNumberOfConversationsWithUnreadContent()`

    - #### onMessagingProviderNumberOfConversationsWithUnreadContentSinceLastAccessChanged

          void onMessagingProviderNumberOfConversationsWithUnreadContentSinceLastAccessChanged​(MessagingService messagingService,
                                                                                               int numberOfConversationsWithUnreadContentSinceLastAccess,
                                                                                               MessagingProviderType messagingProviderType)

      Called to report that the NumberOfConversationsWithUnreadContentSinceLastAccess on provider has changed.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `numberOfConversationsWithUnreadContentSinceLastAccess` - the number representing the
        `messagingProviderType` - provider type. number of conversations with unread content since the last time the user accessed them.
      See Also:
        `MessagingService.getNumberOfConversationsWithUnreadContentSinceLastAccessChanged()`

    - #### onMessagingProviderFailed

          void onMessagingProviderFailed​(MessagingService messagingService,
                                         MessagingError error,
                                         MessagingProviderType messagingProviderType)

      Called to report that messaging provider has failed. When messaging recovers from error state, `onMessagingProviderAvailable(MessagingService, MessagingProviderType)` will be called.
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `error` - Information about failure details.
        `messagingProviderType` - provider type.

    - #### onMessagingPushNotificationActivated

          void onMessagingPushNotificationActivated​(MessagingService messagingService,
                                                    MessagingProviderType messagingProviderType)

      Called to report that AMM Push Notification is activated successfully
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `messagingProviderType` - provider type.

    - #### onMessagingPushNotificationActivationFailed

          void onMessagingPushNotificationActivationFailed​(MessagingService messagingService,
                                                           PushNotificationProcessingError error,
                                                           boolean willRetry,
                                                           MessagingProviderType messagingProviderType)

      Called to report that AMM Push Notification activation failed
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `error` - Error object describing the reason for the failure.
        `willRetry` - Boolean indicating whether service activation is automatically reattempted by the ClientSDK. Currently, service deactivation is not reattempted by the ClientSDK.
        `messagingProviderType` - provider type.

    - #### onMessagingPushNotificationDeactivated

          void onMessagingPushNotificationDeactivated​(MessagingService messagingService,
                                                      MessagingProviderType messagingProviderType)

      Called to report that AMM Push Notification is deactivated successfully
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `messagingProviderType` - provider type.

    - #### onMessagingPushNotificationDeactivationFailed

          void onMessagingPushNotificationDeactivationFailed​(MessagingService messagingService,
                                                             PushNotificationProcessingError error,
                                                             boolean willRetry,
                                                             MessagingProviderType messagingProviderType)

      Called to report that AMM Push Notification deactivation failed
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `error` - Error object describing the reason for the failure.
        `willRetry` - Boolean indicating whether service deactivation is automatically reattempted by the ClientSDK. Currently, service deactivation is not reattempted by the ClientSDK.
        `messagingProviderType` - provider type.

    - #### onMessagingPushNotificationEncryptionInfoReceived

          void onMessagingPushNotificationEncryptionInfoReceived​(MessagingService messagingService,
                                                                 PushNotificationEncryptionInfo encryptionInfo,
                                                                 MessagingProviderType messagingProviderType)

      Called to provide the Encryption info to UI layer for decrypting the future Push notification's payload
      Parameters:
        `messagingService` - the `MessagingService` object that the callback is associated with.
        `encryptionInfo` - the `PushNotificationEncryptionInfo` object describing the encryption info.
        `messagingProviderType` - provider type.