public interface JournalDao
JournalEntry
objects.Modifier and Type | Method and Description |
---|---|
int |
countEntries(@NonNull JournalIdentifier journalId,
long afterId,
long ignoreWithinMillis)
Counts the number of entries in a journal.
|
long |
enqueue(@NonNull JournalEntry entry)
Adds the given entry to a journal.
|
List<JournalEntry> |
findEntries(@NonNull 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.
|
JournalEntry |
findEntry(long entryId)
Finds the specified journal entry, if it exists.
|
com.atlassian.fugue.Option<JournalEntry> |
findLatestEntry(@NonNull JournalIdentifier journalId,
long ignoreWithinMillis)
Finds the latest journal entry if any.
|
com.atlassian.fugue.Option<JournalEntry> |
findMostRecentEntryByMessage(@NonNull JournalIdentifier journalId,
String message)
Finds the most recent journal entry (if any) for the given journal that
exactly matches the given journal entry message.
|
int |
removeEntriesOlderThan(@NonNull Date date)
Removes entries from all journals that were created before the given
date.
|
long enqueue(@NonNull JournalEntry entry)
entry
- entry to persistList<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 processcom.atlassian.fugue.Option<JournalEntry> findMostRecentEntryByMessage(@NonNull JournalIdentifier journalId, String message)
Note that this operation is likely to EXTREMELY SLOW when the journal gets above a certain size. Do not use in production code.
journalId
- only entries with this journal id will be returnedmessage
- the exact text of the journal entry messageint removeEntriesOlderThan(@NonNull Date date)
date
- only entried with a date later than this will be returnedcom.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 returnedJournalEntry findEntry(long entryId)
entryId
- identifier of the journal entryint 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 returnedCopyright © 2003–2020 Atlassian. All rights reserved.