Class: Messaging

Constructor

new Messaging(messagingService)

Messaging module provides Instant Messaging functionality of the SDK.
For Messaging module namespace, see AvayaClientServices.Services.Messaging.

Parameters:
Name Type Description
messagingService AvayaClientServices.Services.Messaging.MessagingService

Methods

createConversation() → {AvayaClientServices.Services.Messaging.Conversation}

Creates new conversation.

See:
Returns:

getActiveConversations() → {AvayaClientServices.Base.DataRetrieval.<AvayaClientServices.Services.Messaging.Conversation>}

Returns list of conversations that user is currently in.

See:
Returns:
{ AvayaClientServices.Base.DataRetrieval.<AvayaClientServices.Services.Messaging.Conversation> }

DataRetrieval of AvayaClientServices.Services.Messaging.Conversation objects

getAllActiveConversationsForContact(contact) → {AvayaClientServices.Base.DataRetrieval.<AvayaClientServices.Services.Messaging.Conversation>}

Returns all conversations that given contact is a participant of.

Parameters:
Name Type Description
contact AvayaClientServices.Contact.Contact
See:
Returns:
{ AvayaClientServices.Base.DataRetrieval.<AvayaClientServices.Services.Messaging.Conversation> }

DataRetrieval of AvayaClientServices.Services.Messaging.Conversation objects

getDraftConversations() → {Array.<AvayaClientServices.Services.Messaging.Conversation>}

Returns list of draft conversations. We consider a conversation draft, when it exists only locally.

See:
Returns:
{ Array.<AvayaClientServices.Services.Messaging.Conversation> }

Array of AvayaClientServices.Services.Messaging.Conversation objects

getNumberOfConversationsWithUnreadContent() → {Number}

Returns number of conversations with unread content.

See:
Returns:
{ Number }

Number of conversations with unread content.

getNumberOfConversationsWithUnreadContentSinceLastAccess() → {Number}

Returns number of Conversations with unread content since last access.

See:
Returns:
{ Number }

Number of conversations with unread content since last access.

getRoutableDomains() → {Array.<String>}

Returns routable domains obtained from resource discovery.
List of routable domains consists of all domains that are allowed to take part in Conversation.

Returns:
{ Array.<String> }

List of routable domains

getSelfAddress() → {String}

Returns address of Participant that user is currently logged in as.

Returns:
{ String }

Self address

leaveAllConversations() → {AvayaClientServices.Base.Promise.<(Boolean|AvayaClientServices.Services.Messaging.MessagingError)>}

Leaves all conversations that user is a member of.

See:
Returns:

leaveConversations(conversations) → {AvayaClientServices.Base.Promise.<(Boolean|AvayaClientServices.Services.Messaging.MessagingError)>}

Leaves the conversations specified in conversations array.

Parameters:
Name Type Description
conversations Array.<AvayaClientServices.Services.Messaging.Conversation>

Array of conversations to leave

See:
Returns:

removeConversation(conversation) → {AvayaClientServices.Base.Promise.<(undefined|AvayaClientServices.Base.BaseError)>}

Removes received conversation.

Parameters:
Name Type Description
conversation AvayaClientServices.Services.Messaging.Conversation

Conversation to be removed.

See:
Returns:

searchConversations(messagingQuery) → {AvayaClientServices.Base.DataRetrieval.<AvayaClientServices.Services.Messaging.Conversation>}

Searches for conversations and returns only ones that match the conditions described in messagingQuery.

Parameters:
Name Type Description
messagingQuery AvayaClientServices.Services.Messaging.MessagingQuery

A MessagingQuery object

Returns:
{ AvayaClientServices.Base.DataRetrieval.<AvayaClientServices.Services.Messaging.Conversation> }

DataRetrieval of AvayaClientServices.Services.Messaging.Conversation objects

start(userConfiguration) → {AvayaClientServices.Base.Promise.<(undefined|undefined)>}

Starts the Messaging service.

Parameters:
Name Type Description
userConfiguration AvayaClientServices.Config.UserConfiguration
See:
Returns:
{ AvayaClientServices.Base.Promise.<(undefined|undefined)> }

stop() → {AvayaClientServices.Base.Promise.<(undefined|AvayaClientServices.Services.Messaging.MessagingError)>}

Stops the Messaging service.

See:
Returns:

validateAddresses(addressesToValidate) → {AvayaClientServices.Base.Promise.<(Array|AvayaClientServices.Services.Messaging.MessagingError)>}

Validates addresses of users.

Parameters:
Name Type Description
addressesToValidate Array.<String>

Array of addresses to be validated

Returns:

Managing callbacks

addOnMessagingLimitsChangedCallback(callback) → {void}

Adds a new onMessagingLimitsChangedCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onMessagingLimitsChangedCallback
Returns:
{ void }

addOnMessagingServiceAvailableCallback(callback) → {void}

Adds new onMessagingServiceAvailableCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onMessagingServiceAvailableCallback
Returns:
{ void }

addOnMessagingServiceUnavailableCallback(callback) → {void}

Adds new onMessagingServiceUnavailableCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onMessagingServiceUnavailableCallback
Returns:
{ void }

addOnNumberOfConversationsWithUnreadContentChangedCallback(callback) → {void}

Adds new onNumberOfConversationsWithUnreadContentChangedCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onNumberOfConversationsWithUnreadContentChangedCallback
Returns:
{ void }

