Package com.atlassian.crowd.dao.cluster
Class ClusterMessageDAOHibernate
java.lang.Object
com.atlassian.crowd.util.persistence.hibernate.StatelessDao
com.atlassian.crowd.dao.cluster.ClusterMessageDAOHibernate
- All Implemented Interfaces:
ClusterMessageDao
-
Field Summary
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.StatelessDao
sessionFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessage
(InternalClusterMessage message) int
deleteClusterMessagesBeforeAndOn
(long toTimestamp) Deletes all mesages older than the timestamp.Finds the highest ID currently in database.getMessagesAfter
(String excludeNodeId, long fromId) Fetches messages with ID higher than the specified threshold.Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.StatelessDao
setSessionFactory, withStatelessSession
-
Constructor Details
-
ClusterMessageDAOHibernate
public ClusterMessageDAOHibernate()
-
-
Method Details
-
addMessage
- Specified by:
addMessage
in interfaceClusterMessageDao
-
getMessagesAfter
Description copied from interface:ClusterMessageDao
Fetches messages with ID higher than the specified threshold.- Specified by:
getMessagesAfter
in interfaceClusterMessageDao
- Parameters:
excludeNodeId
- node that should be excluded from search (this will usually be the calling node); null to include all nodesfromId
- start message ID for the search, non-inclusive- Returns:
- list of results in ascending ID order
-
deleteClusterMessagesBeforeAndOn
public int deleteClusterMessagesBeforeAndOn(long toTimestamp) Description copied from interface:ClusterMessageDao
Deletes all mesages older than the timestamp.- Specified by:
deleteClusterMessagesBeforeAndOn
in interfaceClusterMessageDao
- Returns:
- number of messages deleted
-
getHighestId
Description copied from interface:ClusterMessageDao
Finds the highest ID currently in database.- Specified by:
getHighestId
in interfaceClusterMessageDao
- Returns:
- highest ID found, or null if there are no rows
-