|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface I_CmsBackupDriver
Definitions of all required backup driver methods.
A backup driver is a driver to write projects, resources and properties of resources optionally to a second set of backup database tables while resources get published. A unique backup tag ID is used to identify a set of resource that were saved during one backup process.
| Field Summary | |
|---|---|
static int |
DRIVER_TYPE_ID
The type ID to identify backup driver implementations. |
| 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 res,
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 context,
List existingBackups,
int maxVersions)
Deletes backup versions of a resource. |
void |
destroy()
Destroys this driver. |
CmsSqlManager |
getSqlManager()
Returns the SqlManager of this driver. |
CmsSqlManager |
initSqlManager(String classname)
Initializes the SQL manager for this driver. |
CmsBackupResource |
readBackupFile(CmsDbContext dbc,
int tagId,
String resourcePath)
Reads a backup file including 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. |
| Field Detail |
|---|
static final int DRIVER_TYPE_ID
| Method Detail |
|---|
CmsPropertyDefinition createBackupPropertyDefinition(CmsDbContext dbc,
String name)
throws CmsDataAccessException
dbc - the current database contextname - the name of the propertydefinitions to overwrite
CmsDataAccessException - if something goes wrong
CmsBackupResource createBackupResource(ResultSet res,
boolean hasContent)
throws SQLException
res - 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 set
void deleteBackup(CmsDbContext dbc,
CmsBackupResource res,
int tag,
int versions)
throws CmsDataAccessException
dbc - the current database contextres - the backup resourcetag - the project tag dateversions - the deletion version
CmsDataAccessException - if something goes wrong
void deleteBackupPropertyDefinition(CmsDbContext dbc,
CmsPropertyDefinition metadef)
throws CmsDataAccessException
dbc - the current database contextmetadef - the propertydefinitions to be deleted
CmsDataAccessException - if something goes wrong
void deleteBackups(CmsDbContext context,
List existingBackups,
int maxVersions)
throws CmsDataAccessException
Deletes the m-n oldest backup versions, if m is the number of backup versions, and n the number of max. allowed backup versions.
context - 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 wrong
void destroy()
throws Throwable
Throwable - if something goes wrongCmsSqlManager getSqlManager()
CmsSqlManager initSqlManager(String classname)
classname - the classname of the SQL manager
CmsBackupResource readBackupFile(CmsDbContext dbc,
int tagId,
String resourcePath)
throws CmsDataAccessException
dbc - the current database contexttagId - the desired tag ID of the fileresourcePath - the path of the file to read
CmsDataAccessException - if something goes wrong
List readBackupFileHeaders(CmsDbContext dbc)
throws CmsDataAccessException
.
dbc - the current database context
CmsDataAccessException - if something goes wrong
List readBackupFileHeaders(CmsDbContext dbc,
String resourcePath,
CmsUUID id)
throws CmsDataAccessException
The filter is (path OR id).
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 wrong
int readBackupMaxVersion(CmsDbContext dbc,
CmsUUID resourceId)
throws CmsDataAccessException
dbc - the current database contextresourceId - the resource ID of the resource
CmsDataAccessException - if something goes wrong
CmsBackupProject readBackupProject(CmsDbContext dbc,
int tagId)
throws CmsDataAccessException
dbc - the current database contexttagId - the versionId of the project
CmsDataAccessException - is something goes wrong
List readBackupProjectResources(CmsDbContext dbc,
int tagId)
throws CmsDataAccessException
dbc - the current database contexttagId - the version ID of the backup
CmsDataAccessException - if something goes wrong
List readBackupProjects(CmsDbContext dbc)
throws CmsDataAccessException
dbc - the current database context
CmsBackupProject objects
with all projects from history.
CmsDataAccessException - if an error occurs
int readBackupProjectTag(CmsDbContext dbc,
long maxdate)
throws CmsDataAccessException
This method is used during the deletion process of older backup data.
dbc - the current database contextmaxdate - the date to compare the backup projects with
CmsDataAccessException - if something goes wrong
List readBackupProperties(CmsDbContext dbc,
CmsBackupResource resource)
throws CmsDataAccessException
dbc - the current database contextresource - the resource to read the properties from
CmsDataAccessException - if something goes wrong
CmsPropertyDefinition readBackupPropertyDefinition(CmsDbContext dbc,
String name)
throws CmsDataAccessException
dbc - the current database contextname - the name of the propertydefinition to read
CmsDataAccessException - if something goes wrong
int readMaxTagId(CmsDbContext dbc,
CmsResource resource)
throws CmsDataAccessException
dbc - the current database contextresource - the Cms resource
CmsDataAccessException - if something goes wrongint readNextBackupTagId(CmsDbContext dbc)
dbc - the current database context
void writeBackupProject(CmsDbContext dbc,
int tagId,
long publishDate)
throws CmsDataAccessException
dbc - the current database contexttagId - the version ID of the backuppublishDate - long timestamp when the current project was published.
CmsDataAccessException - if something goes wrong
void writeBackupProperties(CmsDbContext dbc,
CmsResource resource,
List properties,
CmsUUID backupId,
int tagId,
int versionId)
throws CmsDataAccessException
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 wrong
void writeBackupResource(CmsDbContext dbc,
CmsResource resource,
List properties,
int tagId,
long publishDate,
int maxVersions)
throws CmsDataAccessException
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 wrong
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||