Interface IMessageRepository
interface IMessageRepository
Extends com.amazon.apmf.IStandard
Message repository.
Refers to a MAS instance.
Methods
getSupportedFeatures()
Get the supported features of this message repository. Privilege: None ( IMessageRepository is retrieved with IMessageClient::getMessageRepositories() which requires the com.amazon.bluetooth.privilege.access privilege).MessageRepositoryFeature[]getSupportedFeatures()
Returns
MessageRepositoryFeature[]
Returns an array of MessageRepositoryFeature.
Throws
OutOfMemoryError— if failed to make array of MessageRepositoryFeature.
getSupportedMessageTypes()
Get the supported message types of this message repository. Privilege: None ( IMessageRepository is retrieved with IMessageClient::getMessageRepositories() which requires the com.amazon.bluetooth.privilege.access privilege).MessageType[]getSupportedMessageTypes()
Returns
MessageType[]
Returns an array of MessageType.
Throws
OutOfMemoryError— if failed to make array of MessageType.
getName()
string getName()
Get the name of this message repository.
Privilege: None ( IMessageRepository is retrieved with
IMessageClient::getMessageRepositories() which requires the
com.amazon.bluetooth.privilege.access privilege).
Returns
string
Returns Message repository name string.
Throws
OutOfMemoryError— if failed to make string.
getDevice()
Get the remote device of this message repository. Privilege: None ( IMessageRepository is retrieved with IMessageClient::getMessageRepositories() which requires the com.amazon.bluetooth.privilege.access privilege).IDevice*getDevice()
Returns
IDevice*
Returns a pointer to IDevice.
Throws
OutOfMemoryError— if failed to make IDevice.
addListener()
Add a listener for events from this message repository. Privilege: com.amazon.bluetooth.privilege.message_clientcom.amazon.apmf.ISubscription*addListener(IMessageRepositoryListener*listener)
Parameters
listener
IMessageRepositoryListener* — Required
IMessageRepositoryListener.
Returns
com.amazon.apmf.ISubscription*
Returns a pointer to ISubscription.
Throws
OutOfMemoryError— if failed to make ISubscription.
connect()
void connect()
Connect to this message repository.
All applications share connections to the same remote device
message repository. Connection to message repository is required for all
message operations. This is a blocking call until the connection with the
remote device message repository is established.
Privilege: com.amazon.bluetooth.privilege.access
Throws
BluetoothConnectionFailed— if failed to connect to message repository.TimeoutError— if operation timed out.BluetoothBusy— if already pending some actions.BluetoothAuthorizationRejectedByUser— if authentication rejected by remote.
disconnect()
void disconnect()
Disconnect from this message repository.
All applications share connections to the same remote device
message repository. Message operations fail when disconnected from
message repository. This is a blocking call until the disconnection with
the remote device message repository is complete.
Privilege: com.amazon.bluetooth.privilege.access
Throws
BluetoothConnectionFailed— of failed to disconnect from message repository.TimeoutError— if operation timed out.BluetoothBusy— if already pending some actions.
isConnected()
bool isConnected()
Get message repository connection state.
Indicates that the message repository is connected. This might be
triggered by IMessageRepository::connect() from any application.
Privilege: com.amazon.bluetooth.privilege.access
Returns
bool
Returns true if message repository is connected, false otherwise.
makeMessageBuilder()
Make a message builder. This creates a new message that can be sent through the message repository.IMessageBuilder*makeMessageBuilder()
Returns
IMessageBuilder*
Returns pointer to IMessageBuilder.
Throws
OutOfMemoryError— if failed to make IMessageBuilder.
sendMessage()
Send a message to this message repository. This is a blocking call until message is received by the message repository (not when message is delivered to the intended recipients). Privilege: com.amazon.bluetooth.privilege.message_clientvoidsendMessage(IMessage*message,MessageSendSettings*settings)
Parameters
message
IMessage* — Required
Message to send, see IMessage.
settings
MessageSendSettings* — Required
Send message settings, see MessageSendSettings.
Throws
BluetoothNotConnected— if message repository not connected.BluetoothFail— if failed to send message.TimeoutError— if operation timed out.BluetoothUnsupported— if operation is not supported.
makeListingFilterBuilder()
Make a message listing filter builder. IMessageListingFilter is used with IMessageRepository::getMessageListing().IMessageListingFilterBuilder*makeListingFilterBuilder()
Returns
IMessageListingFilterBuilder*
Returns pointer to IMessageListingFilterBuilder.
Throws
OutOfMemoryError— if failed to make IMessageListingFilterBuilder.
getMessageListing()
Get messages listing from this message repository. A message listing is a list of message summary details such as subject, sender, and date time, see IMessageListing for more details. This is a blocking call until message listing is received from the remote device message repository. Privilege: com.amazon.bluetooth.privilege.message_clientIMessageListing*[]getMessageListing(IMessageListingFilter*filter)
Parameters
filter
IMessageListingFilter* — Required
IMessageListingFilter is used to process message listings.
Returns
IMessageListing*[]
Returns an array of pointer to IMessageListing objects.
Throws
BluetoothNotConnected— if message repository is not connected.BluetoothFail— if failed to get message listing.TimeoutError— if operation timed out.BluetoothUnsupported— if operation is not supported.

