|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.dao.support.DaoSupport org.springframework.orm.hibernate.support.HibernateDaoSupport com.atlassian.confluence.impl.journal.HibernateJournalDao
public class HibernateJournalDao
JournalDao
that uses Hibernate for
persistence.
Field Summary |
---|
Fields inherited from class org.springframework.dao.support.DaoSupport |
---|
logger |
Constructor Summary | |
---|---|
HibernateJournalDao()
|
|
HibernateJournalDao(com.atlassian.core.util.Clock clock)
|
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. |
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,
String message)
Finds the most recent journal entry (if any) for the given journal that exactly matches the given journal entry message. |
void |
queueWithCustomCreationDate(JournalEntry entry,
Date creationDate)
|
int |
removeEntriesOlderThan(Date date)
Removes entries from all journals that were created before the given date. |
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport |
---|
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory |
Methods inherited from class org.springframework.dao.support.DaoSupport |
---|
afterPropertiesSet, initDao |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HibernateJournalDao()
public HibernateJournalDao(com.atlassian.core.util.Clock clock)
Method Detail |
---|
public long enqueue(JournalEntry entry)
JournalDao
enqueue
in interface JournalDao
entry
- entry to persist
@Internal public void queueWithCustomCreationDate(JournalEntry entry, Date creationDate)
public List<JournalEntry> findEntries(JournalIdentifier journalId, long afterId, long ignoreWithinMillis, int maxEntries)
JournalDao
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:
findEntries
in interface JournalDao
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
public com.atlassian.fugue.Option<JournalEntry> findMostRecentEntryByMessage(@Nonnull JournalIdentifier journalId, String message)
JournalDao
findMostRecentEntryByMessage
in interface JournalDao
journalId
- only entries with this journal id will be returnedmessage
- the exact text of the journal entry message
public int removeEntriesOlderThan(Date date)
JournalDao
removeEntriesOlderThan
in interface JournalDao
date
- only entried with a date later than this will be returned
public com.atlassian.fugue.Option<JournalEntry> findLatestEntry(@Nonnull JournalIdentifier journalId, long ignoreWithinMillis)
JournalDao
findLatestEntry
in interface JournalDao
journalId
- identifier of the journalignoreWithinMillis
- only entry created this many milliseconds ago
or earlier will be returned
public int countEntries(@Nonnull JournalIdentifier journalId, long afterId, long ignoreWithinMillis)
JournalDao
countEntries
in interface JournalDao
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 |