|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.application.areca.AbstractMedium
com.application.areca.impl.AbstractFileSystemMedium
com.application.areca.impl.AbstractIncrementalFileSystemMedium
public abstract class AbstractIncrementalFileSystemMedium
Medium that implements incremental storage
Nested Class Summary | |
---|---|
class |
AbstractIncrementalFileSystemMedium.CheckHash
|
Field Summary | |
---|---|
protected static java.lang.String |
CHECK_DESTINATION
Temporary directory used during archive check |
protected static java.lang.String |
CONTENT_FILE
Content filename |
protected static boolean |
DEBUG_MODE
|
protected ArchiveHandler |
handler
Handler for archive processing |
protected static java.lang.String |
HASH_FILE
hash filename |
protected boolean |
imageBackups
Tells whether many archives shall be created on just one single archive |
protected static java.lang.String |
METADATA_FILE
Metadata filename |
protected static java.lang.String[] |
RESERVED_NAMES
Filenames reserved by Areca |
protected static java.lang.String |
TMP_MERGE_LOCATION
Temporary merge location |
protected static java.lang.String |
TRACE_FILE
Trace filename |
protected boolean |
trackPermissions
Tells whether file permissions shall be tracked or not |
Fields inherited from class com.application.areca.impl.AbstractFileSystemMedium |
---|
CHECK_DIRECTORY_CONSISTENCY, COMMIT_MARKER_NAME, compressionArguments, DATA_DIRECTORY_SUFFIX, encryptionPolicy, fileSystemPolicy, MANIFEST_FILE, TARGET_BACKUP_FILE_PREFIX, TARGET_BACKUP_FILE_SUFFIX, tool |
Fields inherited from class com.application.areca.AbstractMedium |
---|
history, HISTORY_NAME, target |
Fields inherited from interface com.application.areca.TargetActions |
---|
ACTION_ALL, ACTION_BACKUP, ACTION_DESCRIBE, ACTION_INDICATORS, ACTION_MERGE_OR_DELETE, ACTION_RECOVER, ACTION_SIMULATE |
Fields inherited from interface com.application.areca.indicator.IndicatorTypes |
---|
N_APS, N_NOA, N_NOF, N_PSR, N_SFS, N_SOH, N_SRR, N_SWH, T_APS, T_NOA, T_NOF, T_PSR, T_SFS, T_SOH, T_SRR, T_SWH |
Constructor Summary | |
---|---|
AbstractIncrementalFileSystemMedium()
|
Method Summary | |
---|---|
protected void |
buildArchive(ProcessContext context)
Build the archive |
protected java.lang.String[] |
buildAtomicEntrySet(java.lang.String[] entries,
java.io.File traceFile,
int maxSetSize,
ProcessContext context)
Build an explicit set of entries (files) to recover. |
Manifest |
buildDefaultBackupManifest()
|
Manifest |
buildDefaultMergeManifest(java.io.File[] recoveredArchives,
java.util.GregorianCalendar fromDate,
java.util.GregorianCalendar toDate)
|
protected abstract void |
buildMergedArchiveFromDirectory(ProcessContext context)
|
void |
checkArchives(java.lang.Object destination,
boolean checkOnlyArchiveContent,
java.util.GregorianCalendar date,
ProcessContext context)
Check the archive denoted by the date passed as argument. |
protected void |
checkFileSystemPolicy()
Check that we do not use a reserved name as archive name |
abstract void |
cleanLocalCopies(java.util.List copies,
ProcessContext context)
|
void |
cleanMerge(ProcessContext context)
|
protected void |
cleanUnwantedFiles(java.io.File targetFile,
java.io.File traceFile,
boolean cancelSensitive,
ProcessContext context)
Delete unwanted files (ie files that have been recovered but that do not appear in the trace file) |
protected abstract void |
closeArchive(ProcessContext context)
|
void |
closeSimulation(ProcessContext context)
Closes the simulation and returns all unprocessed entries (ie entries which have been deleted). |
void |
commitBackup(ProcessContext context)
Close the archive |
void |
commitMerge(ProcessContext context)
On vide les caches lors de la fusion. |
abstract void |
completeLocalCopyCleaning(java.io.File copy,
ProcessContext context)
|
protected java.lang.String |
computeArchiveName(java.util.GregorianCalendar date)
Build an archive name |
protected java.lang.String |
computeArchivePath(java.util.GregorianCalendar date)
Build a full archive path |
protected java.lang.String |
computeFinalArchivePath()
|
protected abstract void |
computeMergeDirectories(ProcessContext context)
|
protected void |
convertArchiveToFinal(ProcessContext context)
|
protected void |
copyAttributes(java.lang.Object clone)
|
protected void |
deleteArchive(java.io.File archive)
Deletes the archive - WHETHER IT IS COMMITTED OR NOT |
void |
doAndRetry(IOTask rn,
java.lang.String message)
|
protected java.io.File |
duplicateMetadataFile(java.io.File source,
ProcessContext context)
It is sometime necessary to work on a copy of metadata files. |
abstract java.io.File[] |
ensureLocalCopy(java.io.File[] archivesToProcess,
boolean overrideRecoveredFiles,
java.io.File destination,
RecoveryFilterMap filtersByArchive,
ProcessContext context)
Ensure that the stored files are present on the local disk. |
protected EntryArchiveData |
getArchiveData(java.lang.String entry,
java.io.File archive)
Retourne le status de l'entree, dans l'archive specifiee. |
long |
getArchiveSize(java.io.File archive,
boolean forceComputation)
Returns the length of the archive passed as argument if it can be computed. |
java.lang.String |
getContentFileName()
Return the final content file name |
java.util.List |
getEntries(AggregatedViewContext context,
java.lang.String root,
java.util.GregorianCalendar date)
Return the content of the archive matching the date passed as argument |
ArchiveHandler |
getHandler()
|
java.lang.String |
getHashFileName()
Return the final hash file name |
java.io.File |
getLastArchive(java.lang.String backupScheme,
java.util.GregorianCalendar date)
Returns the last archive for a given date. |
java.util.List |
getLogicalView(AggregatedViewContext context,
java.lang.String root,
boolean aggregated)
Return a "logical view" of the target's content |
abstract int |
getMaxRetries()
|
java.lang.String |
getMetaDataFileName()
Return the final metadata file name |
java.lang.String |
getTraceFileName()
Return the final trace file name |
void |
initMergeManifest(java.io.File[] recoveredArchives,
java.util.GregorianCalendar fromDate,
java.util.GregorianCalendar toDate,
Manifest manifest)
|
void |
install()
Set up all necessary objects for the medium (for instance file system drivers) |
boolean |
isOverwrite()
|
boolean |
isTrackPermissions()
|
protected boolean |
isWorkingDirectory(java.io.File f)
Introduced in Areca v6.2 Tells whether the file is a working directory or not |
java.io.File[] |
listArchives(java.util.GregorianCalendar fromDate,
java.util.GregorianCalendar toDate)
Lists the medium's archives |
void |
logRecoveryStep(RecoveryFilterMap filtersByArchive,
FileFilterList filters,
java.io.File archive,
ProcessContext context)
Log recovery informations |
protected boolean |
matchArchiveName(java.io.File f)
Introduced in Areca v6.0 Caution : will return 'false' for archives that have been built with previous versions of Areca |
void |
merge(java.util.GregorianCalendar fromDate,
java.util.GregorianCalendar toDate,
Manifest mfToInsert,
boolean keepDeletedEntries,
ProcessContext context)
Merge the archives that have been created between fromDate and toDate. |
void |
open(Manifest manifest,
ProcessContext context,
java.lang.String backupScheme)
Prepares the backup |
protected abstract void |
prepareContext(ProcessContext context)
|
void |
recover(java.lang.Object destination,
java.lang.String[] filter,
java.util.GregorianCalendar date,
boolean recoverDeletedEntries,
boolean checkRecoveredFiles,
ProcessContext context)
Recovers the stored data |
protected void |
recover(java.lang.Object destination,
java.lang.String[] argFilter,
int minimumArchiveNumber,
java.util.GregorianCalendar fromDate,
java.util.GregorianCalendar toDate,
java.io.File traceFile,
short mode,
boolean recoverDeletedEntries,
boolean checkRecoveredFiles,
ProcessContext context)
Recovers the files at the requested recovery location, according to the recovery dates passed as argument. |
protected abstract void |
registerUnstoredFile(FileSystemRecoveryEntry entry,
ProcessContext context)
|
abstract boolean |
retrySupported()
|
void |
rollbackBackup(ProcessContext context)
Cancel the backup |
void |
rollbackMerge(ProcessContext context)
Cancel the "merge" |
TargetSearchResult |
search(SearchCriteria criteria)
Searches entries within the archives |
void |
setHandler(ArchiveHandler handler)
|
void |
setOverwrite(boolean overwrite)
|
void |
setTrackPermissions(boolean trackPermissions)
|
void |
simulateEntryProcessing(RecoveryEntry entry,
boolean haltOnFirstDifference,
ProcessContext context)
Simulates the processing of the entry passed as argument. |
void |
store(RecoveryEntry entry,
ProcessContext context)
Stores an entry |
void |
storeManifest(ProcessContext context)
|
boolean |
supportsBackupScheme(java.lang.String backupScheme)
Tells whether the backup scheme passed as argument is supported by the medium or not |
Methods inherited from class com.application.areca.AbstractMedium |
---|
equals, getHistoryName, getTarget, hashCode, processEntryArchiveData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.application.areca.ArchiveMedium |
---|
getDescription |
Methods inherited from interface com.myJava.object.Duplicable |
---|
duplicate |
Field Detail |
---|
protected static final boolean DEBUG_MODE
protected static final java.lang.String TRACE_FILE
protected static final java.lang.String CONTENT_FILE
protected static final java.lang.String HASH_FILE
protected static final java.lang.String METADATA_FILE
protected static final java.lang.String TMP_MERGE_LOCATION
protected static final java.lang.String CHECK_DESTINATION
protected static final java.lang.String[] RESERVED_NAMES
protected boolean trackPermissions
protected boolean imageBackups
protected ArchiveHandler handler
Constructor Detail |
---|
public AbstractIncrementalFileSystemMedium()
Method Detail |
---|
public Manifest buildDefaultBackupManifest() throws ApplicationException
ApplicationException
public Manifest buildDefaultMergeManifest(java.io.File[] recoveredArchives, java.util.GregorianCalendar fromDate, java.util.GregorianCalendar toDate) throws ApplicationException
ApplicationException
public void checkArchives(java.lang.Object destination, boolean checkOnlyArchiveContent, java.util.GregorianCalendar date, ProcessContext context) throws ApplicationException, TaskCancelledException
ProcessContext.getUncheckedRecoveredFiles()
and
ProcessContext.getInvalidRecoveredFiles()
).
checkArchives
in interface ArchiveMedium
ApplicationException
TaskCancelledException
public abstract void cleanLocalCopies(java.util.List copies, ProcessContext context) throws java.io.IOException, ApplicationException
java.io.IOException
ApplicationException
public void cleanMerge(ProcessContext context) throws java.io.IOException
java.io.IOException
public void closeSimulation(ProcessContext context) throws ApplicationException
ArchiveMedium
closeSimulation
in interface ArchiveMedium
ApplicationException
public void commitBackup(ProcessContext context) throws ApplicationException
commitBackup
in interface ArchiveMedium
ApplicationException
public void commitMerge(ProcessContext context) throws ApplicationException
AbstractFileSystemMedium
commitMerge
in interface ArchiveMedium
commitMerge
in class AbstractFileSystemMedium
ApplicationException
public abstract void completeLocalCopyCleaning(java.io.File copy, ProcessContext context) throws java.io.IOException, ApplicationException
java.io.IOException
ApplicationException
public abstract java.io.File[] ensureLocalCopy(java.io.File[] archivesToProcess, boolean overrideRecoveredFiles, java.io.File destination, RecoveryFilterMap filtersByArchive, ProcessContext context) throws java.io.IOException, ApplicationException, TaskCancelledException
java.io.IOException
ApplicationException
TaskCancelledException
public long getArchiveSize(java.io.File archive, boolean forceComputation) throws ApplicationException
getArchiveSize
in class AbstractFileSystemMedium
ApplicationException
public java.lang.String getContentFileName()
public java.util.List getEntries(AggregatedViewContext context, java.lang.String root, java.util.GregorianCalendar date) throws ApplicationException
ArchiveMedium
getEntries
in interface ArchiveMedium
ApplicationException
public ArchiveHandler getHandler()
public java.lang.String getHashFileName()
public java.io.File getLastArchive(java.lang.String backupScheme, java.util.GregorianCalendar date) throws ApplicationException
getLastArchive
in class AbstractFileSystemMedium
ApplicationException
public java.util.List getLogicalView(AggregatedViewContext context, java.lang.String root, boolean aggregated) throws ApplicationException
ArchiveMedium
getLogicalView
in interface ArchiveMedium
ApplicationException
public java.lang.String getMetaDataFileName()
public java.lang.String getTraceFileName()
public void initMergeManifest(java.io.File[] recoveredArchives, java.util.GregorianCalendar fromDate, java.util.GregorianCalendar toDate, Manifest manifest) throws ApplicationException
ApplicationException
public void install() throws ApplicationException
ArchiveMedium
install
in interface ArchiveMedium
install
in class AbstractFileSystemMedium
ApplicationException
public boolean isOverwrite()
public boolean isTrackPermissions()
public java.io.File[] listArchives(java.util.GregorianCalendar fromDate, java.util.GregorianCalendar toDate)
listArchives
in class AbstractFileSystemMedium
public void logRecoveryStep(RecoveryFilterMap filtersByArchive, FileFilterList filters, java.io.File archive, ProcessContext context) throws TaskCancelledException
TaskCancelledException
public void merge(java.util.GregorianCalendar fromDate, java.util.GregorianCalendar toDate, Manifest mfToInsert, boolean keepDeletedEntries, ProcessContext context) throws ApplicationException
ArchiveMedium
merge
in interface ArchiveMedium
ApplicationException
public void open(Manifest manifest, ProcessContext context, java.lang.String backupScheme) throws ApplicationException
open
in interface ArchiveMedium
ApplicationException
public void recover(java.lang.Object destination, java.lang.String[] filter, java.util.GregorianCalendar date, boolean recoverDeletedEntries, boolean checkRecoveredFiles, ProcessContext context) throws ApplicationException, TaskCancelledException
recover
in interface ArchiveMedium
ApplicationException
TaskCancelledException
public void rollbackBackup(ProcessContext context) throws ApplicationException
ArchiveMedium
rollbackBackup
in interface ArchiveMedium
ApplicationException
public void rollbackMerge(ProcessContext context) throws ApplicationException
ArchiveMedium
rollbackMerge
in interface ArchiveMedium
ApplicationException
public TargetSearchResult search(SearchCriteria criteria) throws ApplicationException
ArchiveMedium
search
in interface ArchiveMedium
ApplicationException
public void setHandler(ArchiveHandler handler)
public void setOverwrite(boolean overwrite)
public void setTrackPermissions(boolean trackPermissions)
public void simulateEntryProcessing(RecoveryEntry entry, boolean haltOnFirstDifference, ProcessContext context) throws ApplicationException
ArchiveMedium
simulateEntryProcessing
in interface ArchiveMedium
ApplicationException
public void store(RecoveryEntry entry, ProcessContext context) throws StoreException, ApplicationException, TaskCancelledException
store
in interface ArchiveMedium
StoreException
ApplicationException
TaskCancelledException
public void doAndRetry(IOTask rn, java.lang.String message) throws java.io.IOException, TaskCancelledException, ApplicationException
java.io.IOException
TaskCancelledException
ApplicationException
public abstract boolean retrySupported()
public abstract int getMaxRetries()
public void storeManifest(ProcessContext context) throws ApplicationException
ApplicationException
public boolean supportsBackupScheme(java.lang.String backupScheme)
ArchiveMedium
supportsBackupScheme
in interface ArchiveMedium
protected void buildArchive(ProcessContext context) throws java.io.IOException, ApplicationException
java.io.IOException
ApplicationException
protected java.lang.String[] buildAtomicEntrySet(java.lang.String[] entries, java.io.File traceFile, int maxSetSize, ProcessContext context) throws java.io.IOException, FileMetaDataSerializationException, TaskCancelledException
java.io.IOException
FileMetaDataSerializationException
TaskCancelledException
protected abstract void buildMergedArchiveFromDirectory(ProcessContext context) throws ApplicationException
ApplicationException
protected void checkFileSystemPolicy()
checkFileSystemPolicy
in class AbstractFileSystemMedium
protected void cleanUnwantedFiles(java.io.File targetFile, java.io.File traceFile, boolean cancelSensitive, ProcessContext context) throws java.io.IOException, TaskCancelledException, FileMetaDataSerializationException
java.io.IOException
TaskCancelledException
FileMetaDataSerializationException
protected abstract void closeArchive(ProcessContext context) throws java.io.IOException, ApplicationException
java.io.IOException
ApplicationException
protected java.lang.String computeArchiveName(java.util.GregorianCalendar date)
protected java.lang.String computeArchivePath(java.util.GregorianCalendar date)
protected java.lang.String computeFinalArchivePath()
protected abstract void computeMergeDirectories(ProcessContext context) throws ApplicationException
ApplicationException
protected void convertArchiveToFinal(ProcessContext context) throws java.io.IOException, ApplicationException
java.io.IOException
ApplicationException
protected void copyAttributes(java.lang.Object clone)
copyAttributes
in class AbstractFileSystemMedium
protected void deleteArchive(java.io.File archive) throws java.io.IOException
deleteArchive
in class AbstractFileSystemMedium
java.io.IOException
protected EntryArchiveData getArchiveData(java.lang.String entry, java.io.File archive) throws ApplicationException
AbstractFileSystemMedium
getArchiveData
in class AbstractFileSystemMedium
ApplicationException
protected boolean isWorkingDirectory(java.io.File f)
AbstractFileSystemMedium
isWorkingDirectory
in class AbstractFileSystemMedium
protected boolean matchArchiveName(java.io.File f)
AbstractFileSystemMedium
matchArchiveName
in class AbstractFileSystemMedium
protected abstract void prepareContext(ProcessContext context) throws java.io.IOException
java.io.IOException
protected void recover(java.lang.Object destination, java.lang.String[] argFilter, int minimumArchiveNumber, java.util.GregorianCalendar fromDate, java.util.GregorianCalendar toDate, java.io.File traceFile, short mode, boolean recoverDeletedEntries, boolean checkRecoveredFiles, ProcessContext context) throws ApplicationException, TaskCancelledException
minimumArchiveNumber
archives to recover
ApplicationException
TaskCancelledException
protected abstract void registerUnstoredFile(FileSystemRecoveryEntry entry, ProcessContext context) throws java.io.IOException
java.io.IOException
protected java.io.File duplicateMetadataFile(java.io.File source, ProcessContext context)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |