|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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,
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 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,
java.util.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(java.lang.String classname)
Initializes the SQL manager for this driver. |
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. |
Field Detail |
public static final int DRIVER_TYPE_ID
Method Detail |
public CmsPropertyDefinition createBackupPropertyDefinition(CmsDbContext dbc, java.lang.String name) throws CmsDataAccessException
dbc
- the current database contextname
- the name of the propertydefinitions to overwrite
CmsDataAccessException
- if something goes wrongpublic CmsBackupResource createBackupResource(java.sql.ResultSet res, boolean hasContent) throws java.sql.SQLException
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 setpublic 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 wrongpublic void deleteBackupPropertyDefinition(CmsDbContext dbc, CmsPropertyDefinition metadef) throws CmsDataAccessException
dbc
- the current database contextmetadef
- the propertydefinitions to be deleted
CmsDataAccessException
- if something goes wrongpublic void deleteBackups(CmsDbContext context, java.util.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 wrongpublic void destroy() throws java.lang.Throwable
java.lang.Throwable
- if something goes wrongpublic CmsSqlManager getSqlManager()
public CmsSqlManager initSqlManager(java.lang.String classname)
classname
- the classname of the SQL manager
public CmsBackupResource readBackupFile(CmsDbContext dbc, int tagId, java.lang.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 wrongpublic java.util.List readBackupFileHeaders(CmsDbContext dbc) throws CmsDataAccessException
.
dbc
- the current database context
CmsDataAccessException
- if something goes wrongpublic java.util.List readBackupFileHeaders(CmsDbContext dbc, java.lang.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 wrongpublic int readBackupMaxVersion(CmsDbContext dbc, CmsUUID resourceId) throws CmsDataAccessException
dbc
- the current database contextresourceId
- the resource ID of the resource
CmsDataAccessException
- if something goes wrongpublic CmsBackupProject readBackupProject(CmsDbContext dbc, int tagId) throws CmsDataAccessException
dbc
- the current database contexttagId
- the versionId of the project
CmsDataAccessException
- is something goes wrongpublic java.util.List readBackupProjectResources(CmsDbContext dbc, int tagId) throws CmsDataAccessException
dbc
- the current database contexttagId
- the version ID of the backup
CmsDataAccessException
- if something goes wrongpublic java.util.List readBackupProjects(CmsDbContext dbc) throws CmsDataAccessException
dbc
- the current database context
CmsBackupProject
objects
with all projects from history.
CmsDataAccessException
- if an error occurspublic 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 wrongpublic java.util.List readBackupProperties(CmsDbContext dbc, CmsBackupResource resource) throws CmsDataAccessException
dbc
- the current database contextresource
- the resource to read the properties from
CmsDataAccessException
- if something goes wrongpublic CmsPropertyDefinition readBackupPropertyDefinition(CmsDbContext dbc, java.lang.String name) throws CmsDataAccessException
dbc
- the current database contextname
- the name of the propertydefinition to read
CmsDataAccessException
- if something goes wrongpublic int readMaxTagId(CmsDbContext dbc, CmsResource resource) throws CmsDataAccessException
dbc
- the current database contextresource
- the Cms resource
CmsDataAccessException
- if something goes wrongpublic int readNextBackupTagId(CmsDbContext dbc)
dbc
- the current database context
public 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 wrongpublic void writeBackupProperties(CmsDbContext dbc, CmsResource resource, java.util.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 wrongpublic void writeBackupResource(CmsDbContext dbc, CmsResource resource, java.util.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 |