com.atlassian.confluence.userstatus
Class HibernateUserStatusDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.hibernate.HibernateObjectDao
              extended by com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
                  extended by com.atlassian.confluence.core.persistence.hibernate.ContentEntityObjectHibernateDao
                      extended by com.atlassian.confluence.userstatus.HibernateUserStatusDao
All Implemented Interfaces:
ObjectDao, ContentEntityObjectDao, VersionedObjectDao, UserStatusDao, org.springframework.beans.factory.InitializingBean

public class HibernateUserStatusDao
extends ContentEntityObjectHibernateDao
implements UserStatusDao


Field Summary
 
Fields inherited from class com.atlassian.confluence.core.persistence.hibernate.ContentEntityObjectHibernateDao
ONE_DAY
 
Fields inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
cacheFactory
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernateUserStatusDao()
           
 
Method Summary
 void clearCurrentUserStatus(java.lang.String username)
          Clears the current status of the specified user
 void clearCurrentUserStatus(com.atlassian.user.User user)
          Clears the current status of the specified user
 void clearUserStatus(UserStatus status)
          Clears the specified status if it is current
 java.util.List<UserStatus> getAllByUser(java.lang.String username)
          Return a list of all user status updates from the specified user
 java.util.List<UserStatus> getAllByUser(java.lang.String username, int maxResults)
          Returns a list of user status updates from a specified user with a specified number of results.
 java.util.List<UserStatus> getAllByUser(com.atlassian.user.User user)
          Return a list of all user status updates from the specified user.
 java.util.List<UserStatus> getAllByUser(com.atlassian.user.User user, int maxResults)
          Returns a list of user status updates from a specified user with a specified number of results.
 UserStatus getById(long id)
          Gets a user status by its id
 UserStatus getByUser(java.lang.String username)
          Gets the current user status.
 UserStatus getByUser(com.atlassian.user.User user)
          Gets the current user status.
 java.lang.Class getPersistentClass()
           
 int getUserStatusCount(java.lang.String username)
          Returns the total number of user statuses stored against the specified user.
 int getUserStatusCount(com.atlassian.user.User user)
          Returns the total number of user statuses stored against the specified user.
 void removeAllStatusesForUser(java.lang.String username)
          Remove all user statuses for a particular user
 void removeAllStatusesForUser(com.atlassian.user.User user)
          Remove all user statuses for a particular user
 
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.ContentEntityObjectHibernateDao
findPreviousVersions, getAllCurrentEntities, getContentAuthoredByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getLockedContentBySpace, getObjectType, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getVersion, getVersionHistorySummary
 
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
findAllSorted, findLatestVersionsCount, findLatestVersionsIterator, save, setCacheFactory, updateModificationData
 
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao
findAll, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex
 
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
 
Methods inherited from interface com.atlassian.confluence.core.persistence.ContentEntityObjectDao
findPreviousVersions, getAllCurrentEntities, getContentAuthoredByUser, getFirstVersionAfter, getFirstVersionBefore, getLastEditedVersionsOf, getLockedContentBySpace, getObjectType, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getTrashedContent, getVersion, getVersionHistorySummary
 
Methods inherited from interface com.atlassian.confluence.core.persistence.VersionedObjectDao
findLatestVersionsCount, findLatestVersionsIterator, save
 
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, refresh, remove, replicate, save, saveRaw
 

Constructor Detail

HibernateUserStatusDao

public HibernateUserStatusDao()
Method Detail

getPersistentClass

public java.lang.Class getPersistentClass()
Specified by:
getPersistentClass in interface ObjectDao
Overrides:
getPersistentClass in class ContentEntityObjectHibernateDao

getAllByUser

public java.util.List<UserStatus> getAllByUser(java.lang.String username)
Description copied from interface: UserStatusDao
Return a list of all user status updates from the specified user

Specified by:
getAllByUser in interface UserStatusDao
Parameters:
username - the username of user to find status updates for
Returns:
a list of user status updates

getAllByUser

public java.util.List<UserStatus> getAllByUser(java.lang.String username,
                                               int maxResults)
