|
|||||||||||
| 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,
String name)
Creates a new property defintion in the database. |
CmsBackupResource |
createBackupResource(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,
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,
List successiveDrivers,
CmsDriverManager driverManager)
Initializes the driver. |
CmsSqlManager |
initSqlManager(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,
String resourcePath)
Reads a backup file including the file content. |
CmsBackupResource |
readBackupFileHeader(CmsDbContext dbc,
int tagId,
String resourcePath)
Reads a backup file header excluding the file content. |
List |
readBackupFileHeaders(CmsDbContext dbc)
Reads all backup file headers excluding the file content. |
List |
readBackupFileHeaders(CmsDbContext dbc,
String resourcePath,
CmsUUID id)
Reads all file headers of a file. This method returns a list with the history of all file headers, i.e. |
int |
readBackupMaxVersion(CmsDbContext dbc,
CmsUUID resourceId)
Returns the max. |
CmsBackupProject |
readBackupProject(CmsDbContext dbc,
int tagId)
Reads a backup project. |
List |
readBackupProjectResources(CmsDbContext dbc,
int tagId)
Reads all resources that belong to a given backup version ID. |
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. |
List |
readBackupProperties(CmsDbContext dbc,
CmsBackupResource resource)
Returns a list of all properties of a backup file or folder. |
CmsPropertyDefinition |
readBackupPropertyDefinition(CmsDbContext dbc,
String name)
Reads a property definition for the specified mapping type. |
int |
readMaxTagId(CmsDbContext dbc,
CmsResource resource)
Reads the max. |
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,
List properties,
CmsUUID backupId,
int tagId,
int versionId)
Writes the properties of a resource to the backup. |
void |
writeBackupResource(CmsDbContext dbc,
CmsResource resource,
List properties,
int tagId,
long publishDate,
int maxVersions)
Writes a resource to the backup. |
void |
writeBackupResourceContent(CmsDbContext dbc,
int projectId,
CmsResource resource,
CmsBackupResource backupResource)
Writes a resource content 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,
String name)
throws CmsDataAccessException
I_CmsBackupDriver
createBackupPropertyDefinition in interface I_CmsBackupDriverdbc - 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(ResultSet res,
boolean hasContent)
throws SQLException
I_CmsBackupDriver
createBackupResource in interface I_CmsBackupDriverres - the JDBC result sethasContent - true if the file content is part of the result set
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_CmsBackupDriverdbc - 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_CmsBackupDriverdbc - 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,
List existingBackups,
int maxVersions)
throws CmsDataAccessException
I_CmsBackupDriverDeletes 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_CmsBackupDriverdbc - 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 Throwable
I_CmsBackupDriver
destroy in interface I_CmsBackupDriverThrowable - if something goes wrongI_CmsBackupDriver.destroy()public CmsSqlManager getSqlManager()
I_CmsBackupDriver
getSqlManager in interface I_CmsBackupDriverI_CmsBackupDriver.getSqlManager()
public void init(CmsDbContext dbc,
CmsConfigurationManager configurationManager,
List successiveDrivers,
CmsDriverManager driverManager)
I_CmsDriver
init in interface I_CmsDriverdbc - 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(String classname)
I_CmsBackupDriver
initSqlManager in interface I_CmsBackupDriverclassname - the classname of the SQL manager
I_CmsBackupDriver.initSqlManager(String)
public CmsBackupResource readBackupFile(CmsDbContext dbc,
int tagId,
String resourcePath)
throws CmsDataAccessException
I_CmsBackupDriver
readBackupFile in interface I_CmsBackupDriverdbc - 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 CmsBackupResource readBackupFileHeader(CmsDbContext dbc,
int tagId,
String resourcePath)
throws CmsDataAccessException
I_CmsBackupDriver
readBackupFileHeader in interface I_CmsBackupDriverdbc - the current database contexttagId - the tagId of the fileresourcePath - the path of the file to read
CmsDataAccessException - is something goes wrongI_CmsBackupDriver.readBackupFileHeader(org.opencms.db.CmsDbContext, int, java.lang.String)
public List readBackupFileHeaders(CmsDbContext dbc)
throws CmsDataAccessException
I_CmsBackupDriver.
readBackupFileHeaders in interface I_CmsBackupDriverdbc - the current database context
CmsDataAccessException - if something goes wrongI_CmsBackupDriver.readBackupFileHeaders(org.opencms.db.CmsDbContext)
public List readBackupFileHeaders(CmsDbContext dbc,
String resourcePath,
CmsUUID id)
throws CmsDataAccessException
I_CmsBackupDriverThe filter is (path OR id).
readBackupFileHeaders in interface I_CmsBackupDriverdbc - 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_CmsBackupDriverdbc - 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_CmsBackupDriverdbc - the current database contexttagId - the versionId of the project
CmsDataAccessException - is something goes wrongI_CmsBackupDriver.readBackupProject(org.opencms.db.CmsDbContext, int)
public List readBackupProjectResources(CmsDbContext dbc,
int tagId)
throws CmsDataAccessException
I_CmsBackupDriver
readBackupProjectResources in interface I_CmsBackupDriverdbc - the current database contexttagId - the version ID of the backup
CmsDataAccessException - if something goes wrongI_CmsBackupDriver.readBackupProjectResources(org.opencms.db.CmsDbContext, int)
public List readBackupProjects(CmsDbContext dbc)
throws CmsDataAccessException
I_CmsBackupDriver
readBackupProjects in interface I_CmsBackupDriverdbc - 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_CmsBackupDriverThis method is used during the deletion process of older backup data.
readBackupProjectTag in interface I_CmsBackupDriverdbc - 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 List readBackupProperties(CmsDbContext dbc,
CmsBackupResource resource)
throws CmsDataAccessException
I_CmsBackupDriver
readBackupProperties in interface I_CmsBackupDriverdbc - 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,
String name)
throws CmsDataAccessException
I_CmsBackupDriver
readBackupPropertyDefinition in interface I_CmsBackupDriverdbc - 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_CmsBackupDriverdbc - 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_CmsBackupDriverdbc - 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_CmsBackupDriverdbc - 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,
List properties,
CmsUUID backupId,
int tagId,
int versionId)
throws CmsDataAccessException
I_CmsBackupDriver
writeBackupProperties in interface I_CmsBackupDriverdbc - 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,
List properties,
int tagId,
long publishDate,
int maxVersions)
throws CmsDataAccessException
I_CmsBackupDriver
writeBackupResource in interface I_CmsBackupDriverdbc - 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)
public void writeBackupResourceContent(CmsDbContext dbc,
int projectId,
CmsResource resource,
CmsBackupResource backupResource)
throws CmsDataAccessException
I_CmsBackupDriver
writeBackupResourceContent in interface I_CmsBackupDriverdbc - the current database contextprojectId - the project to read fromresource - the resource (file header) to read the content frombackupResource - the backup resource to write the backup content to
CmsDataAccessException - if something goes wrongI_CmsBackupDriver.writeBackupResourceContent(org.opencms.db.CmsDbContext, int, org.opencms.file.CmsResource, org.opencms.file.CmsBackupResource)
protected void finalize()
throws Throwable
ThrowableObject.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 wrong
protected 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 | ||||||||||