com.atlassian.confluence.core.persistence.hibernate
Class HibernateVersionHistoryDao

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.HibernateVersionHistoryDao
All Implemented Interfaces:
ObjectDao, VersionHistoryDao, org.springframework.beans.factory.InitializingBean

public class HibernateVersionHistoryDao
extends HibernateObjectDao
implements VersionHistoryDao


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Fields inherited from interface com.atlassian.confluence.core.persistence.VersionHistoryDao
PRE_UPGRADE_VERSION, UNKNOWN_BUILD_NUMBER
 
Constructor Summary
HibernateVersionHistoryDao()
           
 
Method Summary
 void addBuildToHistory(int buildNumber)
          The version history consists of a list of builds that Confluence has been successfully upgraded to
 int getLatestBuildNumber()
          Get the highest build number from the database.
 Class getPersistentClass()
           
 VersionHistory getVersionHistory(int buildNumber)
           
 boolean tagBuild(int buildNumber, String tag)
          We need to ensure that the checking and writing of the tag is atomic so as to prevent two or more nodes from writing the tag and reporting that it was set correctly
 
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao
findAll, findAllSorted, 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, updateModificationData
 
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 bucket.core.persistence.ObjectDao
findAll, findAllSorted, refresh, remove, replicate, save, saveRaw
 

Constructor Detail

HibernateVersionHistoryDao

public HibernateVersionHistoryDao()
Method Detail

getPersistentClass

public Class getPersistentClass()
Specified by:
getPersistentClass in interface ObjectDao

getLatestBuildNumber

public int getLatestBuildNumber()
Description copied from interface: VersionHistoryDao
Get the highest build number from the database. This should represent what version the database thinks Confluence is running at, which in turn is used to schedule database-hitting upgrade tasks. If the number can not be determined (there are no versions in the database, or the version history table hasn't even been created yet) then the method will return UNKNOWN_BUILD_NUMBER. In this case, callers should assume that the database build number is identical to the configured build number.

Specified by:
getLatestBuildNumber in interface VersionHistoryDao
Returns:
the highest build number in version history table, or UNKNOWN_BUILD_NUMBER if that can not be determined.

getVersionHistory

public VersionHistory getVersionHistory(int buildNumber)
Specified by:
getVersionHistory in interface VersionHistoryDao
Returns:
the version history object associated with the build number (if there is more than one, return the latest)

tagBuild

public boolean tagBuild(int buildNumber,
                        String tag)
We need to ensure that the checking and writing of the tag is atomic so as to prevent two or more nodes from writing the tag and reporting that it was set correctly

Specified by:
tagBuild in interface VersionHistoryDao
Returns:
true if the build number was successfully tagged, false if the tag specified has already been associated with this build number

addBuildToHistory

public void addBuildToHistory(int buildNumber)
Description copied from interface: VersionHistoryDao
The version history consists of a list of builds that Confluence has been successfully upgraded to

Specified by:
addBuildToHistory in interface VersionHistoryDao


Copyright © 2003-2010 Atlassian. All Rights Reserved.