addOnNumberOfConversationsWithUnreadContentSinceLastAccessChangedCallback(callback) → {void}

Adds new onNumberOfConversationsWithUnreadContentSinceLastAccessChangedCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onNumberOfConversationsWithUnreadContentSinceLastAccessChangedCallback
Returns:
{ void }

addOnRoutableDomainsChangedCallback(callback) → {void}

Adds new onRoutableDomainsChangedCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onRoutableDomainsChangedCallback
Returns:
{ void }

removeOnMessagingLimitsChangedCallback(callback) → {void}

Removes existing onMessagingLimitsChangedCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onMessagingLimitsChangedCallback
Returns:
{ void }

removeOnMessagingServiceAvailableCallback(callback) → {void}

Removes existing onMessagingServiceAvailableCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onMessagingServiceAvailableCallback
Returns:
{ void }

removeOnMessagingServiceUnavailableCallback(callback) → {void}

Removes existing onMessagingServiceUnavailableCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onMessagingServiceUnavailableCallback
Returns:
{ void }

removeOnNumberOfConversationsWithUnreadContentChangedCallback(callback) → {void}

Removes existing onNumberOfConversationsWithUnreadContentChangedCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onNumberOfConversationsWithUnreadContentChangedCallback
Returns:
{ void }

removeOnNumberOfConversationsWithUnreadContentSinceLastAccessChangedCallback(callback) → {void}

Removes existing onNumberOfConversationsWithUnreadContentSinceLastAccessChangedCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onNumberOfConversationsWithUnreadContentSinceLastAccessChangedCallback
Returns:
{ void }

removeOnRoutableDomainsChangedCallback(callback) → {void}

Removes existing onRoutableDomainsChangedCallback.

Parameters:
Name Type Description
callback AvayaClientServices.Services.Messaging.Messaging#onRoutableDomainsChangedCallback
Returns:
{ void }

Capabilities

getCreateConversationCapability() → {AvayaClientServices.Base.Capability}

Returns Capability object that indicates if conversation can be created.

     if (service is available and an endpoint for conversations exists)
         allow
     else
         deny
Returns:

getMarkContentAsReadCapability() → {AvayaClientServices.Base.Capability}

Returns Capability object that indicates if content can be marked as read.

     if (service is available and an endpoint for marking messages as read exists)
         allow
     else
         deny
Returns:

getRetrieveConversationsCapability() → {AvayaClientServices.Base.Capability}

Returns Capability object that indicates if a list of conversations can be retrieved.

     if (service is available and an endpoint for conversations exists)
         allow
     else
         deny
Returns:

getSearchConversationsCapability() → {AvayaClientServices.Base.Capability}

Returns Capability object that indicates if search conversations can be performed.

     if (service is available and an endpoint for conversations exists)
         allow
     else
         deny
Returns:

getStartServiceCapability() → {AvayaClientServices.Base.Capability}

Returns Capability object that indicates if messaging service can be started.

     if (service has already started)
         deny
     else
         allow
Returns:

getValidateParticipantAddressesCapability() → {AvayaClientServices.Base.Capability}

Returns Capability object that indicates if participant can be validated by addresses.

     if (service is available and endpoint for address validation exists)
         allow
     else
         deny
Returns:

Type Definitions

onMessagingLimitsChangedCallback(messaging, limits) → {void}

Interface for callback function to be invoked when messaging limits has changed.

Parameters:
Name Type Description
messaging AvayaClientServices.Services.Messaging.Messaging

Instance of messaging module.

limits Object

New limits object.

Returns:
{ void }

onMessagingServiceAvailableCallback(messaging) → {void}

Interface for callback function to be invoked when messaging service becomes available.

Parameters:
Name Type Description
messaging AvayaClientServices.Services.Messaging.Messaging

Instance of messaging module.

Returns:
{ void }

onMessagingServiceUnavailableCallback(messaging) → {void}

Interface for callback function to be invoked when messaging service becomes unavailable.

Parameters:
Name Type Description
messaging AvayaClientServices.Services.Messaging.Messaging

Instance of messaging module.

Returns:
{ void }

onNumberOfConversationsWithUnreadContentChangedCallback(messaging, numberOfConversationWithUnreadContent) → {void}

Interface for callback function to be invoked when number of conversation with unread content has changed.

Parameters:
Name Type Description
messaging AvayaClientServices.Services.Messaging.Messaging

Instance of messaging module.

numberOfConversationWithUnreadContent Number

New number of conversations with unread content.

Returns:
{ void }

onNumberOfConversationsWithUnreadContentSinceLastAccessChangedCallback(messaging, numberOfConversationWithUnviewedContentSinceLastAccess) → {void}

Interface for callback function to be invoked when number of conversations with unviewed content since last access has changed.

Parameters:
Name Type Description
messaging AvayaClientServices.Services.Messaging.Messaging

Instance of messaging module.

numberOfConversationWithUnviewedContentSinceLastAccess Number

New number of conversations with unviewed content since last access.

Returns:
{ void }

onRoutableDomainsChangedCallback(messaging, routableDomains) → {void}

Interface for callback function to be invoked when routable domains has changed.

Parameters:
Name Type Description
messaging AvayaClientServices.Services.Messaging.Messaging

Instance of messaging module.

routableDomains Array.<String>

New array of routable domains.

Returns:
{ void }
©2016 Avaya Inc. All Rights Reserved.