|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JournalDao
Provides access to JournalEntry
objects.
Method Summary | |
---|---|
int |
countEntries(JournalIdentifier journalId,
long afterId,
long ignoreWithinMillis)
Counts the number of entries in a journal. |
long |
enqueue(JournalEntry entry)
Adds the given entry to a journal. |
java.util.List<JournalEntry> |
findEntries(JournalIdentifier journalId,
long afterId,
long ignoreWithinMillis,
int maxEntries)
Finds journal entries that were added after an entry with the given id but earlier than given milliseconds ago. |
com.atlassian.fugue.Option<JournalEntry> |
findLatestEntry(JournalIdentifier journalId,
long ignoreWithinMillis)
Finds the latest journal entry if any. |
com.atlassian.fugue.Option<JournalEntry> |
findMostRecentEntryByMessage(JournalIdentifier journalId,
java.lang.String message)
Finds the most recent journal entry (if any) for the given journal that exactly matches the given journal entry message. |
int |
removeEntriesOlderThan(java.util.Date date)
Removes entries from all journals that were created before the given date. |
Method Detail |
---|
long enqueue(@Nonnull JournalEntry entry)
entry
- entry to persist
java.util.List<JournalEntry> findEntries(@Nonnull JournalIdentifier journalId, long afterId, long ignoreWithinMillis, int maxEntries)
This method can miss some entries due to identifier assignment and entry insertion not being an atomic operation. The risk of missed entries can be reduced in two ways:
journalId
- only entries with this journal id will be returnedafterId
- only entries with id higher than this will be returnedignoreWithinMillis
- only entries created this many milliseconds ago
or earlier will be returnedmaxEntries
- maximum number of entries to process
com.atlassian.fugue.Option<JournalEntry> findMostRecentEntryByMessage(@Nonnull JournalIdentifier journalId, java.lang.String message)
journalId
- only entries with this journal id will be returnedmessage
- the exact text of the journal entry message
int removeEntriesOlderThan(@Nonnull java.util.Date date)
date
- only entried with a date later than this will be returned
com.atlassian.fugue.Option<JournalEntry> findLatestEntry(@Nonnull JournalIdentifier journalId, long ignoreWithinMillis)
journalId
- identifier of the journalignoreWithinMillis
- only entry created this many milliseconds ago
or earlier will be returned
int countEntries(@Nonnull JournalIdentifier journalId, long afterId, long ignoreWithinMillis)
journalId
- identifier of the journalafterId
- only entries with id higher than this will be returnedignoreWithinMillis
- only entries created this many milliseconds ago
or earlier will be returned
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |