public interface OobMessageManager
Modifier and Type | Method and Description |
---|---|
OobResponse |
acknowledgeMessage(OobIncomingMessage message)
Sends a message acknowledgment to the server: the synchronous variant.
|
void |
acknowledgeMessage(OobIncomingMessage message,
OobAcknowledgeCallback callback)
Sends a message acknowledgment to the server: the asynchronous variant.
|
void |
acknowledgeMessage(OobIncomingMessage message,
OobAcknowledgeCallback callback,
OobRequestParameter oobRequestParameter)
Sends a message acknowledgment to the server: the asynchronous variant.
|
OobResponse |
acknowledgeMessage(OobIncomingMessage message,
OobRequestParameter oobRequestParameter)
Sends a message acknowledgment to the server: the synchronous variant.
|
OobGenericOutgoingMessage |
createGenericOutgoingMessage(String contentType,
SecureByteArray content)
Creates a generic message.
|
OobErrorMessage |
createOobError(int errorCode,
String errorDescription,
Exception exception,
String externalRef,
Map<String,String> meta)
Creates an error message.
|
OobErrorMessage |
createOobError(int errorCode,
String errorDescription,
String errorStackTrace,
String externalRef,
Map<String,String> meta)
Creates an error message.
|
OobUserMessageAttachment |
createUserMessageAttachment(SecureString subject,
String contentType,
SecureByteArray content,
Map<String,String> meta)
Creates a user message attachment.
|
OobUserToProviderMessage |
createUserToProviderMessage(String locale,
Date createTime,
SecureString subject,
String from,
String to,
String replyTo,
String threadId,
String contentType,
SecureByteArray content,
OobUserMessageAttachment[] attachments,
Map<String,String> meta)
Creates an user message.
|
OobFetchMessageResponse |
fetchMessage(int timeout)
Fetches a message from the server: the synchronous variant.
|
void |
fetchMessage(int timeout,
OobFetchMessageCallback callback)
Fetches a message from the server: the asynchronous variant.
|
void |
fetchMessage(int timeout,
OobFetchMessageCallback callback,
OobRequestParameter oobRequestParameter)
Fetches a message from the server: the asynchronous variant.
|
OobFetchMessageResponse |
fetchMessage(int timeout,
OobRequestParameter requestParameter)
Fetches a message from the server: the synchronous variant.
|
OobFetchMessageResponse |
fetchMessage(String messageId)
Fetches a message from the server: the synchronous variant.
|
void |
fetchMessage(String messageId,
OobFetchMessageCallback callback)
Fetches a message from the server: the asynchronous variant.
|
void |
fetchMessage(String messageId,
OobFetchMessageCallback callback,
OobRequestParameter oobRequestParameter)
Fetches a message from the server: the asynchronous variant.
|
OobFetchMessageResponse |
fetchMessage(String messageId,
OobRequestParameter requestParameter)
Fetches a message from the server: the synchronous variant.
|
OobMessageResponse |
sendMessage(OobOutgoingMessage message)
Sends a message to the server: the synchronous variant.
|
OobMessageResponse |
sendMessage(OobOutgoingMessage message,
OobRequestParameter oobRequestParameter)
Sends a message to the server: the synchronous variant.
|
void |
sendMessage(OobOutgoingMessage message,
OobSendMessageCallback callback)
Sends a message to the server: the asynchronous variant.
|
void |
sendMessage(OobOutgoingMessage message,
OobSendMessageCallback callback,
OobRequestParameter oobRequestParameter)
Sends a message to the server: the asynchronous variant.
|
OobUserToProviderMessage createUserToProviderMessage(String locale, Date createTime, SecureString subject, String from, String to, String replyTo, String threadId, String contentType, SecureByteArray content, OobUserMessageAttachment[] attachments, Map<String,String> meta)
locale
- Locale to use to handle messages.createTime
- Message creation time. The value cannot be null.subject
- Message subject.from
- Message originator. Can be null
.to
- Message recipient.replyTo
- Message recipient to use in case a response is send by the server. Can be null
threadId
- Message thread identifier.contentType
- Message content-type.content
- Message content.attachments
- Array of attachments to the message. Can be null
.meta
- Meta data for the message. Can be null
.OobUserMessageAttachment createUserMessageAttachment(SecureString subject, String contentType, SecureByteArray content, Map<String,String> meta)
subject
- Message subject.contentType
- Message content-type.content
- Message content.meta
- Meta data for the message. Can be null
.OobGenericOutgoingMessage createGenericOutgoingMessage(String contentType, SecureByteArray content)
contentType
- Message content-type.content
- Message content.OobErrorMessage createOobError(int errorCode, String errorDescription, String errorStackTrace, String externalRef, Map<String,String> meta)
errorCode
- Error code.errorDescription
- Error description.errorStackTrace
- Error stack trace. Can be null
.externalRef
- Any external reference. Can be null
.meta
- Meta data for the message. Can be null
.OobErrorMessage createOobError(int errorCode, String errorDescription, Exception exception, String externalRef, Map<String,String> meta)
errorCode
- Error code.errorDescription
- Error description.exception
- Exception to be sent. Can be null
.externalRef
- Any external reference. Can be null
.meta
- Meta data for the message. Can be null
.OobFetchMessageResponse fetchMessage(int timeout)
This method fetches the first message from server queue.
NetworkOnMainThreadException
- as
it is very bad habit to obstacle the main UI thread with the blocking calls (the same is done for instance by the
Android HTTP library).timeout
- Maximum time in second to wait for an incoming message.OobFetchMessageResponse fetchMessage(int timeout, OobRequestParameter requestParameter)
This method fetches the first message from server queue.
NetworkOnMainThreadException
- as
it is very bad habit to obstacle the main UI thread with the blocking calls (the same is done for instance by the
Android HTTP library).timeout
- Maximum time in second to wait for an incoming message.requestParameter
- The request object containing custom headers.OobFetchMessageResponse fetchMessage(String messageId)
This method fetches a message with a specific identifier.
NetworkOnMainThreadException
- as
it is very bad habit to obstacle the main UI thread with the blocking calls (the same is done for instance by the
Android HTTP library).messageId
- Identifier of the message to fetch.OobFetchMessageResponse fetchMessage(String messageId, OobRequestParameter requestParameter)
This method fetches a message with a specific identifier.
NetworkOnMainThreadException
- as
it is very bad habit to obstacle the main UI thread with the blocking calls (the same is done for instance by the
Android HTTP library).messageId
- Identifier of the message to fetch.requestParameter
- The request object containing custom headers.IllegalArgumentException
- When the collection of headers passed in is null, or adding a header prohibited in the headers
customization or containing illegal characters.OobMessageResponse sendMessage(OobOutgoingMessage message)
NetworkOnMainThreadException
- as
it is very bad habit to obstacle the main UI thread with the blocking calls (the same is done for instance by the
Android HTTP library).message
- The object that will be use to post the result to the UI thread.OobMessageResponse sendMessage(OobOutgoingMessage message, OobRequestParameter oobRequestParameter)
NetworkOnMainThreadException
- as
it is very bad habit to obstacle the main UI thread with the blocking calls (the same is done for instance by the
Android HTTP library).message
- The object that will be use to post the result to the UI thread.oobRequestParameter
- The request object containing custom header.IllegalArgumentException
- When the collection of headers passed in is null, or adding a header prohibited in the headers
customization or containing illegal characters.OobResponse acknowledgeMessage(OobIncomingMessage message)
NetworkOnMainThreadException
- as
it is very bad habit to obstacle the main UI thread with the blocking calls (the same is done for instance by the
Android HTTP library).message
- The incoming message to acknowledge.OobResponse acknowledgeMessage(OobIncomingMessage message, OobRequestParameter oobRequestParameter)
NetworkOnMainThreadException
- as
it is very bad habit to obstacle the main UI thread with the blocking calls (the same is done for instance by the
Android HTTP library).message
- The incoming message to acknowledge.oobRequestParameter
- The request object carrying custom header.IllegalArgumentException
- When the collection of headers passed in is null, or adding a header prohibited in the headers
customization or containing illegal characters.void fetchMessage(int timeout, OobFetchMessageCallback callback)
This method fetches the first message from server queue.
This method is executed asynchronously and the result will be posted in the provided callback interface. The callback will be done in the UI thread.
timeout
- Maximum time in second to wait for an incoming message.callback
- The object that will be use to post the result to the UI thread.void fetchMessage(int timeout, OobFetchMessageCallback callback, OobRequestParameter oobRequestParameter)
This method fetches the first message from server queue.
This method is executed asynchronously and the result will be posted in the provided callback interface. The callback will be done in the UI thread.
timeout
- Maximum time in second to wait for an incoming message.callback
- The object that will be use to post the result to the UI thread.oobRequestParameter
- The request parameter containing custom header.IllegalArgumentException
- When the collection of headers passed in is null, or adding a header prohibited in the headers
customization or containing illegal characters.void fetchMessage(String messageId, OobFetchMessageCallback callback)
This method fetches a message with a specific identifier.
This method is executed asynchronously and the result will be posted in the provided callback interface. The callback will be done in the UI thread.
messageId
- Identifier of the message to fetch.callback
- The object that will be use to post the result to the UI thread.void fetchMessage(String messageId, OobFetchMessageCallback callback, OobRequestParameter oobRequestParameter)
This method fetches the first message from server queue.
This method is executed asynchronously and the result will be posted in the provided callback interface. The callback will be done in the UI thread.
messageId
- Identifier of the message to fetch.callback
- The object that will be use to post the result to the UI thread.oobRequestParameter
- The request parameter containing custom header.IllegalArgumentException
- When the collection of headers passed in is null, or adding a header prohibited in the headers
customization or containing illegal characters.void sendMessage(OobOutgoingMessage message, OobSendMessageCallback callback)
This method is executed asynchronously and the result will be posted in the provided callback interface. The callback will be done in the UI thread.
message
- The message to send.callback
- The object that will be use to post the result to the UI thread.void sendMessage(OobOutgoingMessage message, OobSendMessageCallback callback, OobRequestParameter oobRequestParameter)
This method is executed asynchronously and the result will be posted in the provided callback interface. The callback will be done in the UI thread.
message
- The message to send.callback
- oobRequestParameter
- The request parameter containing the custom header.
The object that will be use to post the result to the UI thread.IllegalArgumentException
- When the collection of headers passed in is null, or adding a header prohibited in the headers
customization or containing illegal characters.void acknowledgeMessage(OobIncomingMessage message, OobAcknowledgeCallback callback)
This method is executed asynchronously and the result will be posted in the provided callback interface. The callback will be done in the UI thread.
message
- The incoming message to acknowledge.callback
- The object that will be use to post the result to the UI thread.void acknowledgeMessage(OobIncomingMessage message, OobAcknowledgeCallback callback, OobRequestParameter oobRequestParameter)
This method is executed asynchronously and the result will be posted in the provided callback interface. The callback will be done in the UI thread.
message
- The incoming message to acknowledge.callback
- The object that will be use to post the result to the UI thread.oobRequestParameter
- The request parameter containing the custom header.IllegalArgumentException
- When the collection of headers passed in is null, or adding a header prohibited in the headers
customization or containing illegal characters.