public class

HibernateVersionHistoryDao

extends HibernateObjectDao
implements VersionHistoryDao
java.lang.Object
   ↳ org.springframework.dao.support.DaoSupport
     ↳ org.springframework.orm.hibernate.support.HibernateDaoSupport
       ↳ com.atlassian.hibernate.HibernateObjectDao
         ↳ com.atlassian.confluence.core.persistence.hibernate.HibernateVersionHistoryDao

Summary

[Expand]
Inherited Constants
From interface com.atlassian.confluence.core.persistence.VersionHistoryDao
[Expand]
Inherited Fields
From class com.atlassian.hibernate.HibernateObjectDao
From class org.springframework.dao.support.DaoSupport
Public Constructors
HibernateVersionHistoryDao()
Public Methods
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
[Expand]
Inherited Methods
From class com.atlassian.hibernate.HibernateObjectDao
From class org.springframework.orm.hibernate.support.HibernateDaoSupport
From class org.springframework.dao.support.DaoSupport
From class java.lang.Object
From interface bucket.core.persistence.ObjectDao
From interface com.atlassian.confluence.core.persistence.VersionHistoryDao
From interface org.springframework.beans.factory.InitializingBean

Public Constructors

public HibernateVersionHistoryDao ()

Public Methods

public void addBuildToHistory (int buildNumber)

The version history consists of a list of builds that Confluence has been successfully upgraded to

public int getLatestBuildNumber ()

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.

Returns
  • the highest build number in version history table, or UNKNOWN_BUILD_NUMBER if that can not be determined.

public Class getPersistentClass ()

public VersionHistory getVersionHistory (int buildNumber)

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

Returns
  • true if the build number was successfully tagged, false if the tag specified has already been associated with this build number