Interface IEMessageStore
-
- All Known Implementing Classes:
InMemoryMessageStore,SqlMessageStore
public interface IEMessageStoreThis interface providesEHistoricPublishFeedthe ability to persist notification messages and to retrieve those message for a given historic time interval. Notification messages are persisted when anhistoric publisherpublishesa notification message. Notification messages are retrieved whenEHistoricPublishFeedreceives arequest for historic messages.Please note that this message store is not only used to persist application notification messages but also
PublishStatusEventmessages.An
IEMessageStoreinstance may be shared among multipleEHistoricPublishFeeds but the implementation is responsible for maintaining thread-safety.When building an
EHistoricPublishFeed, a non-null, open message store must be passed toEHistoricPublishFeed.Builder.messageStore(IEMessageStore). Failure to do so results in an exception. The appropriate opening and closing of theIEMessageStoreis outside the scope of the historic publish feed and left up to the application. The restriction is that the message store must be opened prior to opening the historic publish feed and closed after closing the historic publish feed.It is left up to the implementation to decide how messages are persisted or retrieved.
- Author:
- Charles W. Rapp
- See Also:
EHistoricPublishFeed,EInterval
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisOpen()Returnstrueif this message store is open and ready to store or retrieve notification messages.EMessageKeykey()Returns message key associated with message store.Collection<ENotificationMessage>retrieve(EInterval interval)Retrieves historic messages as defined by given date/time interval.voidstore(ENotificationMessage message)Persists given notification message to store.
-
-
-
Method Detail
-
isOpen
boolean isOpen()
Returnstrueif this message store is open and ready to store or retrieve notification messages.- Returns:
trueif message store is open.
-
key
EMessageKey key()
Returns message key associated with message store.- Returns:
- message store's associated key.
-
store
void store(ENotificationMessage message)
Persists given notification message to store.- Parameters:
message- persist this message.- Throws:
NullPointerException- ifmessageisnull.- See Also:
retrieve(EInterval)
-
retrieve
Collection<ENotificationMessage> retrieve(EInterval interval)
Retrieves historic messages as defined by given date/time interval. Returned collection may be empty but nevernull.Please note that implementation are not required to validate
intervalsince this is performed byEHistoricPublishFeed. That said, such validation is encourage if store is used outside of eBus historic feed framework.- Parameters:
interval- date/time interval.- Returns:
- iterator over historic messages. Does not
return
nullbut may return iterator whereIterator.hasNext()returnsfalse. - See Also:
store(ENotificationMessage)
-
-