|
From: Ng C. Y. [Cyng] <cy...@cs...> - 2004-03-31 03:20:40
|
Hello,
> messageId=id and messageState>=STATE_RECEIVED and
> messageState<=STATE_SENT_RECEIVED
> which includes the message states RECEIVED, RECEIVED_ACKNOWLEDGED, and
> SENT_RECEIVED. However, I want to include other message states such as SENT
> and (if we get notification of intermediate send failures in the future)
> SENT_STARTED.
>
> What is the logic behind limiting getMessageById() in this way? Should there
> be another method called getAnyMessageById() (with a corresponding client
> request)?
Here are the design concepts.
Request.getReceivedMessageIds() is to retrieve those *undelivered*
message id's only so that you can call Request.receive(messageId) to
get the undelivered message. (This is what we call on-demand-mode
retrieval as we get undelivered messages on-demand without polling or
using message listener.)
After Request.receive(messageId) is called to get an undelivered
message, that message will be marked "delivered". But you can still
call Request.receive(messageId) to get the same delivered message again
later. This is a requirement that we met before in a pilot project in
which the application suddenly fails when it is receiving an undelivered
message. After this application recovers, it has lost the copy of the
message but just has the message id persisted.
You are right that we may consider to have a getAllMessageIds()
or getSentMessageIds(). (You may even forget what you "spoke" before
and want to get it again? :-) )
Regards,
CY
----------------------------------------------------------------------------
Ng Chi Yuen, CY. cy...@cs... http://www.cecid.hku.hk/
Technology Officer,
Centre for E-Commerce Infrastructure Development,
The University of Hong Kong
----------------------------------------------------------------------------
|