Description copied from interface: UserStatusDao
Returns a list of user status updates from a specified user with a specified number of results. If there are no statuses an empty list is returned.

Specified by:
getAllByUser in interface UserStatusDao
Parameters:
username - the user to find status updates for
maxResults - the maximum number of results to return
Returns:
a list of user status updates

getAllByUser

public java.util.List<UserStatus> getAllByUser(com.atlassian.user.User user)
Description copied from interface: UserStatusDao
Return a list of all user status updates from the specified user. If there are no statuses an empty list is returned.

Specified by:
getAllByUser in interface UserStatusDao
Parameters:
user - the user to find status updates for
Returns:
a list of user status updates

getAllByUser

public java.util.List<UserStatus> getAllByUser(com.atlassian.user.User user,
                                               int maxResults)
Description copied from interface: UserStatusDao
Returns a list of user status updates from a specified user with a specified number of results. If there are no statuses an empty list is returned.

Specified by:
getAllByUser in interface UserStatusDao
Parameters:
user - the user to find status updates for
maxResults - the maximum number of results to return
Returns:
a list of user status updates

getByUser

public UserStatus getByUser(java.lang.String username)
Description copied from interface: UserStatusDao
Gets the current user status. If there is no status for that user null is returned.

Specified by:
getByUser in interface UserStatusDao
Parameters:
username - the specified user name
Returns:
the current user status, or null if no status exists

getByUser

public UserStatus getByUser(com.atlassian.user.User user)
Description copied from interface: UserStatusDao
Gets the current user status. If there is no status for that user null is returned.

Specified by:
getByUser in interface UserStatusDao
Parameters:
user - the user object
Returns:
the current user status, or null if no status exists
Throws:
java.lang.IllegalArgumentException - if user is null

getById

public UserStatus getById(long id)
Description copied from interface: UserStatusDao
Gets a user status by its id

Specified by:
getById in interface ContentEntityObjectDao
Specified by:
getById in interface UserStatusDao
Overrides:
getById in class ContentEntityObjectHibernateDao
Parameters:
id - the status id
Returns:
a user status

getUserStatusCount

public int getUserStatusCount(java.lang.String username)
Description copied from interface: UserStatusDao
Returns the total number of user statuses stored against the specified user.

Specified by:
getUserStatusCount in interface UserStatusDao
Parameters:
username - the user to count the statuses for
Returns:
the number of user statuses

getUserStatusCount

public int getUserStatusCount(com.atlassian.user.User user)
Description copied from interface: UserStatusDao
Returns the total number of user statuses stored against the specified user.

Specified by:
getUserStatusCount in interface UserStatusDao
Parameters:
user - the user to count the statuses for
Returns:
the number of user statuses

clearCurrentUserStatus

public void clearCurrentUserStatus(com.atlassian.user.User user)
Description copied from interface: UserStatusDao
Clears the current status of the specified user

Specified by:
clearCurrentUserStatus in interface UserStatusDao
Parameters:
user - - the user to clear the status for

clearCurrentUserStatus

public void clearCurrentUserStatus(java.lang.String username)
Description copied from interface: UserStatusDao
Clears the current status of the specified user

Specified by:
clearCurrentUserStatus in interface UserStatusDao
Parameters:
username - - the user to clear the status for

clearUserStatus

public void clearUserStatus(UserStatus status)
Description copied from interface: UserStatusDao
Clears the specified status if it is current

Specified by:
clearUserStatus in interface UserStatusDao
Parameters:
status - - the status to clear

removeAllStatusesForUser

public void removeAllStatusesForUser(com.atlassian.user.User user)
Description copied from interface: UserStatusDao
Remove all user statuses for a particular user

Specified by:
removeAllStatusesForUser in interface UserStatusDao
Parameters:
user - - the specified user

removeAllStatusesForUser

public void removeAllStatusesForUser(java.lang.String username)
Description copied from interface: UserStatusDao
Remove all user statuses for a particular user

Specified by:
removeAllStatusesForUser in interface UserStatusDao
Parameters:
username - - name of the specified user


Copyright © 2003-2010 Atlassian. All Rights Reserved.