@ProviderType
public interface MessageStore
DataService implementation.
See StoredMessage for a description of the stored message fields.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the message store, releasing any runtime resources allocated for it.
|
void |
deleteStaleMessages(int purgeAgeSeconds)
Deletes the messages that satisfy any of the following conditions:
The value of the
droppedOn parameter is set and is more than
purgeAgeSeconds in the past.
The value of the confirmedOn parameter is set and is more
than
purgeAgeSeconds in the past.
The value of the QoS parameter is 0 and
publishedOn is set and is more than purgeAgeSeconds
in the
past.
|
void |
dropAllInFlightMessages()
Sets the value of the
droppedOn parameter to the current
timestamp to all messages that satisfy all of the following conditions:
The value of the QoS parameter is greater than 0.
The publishedOn parameter is set.
The confirmedOn parameter is not set.
|
java.util.Optional<StoredMessage> |
get(int msgId)
Retrieves the message with the given identifier from the store.
|
java.util.List<StoredMessage> |
getDroppedMessages()
Returns the list of messages with the following property:
The
droppedOn parameter must be set.
It is not necessary to return the message payload. |
java.util.List<StoredMessage> |
getInFlightMessages()
Returns the list of messages that satisfy all of the following conditions:
The value of the
QoS parameter is greater than 0.
The publishedOn parameter is set.
The confirmedOn parameter is not set.
The droppedOn parameter is not set.
It is not necessary to return the message payload. |
int |
getMessageCount()
Returns the number of messages currently in the store.
|
java.util.Optional<StoredMessage> |
getNextMessage()
Gets the next message that should be published, if any.
|
java.util.List<StoredMessage> |
getUnpublishedMessages()
Returns the list of messages whose
publishedOn parameter is not
set. |
void |
markAsConfirmed(int msgId)
Sets the value of the
confirmedOn parameter to the current time. |
void |
markAsPublished(int msgId)
Sets the value of the
publishedOn parameter to the current time. |
void |
markAsPublished(int msgId,
DataTransportToken dataTransportToken)
Sets the value of the
publishedOn parameter to the current time
and associates the given DataTransportToken with the current
message. |
int |
store(java.lang.String topic,
byte[] payload,
int qos,
boolean retain,
int priority)
Inserts a new message in the store.
|
void |
unpublishAllInFlighMessages()
Removes the value of the
publishedOn parameter from the messages
that satisfy all of the following conditions:
The publishedOn parameter is set.
The confirmedOn parameter is not set.
|
int store(java.lang.String topic,
byte[] payload,
int qos,
boolean retain,
int priority)
throws KuraStoreException
createdOn message parameter to the current time.
topic - the value of the topic parameter.payload - topic the value of the payload parameter.qos - topic the value of the QoS parameter.retain - topic the value of the retain parameter.priority - topic the value of the priority parameter.KuraStoreExceptionvoid markAsPublished(int msgId)
throws KuraStoreException
publishedOn parameter to the current time.
msgId - the message identifierKuraStoreExceptionvoid markAsPublished(int msgId,
DataTransportToken dataTransportToken)
throws KuraStoreException
publishedOn parameter to the current time
and associates the given DataTransportToken with the current
message.
msgId - the message identifier.dataTransportToken - the DataTransportToken.KuraStoreExceptionvoid markAsConfirmed(int msgId)
throws KuraStoreException
confirmedOn parameter to the current time.
msgId - the message identifier.KuraStoreExceptionjava.util.Optional<StoredMessage> getNextMessage() throws KuraStoreException
publishedOn parameter must not be set.priority numeric
parameter (highest priority) between messages that satisfy 1.createdOn parameter value between
the messages that satisfy 2.KuraStoreExceptionjava.util.Optional<StoredMessage> get(int msgId) throws KuraStoreException
msgId - the message identifier.KuraStoreExceptionint getMessageCount()
throws KuraStoreException
KuraStoreExceptionjava.util.List<StoredMessage> getUnpublishedMessages() throws KuraStoreException
publishedOn parameter is not
set.
payload.KuraStoreExceptionjava.util.List<StoredMessage> getInFlightMessages() throws KuraStoreException
QoS parameter is greater than 0.publishedOn parameter is set.confirmedOn parameter is not set.droppedOn parameter is not set.payload.KuraStoreExceptionjava.util.List<StoredMessage> getDroppedMessages() throws KuraStoreException
droppedOn parameter must be set.payload.KuraStoreExceptionvoid unpublishAllInFlighMessages()
throws KuraStoreException
publishedOn parameter from the messages
that satisfy all of the following conditions:
publishedOn parameter is set.confirmedOn parameter is not set.KuraStoreExceptionvoid dropAllInFlightMessages()
throws KuraStoreException
droppedOn parameter to the current
timestamp to all messages that satisfy all of the following conditions:
QoS parameter is greater than 0.publishedOn parameter is set.confirmedOn parameter is not set.KuraStoreExceptionvoid deleteStaleMessages(int purgeAgeSeconds)
throws KuraStoreException
droppedOn parameter is set and is more than
purgeAgeSeconds in the past.confirmedOn parameter is set and is more
than
purgeAgeSeconds in the past.QoS parameter is 0 and
publishedOn is set and is more than purgeAgeSeconds
in the
past.purgeAgeSeconds - the purge age in seconds.KuraStoreExceptionvoid close()