|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.db.generic.CmsBackupDriver
Generic (ANSI-SQL) database server implementation of the backup driver methods.
Field Summary | |
protected CmsDriverManager |
m_driverManager
The driver manager instance. |
protected CmsSqlManager |
m_sqlManager
The SQL manager instance. |
Fields inherited from interface org.opencms.db.I_CmsBackupDriver |
DRIVER_TYPE_ID |
Constructor Summary | |
CmsBackupDriver()
|
Method Summary | |
CmsPropertyDefinition |
createBackupPropertyDefinition(CmsDbContext dbc,
java.lang.String name)
Creates a new property defintion in the database. |
CmsBackupResource |
createBackupResource(java.sql.ResultSet res,
boolean hasContent)
Creates a valid CmsBackupResource instance from a JDBC ResultSet. |
void |
deleteBackup(CmsDbContext dbc,
CmsBackupResource resource,
int tag,
int versions)
Deletes all backup versions of a backup resource that are older than a given project tag and where the version id is lower than a given value. |
void |
deleteBackupPropertyDefinition(CmsDbContext dbc,
CmsPropertyDefinition metadef)
Deletes a property defintion. |
void |
deleteBackups(CmsDbContext dbc,
java.util.List existingBackups,
int maxVersions)
Deletes backup versions of a resource. |
void |
destroy()
Destroys this driver. |
protected void |
finalize()
Releases any allocated resources during garbage collection. |
CmsSqlManager |
getSqlManager()
Returns the SqlManager of this driver. |
void |
init(CmsDbContext dbc,
CmsConfigurationManager configurationManager,
java.util.List successiveDrivers,
CmsDriverManager driverManager)
Initializes the driver. |
CmsSqlManager |
initSqlManager(java.lang.String classname)
Initializes the SQL manager for this driver. |
protected int |
internalCountProperties(CmsDbContext dbc,
CmsPropertyDefinition metadef,
int projectId)
Returns the amount of properties for a propertydefinition. |
protected void |
internalWriteBackupFileContent(CmsDbContext dbc,
CmsUUID backupId,
CmsResource resource,
int tagId,
int versionId)
Internal method to write the backup content. |
CmsBackupResource |
readBackupFile(CmsDbContext dbc,
int tagId,
java.lang.String resourcePath)
Reads a backup file including the file content. |
java.util.List |
readBackupFileHeaders(CmsDbContext dbc)
Reads all backup file headers excluding the file content. |
java.util.List |
readBackupFileHeaders(CmsDbContext dbc,
java.lang.String resourcePath,
CmsUUID id)
Reads all file headers of a file. |
int |
readBackupMaxVersion(CmsDbContext dbc,
CmsUUID resourceId)
Returns the max. current backup version of a resource. |
CmsBackupProject |
readBackupProject(CmsDbContext dbc,
int tagId)
Reads a backup project. |
java.util.List |
readBackupProjectResources(CmsDbContext dbc,
int tagId)
Reads all resources that belong to a given backup version ID. |
java.util.List |
readBackupProjects(CmsDbContext dbc)
Returns all projects from the history. |
int |
readBackupProjectTag(CmsDbContext dbc,
long maxdate)
Gets the TagId of the first backup project after a given date. |
java.util.List |
readBackupProperties(CmsDbContext dbc,
CmsBackupResource resource)
Returns a list of all properties of a backup file or folder. |
CmsPropertyDefinition |
readBackupPropertyDefinition(CmsDbContext dbc,
java.lang.String name)
Reads a property definition for the specified mapping type. |
int |
readMaxTagId(CmsDbContext dbc,
CmsResource resource)
Reads the max. backup tag ID for a specified resource. |
int |
readNextBackupTagId(CmsDbContext dbc)
Returns the next available backup version ID for a resource. |
void |
writeBackupProject(CmsDbContext dbc,
int tagId,
long publishDate)
Creates a backup of the current project. |
void |
writeBackupProperties(CmsDbContext dbc,
CmsResource resource,
java.util.List properties,
CmsUUID backupId,
int tagId,
int versionId)
Writes the properties of a resource to the backup. |
void |
writeBackupResource(CmsDbContext dbc,
CmsResource resource,
java.util.List properties,
int tagId,
long publishDate,
int maxVersions)
Writes a resource to the backup. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.opencms.db.I_CmsDriver |
toString |
Field Detail |
protected CmsDriverManager m_driverManager
protected CmsSqlManager m_sqlManager
Constructor Detail |
public CmsBackupDriver()
Method Detail |
public CmsPropertyDefinition createBackupPropertyDefinition(CmsDbContext dbc, java.lang.String name) throws CmsDataAccessException
I_CmsBackupDriver
createBackupPropertyDefinition
in interface I_CmsBackupDriver
dbc
- the current database contextname
- the name of the propertydefinitions to overwrite
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.createBackupPropertyDefinition(org.opencms.db.CmsDbContext, java.lang.String)
public CmsBackupResource createBackupResource(java.sql.ResultSet res, boolean hasContent) throws java.sql.SQLException
I_CmsBackupDriver
createBackupResource
in interface I_CmsBackupDriver
res
- the JDBC result sethasContent
- true if the file content is part of the result set
java.sql.SQLException
- if a requested attribute was not found in the result setI_CmsBackupDriver.createBackupResource(java.sql.ResultSet, boolean)
public void deleteBackup(CmsDbContext dbc, CmsBackupResource resource, int tag, int versions) throws CmsDataAccessException
I_CmsBackupDriver
deleteBackup
in interface I_CmsBackupDriver
dbc
- the current database contextresource
- the backup resourcetag
- the project tag dateversions
- the deletion version
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.deleteBackup(org.opencms.db.CmsDbContext, org.opencms.file.CmsBackupResource, int, int)
public void deleteBackupPropertyDefinition(CmsDbContext dbc, CmsPropertyDefinition metadef) throws CmsDataAccessException
I_CmsBackupDriver
deleteBackupPropertyDefinition
in interface I_CmsBackupDriver
dbc
- the current database contextmetadef
- the propertydefinitions to be deleted
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.deleteBackupPropertyDefinition(org.opencms.db.CmsDbContext, org.opencms.file.CmsPropertyDefinition)
public void deleteBackups(CmsDbContext dbc, java.util.List existingBackups, int maxVersions) throws CmsDataAccessException
I_CmsBackupDriver
Deletes the m-n oldest backup versions, if m is the number of backup versions, and n the number of max. allowed backup versions.
deleteBackups
in interface I_CmsBackupDriver
dbc
- the current database contextexistingBackups
- a list of backup resources ordered by their ascending creation datemaxVersions
- maximum number of versions per resource
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.deleteBackups(org.opencms.db.CmsDbContext, java.util.List, int)
public void destroy() throws java.lang.Throwable
I_CmsBackupDriver
destroy
in interface I_CmsBackupDriver
java.lang.Throwable
- if something goes wrongI_CmsBackupDriver.destroy()
public CmsSqlManager getSqlManager()
I_CmsBackupDriver
getSqlManager
in interface I_CmsBackupDriver
I_CmsBackupDriver.getSqlManager()
public void init(CmsDbContext dbc, CmsConfigurationManager configurationManager, java.util.List successiveDrivers, CmsDriverManager driverManager)
I_CmsDriver
init
in interface I_CmsDriver
dbc
- the current database contextconfigurationManager
- the configuration managersuccessiveDrivers
- a list of successive drivers to be initializeddriverManager
- the initialized OpenCms driver managerI_CmsDriver.init(org.opencms.db.CmsDbContext, org.opencms.configuration.CmsConfigurationManager, java.util.List, org.opencms.db.CmsDriverManager)
public CmsSqlManager initSqlManager(java.lang.String classname)
I_CmsBackupDriver
initSqlManager
in interface I_CmsBackupDriver
classname
- the classname of the SQL manager
I_CmsBackupDriver.initSqlManager(String)
public CmsBackupResource readBackupFile(CmsDbContext dbc, int tagId, java.lang.String resourcePath) throws CmsDataAccessException
I_CmsBackupDriver
readBackupFile
in interface I_CmsBackupDriver
dbc
- the current database contexttagId
- the desired tag ID of the fileresourcePath
- the path of the file to read
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.readBackupFile(CmsDbContext, int, String)
public java.util.List readBackupFileHeaders(CmsDbContext dbc) throws CmsDataAccessException
I_CmsBackupDriver
.
readBackupFileHeaders
in interface I_CmsBackupDriver
dbc
- the current database context
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.readBackupFileHeaders(org.opencms.db.CmsDbContext)
public java.util.List readBackupFileHeaders(CmsDbContext dbc, java.lang.String resourcePath, CmsUUID id) throws CmsDataAccessException
I_CmsBackupDriver
The filter is (path OR id).
readBackupFileHeaders
in interface I_CmsBackupDriver
dbc
- the current database contextresourcePath
- the path of the file to readid
- the resource id (usefull for siblings)
CmsBackupResource
objects, read from the Cms
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.readBackupFileHeaders(org.opencms.db.CmsDbContext, java.lang.String, org.opencms.util.CmsUUID)
public int readBackupMaxVersion(CmsDbContext dbc, CmsUUID resourceId) throws CmsDataAccessException
I_CmsBackupDriver
readBackupMaxVersion
in interface I_CmsBackupDriver
dbc
- the current database contextresourceId
- the resource ID of the resource
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.readBackupMaxVersion(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public CmsBackupProject readBackupProject(CmsDbContext dbc, int tagId) throws CmsDataAccessException
I_CmsBackupDriver
readBackupProject
in interface I_CmsBackupDriver
dbc
- the current database contexttagId
- the versionId of the project
CmsDataAccessException
- is something goes wrongI_CmsBackupDriver.readBackupProject(org.opencms.db.CmsDbContext, int)
public java.util.List readBackupProjectResources(CmsDbContext dbc, int tagId) throws CmsDataAccessException
I_CmsBackupDriver
readBackupProjectResources
in interface I_CmsBackupDriver
dbc
- the current database contexttagId
- the version ID of the backup
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.readBackupProjectResources(org.opencms.db.CmsDbContext, int)
public java.util.List readBackupProjects(CmsDbContext dbc) throws CmsDataAccessException
I_CmsBackupDriver
readBackupProjects
in interface I_CmsBackupDriver
dbc
- the current database context
CmsBackupProject
objects
with all projects from history.
CmsDataAccessException
- if an error occursI_CmsBackupDriver.readBackupProjects(org.opencms.db.CmsDbContext)
public int readBackupProjectTag(CmsDbContext dbc, long maxdate) throws CmsDataAccessException
I_CmsBackupDriver
This method is used during the deletion process of older backup data.
readBackupProjectTag
in interface I_CmsBackupDriver
dbc
- the current database contextmaxdate
- the date to compare the backup projects with
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.readBackupProjectTag(org.opencms.db.CmsDbContext, long)
public java.util.List readBackupProperties(CmsDbContext dbc, CmsBackupResource resource) throws CmsDataAccessException
I_CmsBackupDriver
readBackupProperties
in interface I_CmsBackupDriver
dbc
- the current database contextresource
- the resource to read the properties from
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.readBackupProperties(org.opencms.db.CmsDbContext, org.opencms.file.CmsBackupResource)
public CmsPropertyDefinition readBackupPropertyDefinition(CmsDbContext dbc, java.lang.String name) throws CmsDataAccessException
I_CmsBackupDriver
readBackupPropertyDefinition
in interface I_CmsBackupDriver
dbc
- the current database contextname
- the name of the propertydefinition to read
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.readBackupPropertyDefinition(org.opencms.db.CmsDbContext, java.lang.String)
public int readMaxTagId(CmsDbContext dbc, CmsResource resource) throws CmsDataAccessException
I_CmsBackupDriver
readMaxTagId
in interface I_CmsBackupDriver
dbc
- the current database contextresource
- the Cms resource
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.readMaxTagId(org.opencms.db.CmsDbContext, org.opencms.file.CmsResource)
public int readNextBackupTagId(CmsDbContext dbc)
I_CmsBackupDriver
readNextBackupTagId
in interface I_CmsBackupDriver
dbc
- the current database context
I_CmsBackupDriver.readNextBackupTagId(org.opencms.db.CmsDbContext)
public void writeBackupProject(CmsDbContext dbc, int tagId, long publishDate) throws CmsDataAccessException
I_CmsBackupDriver
writeBackupProject
in interface I_CmsBackupDriver
dbc
- the current database contexttagId
- the version ID of the backuppublishDate
- long timestamp when the current project was published.
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.writeBackupProject(org.opencms.db.CmsDbContext, int, long)
public void writeBackupProperties(CmsDbContext dbc, CmsResource resource, java.util.List properties, CmsUUID backupId, int tagId, int versionId) throws CmsDataAccessException
I_CmsBackupDriver
writeBackupProperties
in interface I_CmsBackupDriver
dbc
- the current database contextresource
- the resource of the propertiesproperties
- the properties to writebackupId
- the id backuptagId
- the tag ID of the backupversionId
- the version ID of the backup
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.writeBackupProperties(org.opencms.db.CmsDbContext, org.opencms.file.CmsResource, java.util.List, org.opencms.util.CmsUUID, int, int)
public void writeBackupResource(CmsDbContext dbc, CmsResource resource, java.util.List properties, int tagId, long publishDate, int maxVersions) throws CmsDataAccessException
I_CmsBackupDriver
writeBackupResource
in interface I_CmsBackupDriver
dbc
- the current database contextresource
- the resource that is written to the backupproperties
- the properties of the resourcetagId
- the version ID of the backuppublishDate
- long timestamp when the resource was publishedmaxVersions
- maximum number of backup versions
CmsDataAccessException
- if something goes wrongI_CmsBackupDriver.writeBackupResource(org.opencms.db.CmsDbContext, org.opencms.file.CmsResource, java.util.List, int, long, int)
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
Object.finalize()
protected int internalCountProperties(CmsDbContext dbc, CmsPropertyDefinition metadef, int projectId) throws CmsDataAccessException
dbc
- the current database contextmetadef
- the propertydefinition to testprojectId
- the ID of the current project
CmsDataAccessException
- if something goes wrongprotected void internalWriteBackupFileContent(CmsDbContext dbc, CmsUUID backupId, CmsResource resource, int tagId, int versionId) throws CmsDataAccessException
dbc
- the current database contextbackupId
- the backup idresource
- the resource to backuptagId
- the tag revisionversionId
- the version revision
CmsDataAccessException
- if something goes wrong
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |