com.application.areca.impl
Class AbstractFileSystemMedium

java.lang.Object
  extended by com.application.areca.AbstractMedium
      extended by com.application.areca.impl.AbstractFileSystemMedium
All Implemented Interfaces:
ArchiveMedium, IndicatorTypes, TargetActions, Duplicable
Direct Known Subclasses:
AbstractIncrementalFileSystemMedium

public abstract class AbstractFileSystemMedium
extends AbstractMedium
implements TargetActions, IndicatorTypes


Author:
Olivier PETRUCCI

Areca Build ID : 7299034069467778562

Field Summary
static boolean CHECK_DIRECTORY_CONSISTENCY
           
protected static java.lang.String COMMIT_MARKER_NAME
           
protected  CompressionArguments compressionArguments
          Compression arguments
These arguments may be interpreted specifically depending on the medium type.
protected static java.lang.String DATA_DIRECTORY_SUFFIX
          Suffix added to the archive name to create the data directory (containing the manifest and trace)
protected  EncryptionPolicy encryptionPolicy
          Encryption arguments
protected  FileSystemPolicy fileSystemPolicy
          Base storage policy
protected static java.lang.String MANIFEST_FILE
          Manifest name
protected static java.lang.String TARGET_BACKUP_FILE_PREFIX
          Name used for target configuration backup
protected static java.lang.String TARGET_BACKUP_FILE_SUFFIX
           
protected static FileTool tool
          File processing 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
AbstractFileSystemMedium()
           
 
Method Summary
protected  FileSystemDriver buildBaseDriver(boolean main)
           
protected  FileSystemDriver buildStorageDriver(java.io.File storageDir)
           
 boolean checkArchiveCompatibility(java.io.File archive)
          Checks that the archive provided as argument belongs to this medium
protected abstract  void checkFileSystemPolicy()
           
 ActionReport checkMediumState(int action)
          Valide diverses regles de gestion, notamment le fait que la gestion du cryptage est activee ou desactivee explicitement.
protected  void checkRepository()
          Look for uncommitted archives and destroy them
Also destroy temporary recovery locations
protected  void clearRelatedCaches()
           
 void commitMerge(ProcessContext context)
          On vide les caches lors de la fusion.
 IndicatorMap computeIndicators()
          Computes indicators on the archives stored by the medium.
protected  java.io.File computeMarkerFile(java.io.File archive)
           
protected  java.io.File computeMarkerFile(java.io.File archive, boolean ensureParentDir)
           
protected  void copyAttributes(java.lang.Object clone)
           
protected abstract  void deleteArchive(java.io.File archive)
           
 void deleteArchives(java.util.GregorianCalendar fromDate, ProcessContext context)
          Delete the archives that have been created between fromDate and toDate
 void destroyRepository()
          Destroy all archives.
protected  void destroyTemporaryFile(java.io.File archive)
           
 void doAfterDelete()
          Callback which is invoked after deletion
 void doBeforeDelete()
          Callback which is invoked before deletion
protected abstract  EntryArchiveData getArchiveData(java.lang.String entry, java.io.File archive)
          Retourne le status de l'entree, dans l'archive specifiee.
protected abstract  java.lang.String getArchiveExtension()
           
abstract  long getArchiveSize(java.io.File archive, boolean forceComputation)
           
 CompressionArguments getCompressionArguments()
           
 java.io.File getDataDirectory(java.io.File archive)
          Builds the data directory associated to the archive file provided as argument.
 java.lang.String getDisplayArchivePath()
           
 EncryptionPolicy getEncryptionPolicy()
           
 FileSystemPolicy getFileSystemPolicy()
           
 History getHistory()
          Return the history of all operations performed on the medium (merges, backups, ...)
 EntryArchiveData[] getHistory(java.lang.String entry)
          Return the entry's history
 java.io.File getLastArchive()
           
abstract  java.io.File getLastArchive(java.lang.String backupScheme, java.util.GregorianCalendar date)
          Retourne la derniere archive precedant une date donnee
 java.lang.String getManifestName()
           
 void install()
          Set up all necessary objects for the medium (for instance file system drivers)
protected  boolean isCommitted(java.io.File archive)
           
 boolean isPreBackupCheckUseful()
          Tells whether it is useful to perform a pre-check before backup.
protected abstract  boolean isWorkingDirectory(java.io.File f)
          Introduced in Areca v6.2 Tells whether the file is a working directory or not
abstract  java.io.File[] listArchives(java.util.GregorianCalendar fromDate, java.util.GregorianCalendar toDate)
           
protected  void markCommitted(java.io.File archive)
           
protected abstract  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 setCompressionArguments(CompressionArguments compressionArguments)
           
 void setEncryptionPolicy(EncryptionPolicy encryptionPolicy)
           
 void setFileSystemPolicy(FileSystemPolicy fileSystemPolicy)
           
 void setTarget(AbstractRecoveryTarget target, boolean revalidate)
          Set the medium's target
protected abstract  void storeFileInArchive(FileSystemRecoveryEntry entry, java.io.InputStream in, ProcessContext context)
          Stocke le fichier passe en argument dans l'archive (independemment des filtres, ou politique de stockage; il s'agit la d'une methode purement utilitaire; en pratique : zip ou repertoire)
protected  void storeTargetConfigBackup(ProcessContext context)
          Creates a copy of the target's XML configuration and stores it in the main backup directory.
 java.lang.String toString()
           
 
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
checkArchives, closeSimulation, commitBackup, getDescription, getEntries, getLogicalView, merge, open, recover, rollbackBackup, rollbackMerge, search, simulateEntryProcessing, store, supportsBackupScheme
 
Methods inherited from interface com.myJava.object.Duplicable
duplicate
 

Field Detail

CHECK_DIRECTORY_CONSISTENCY

public static final boolean CHECK_DIRECTORY_CONSISTENCY

COMMIT_MARKER_NAME

protected static final java.lang.String COMMIT_MARKER_NAME
See Also:
Constant Field Values

DATA_DIRECTORY_SUFFIX

protected static final java.lang.String DATA_DIRECTORY_SUFFIX
Suffix added to the archive name to create the data directory (containing the manifest and trace)

See Also:
Constant Field Values

MANIFEST_FILE

protected static final java.lang.String MANIFEST_FILE
Manifest name

See Also:
Constant Field Values

TARGET_BACKUP_FILE_PREFIX

protected static final java.lang.String TARGET_BACKUP_FILE_PREFIX
Name used for target configuration backup

See Also:
Constant Field Values

TARGET_BACKUP_FILE_SUFFIX

protected static final java.lang.String TARGET_BACKUP_FILE_SUFFIX
See Also:
Constant Field Values

tool

protected static final FileTool tool
File processing tool


encryptionPolicy

protected EncryptionPolicy encryptionPolicy
Encryption arguments


fileSystemPolicy

protected FileSystemPolicy fileSystemPolicy
Base storage policy


compressionArguments

protected CompressionArguments compressionArguments
Compression arguments
These arguments may be interpreted specifically depending on the medium type.

Constructor Detail

AbstractFileSystemMedium

public AbstractFileSystemMedium()
Method Detail

checkArchiveCompatibility

public boolean checkArchiveCompatibility(java.io.File archive)
Checks that the archive provided as argument belongs to this medium


checkMediumState

public ActionReport checkMediumState(int action)
Valide diverses regles de gestion, notamment le fait que la gestion du cryptage est activee ou desactivee explicitement.

Specified by:
checkMediumState in interface ArchiveMedium

commitMerge

public void commitMerge(ProcessContext context)
                 throws ApplicationException
On vide les caches lors de la fusion.
A optimiser en tenant compte de la date.

Specified by:
commitMerge in interface ArchiveMedium
Throws:
ApplicationException

computeIndicators

public IndicatorMap computeIndicators()
                               throws ApplicationException
Description copied from interface: ArchiveMedium
Computes indicators on the archives stored by the medium.

Specified by:
computeIndicators in interface ArchiveMedium
Throws:
ApplicationException

deleteArchives

public void deleteArchives(java.util.GregorianCalendar fromDate,
                           ProcessContext context)
                    throws ApplicationException
Description copied from interface: ArchiveMedium
Delete the archives that have been created between fromDate and toDate

Specified by:
deleteArchives in interface ArchiveMedium
Throws:
ApplicationException

destroyRepository

public void destroyRepository()
                       throws ApplicationException
Description copied from interface: ArchiveMedium
Destroy all archives.
Useful when the target is deleted.

Specified by:
destroyRepository in interface ArchiveMedium
Throws:
ApplicationException

doAfterDelete

public void doAfterDelete()
Description copied from interface: ArchiveMedium
Callback which is invoked after deletion

Specified by:
doAfterDelete in interface ArchiveMedium

doBeforeDelete

public void doBeforeDelete()
Description copied from interface: ArchiveMedium
Callback which is invoked before deletion

Specified by:
doBeforeDelete in interface ArchiveMedium

getArchiveSize

public abstract long getArchiveSize(java.io.File archive,
                                    boolean forceComputation)
                             throws ApplicationException
Throws:
ApplicationException

getCompressionArguments

public CompressionArguments getCompressionArguments()

getDataDirectory

public java.io.File getDataDirectory(java.io.File archive)
Builds the data directory associated to the archive file provided as argument.


getDisplayArchivePath

public java.lang.String getDisplayArchivePath()

getEncryptionPolicy

public EncryptionPolicy getEncryptionPolicy()

getFileSystemPolicy

public FileSystemPolicy getFileSystemPolicy()

getHistory

public History getHistory()
Description copied from interface: ArchiveMedium
Return the history of all operations performed on the medium (merges, backups, ...)

Specified by:
getHistory in interface ArchiveMedium

getHistory

public EntryArchiveData[] getHistory(java.lang.String entry)
                              throws ApplicationException
Description copied from interface: ArchiveMedium
Return the entry's history

Specified by:
getHistory in interface ArchiveMedium
Throws:
ApplicationException

getLastArchive

public java.io.File getLastArchive()
                            throws ApplicationException
Throws:
ApplicationException

getLastArchive

public abstract java.io.File getLastArchive(java.lang.String backupScheme,
                                            java.util.GregorianCalendar date)
                                     throws ApplicationException
Retourne la derniere archive precedant une date donnee

Throws:
ApplicationException

getManifestName

public java.lang.String getManifestName()

install

public void install()
             throws ApplicationException
Description copied from interface: ArchiveMedium
Set up all necessary objects for the medium (for instance file system drivers)

Specified by:
install in interface ArchiveMedium
Overrides:
install in class AbstractMedium
Throws:
ApplicationException

isPreBackupCheckUseful

public boolean isPreBackupCheckUseful()
Description copied from interface: ArchiveMedium
Tells whether it is useful to perform a pre-check before backup.
It can be used, for instance, to check whether at least one file has been modified.

Specified by:
isPreBackupCheckUseful in interface ArchiveMedium

listArchives

public abstract java.io.File[] listArchives(java.util.GregorianCalendar fromDate,
                                            java.util.GregorianCalendar toDate)

setCompressionArguments

public void setCompressionArguments(CompressionArguments compressionArguments)

setEncryptionPolicy

public void setEncryptionPolicy(EncryptionPolicy encryptionPolicy)

setFileSystemPolicy

public void setFileSystemPolicy(FileSystemPolicy fileSystemPolicy)

setTarget

public void setTarget(AbstractRecoveryTarget target,
                      boolean revalidate)
Description copied from interface: ArchiveMedium
Set the medium's target

Specified by:
setTarget in interface ArchiveMedium

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

buildBaseDriver

protected FileSystemDriver buildBaseDriver(boolean main)
                                    throws ApplicationException
Throws:
ApplicationException

buildStorageDriver

protected FileSystemDriver buildStorageDriver(java.io.File storageDir)
                                       throws ApplicationException
Throws:
ApplicationException

checkFileSystemPolicy

protected abstract void checkFileSystemPolicy()

checkRepository

protected void checkRepository()
Look for uncommitted archives and destroy them
Also destroy temporary recovery locations


clearRelatedCaches

protected void clearRelatedCaches()

computeMarkerFile

protected java.io.File computeMarkerFile(java.io.File archive)

computeMarkerFile

protected java.io.File computeMarkerFile(java.io.File archive,
                                         boolean ensureParentDir)
                                  throws java.io.IOException
Throws:
java.io.IOException

copyAttributes

protected void copyAttributes(java.lang.Object clone)
Overrides:
copyAttributes in class AbstractMedium

deleteArchive

protected abstract void deleteArchive(java.io.File archive)
                               throws java.io.IOException
Throws:
java.io.IOException

destroyTemporaryFile

protected void destroyTemporaryFile(java.io.File archive)

getArchiveData

protected abstract EntryArchiveData getArchiveData(java.lang.String entry,
                                                   java.io.File archive)
                                            throws ApplicationException
Retourne le status de l'entree, dans l'archive specifiee.

Parameters:
entry -
archive -
Returns:
Throws:
ApplicationException

getArchiveExtension

protected abstract java.lang.String getArchiveExtension()

isCommitted

protected boolean isCommitted(java.io.File archive)

isWorkingDirectory

protected abstract boolean isWorkingDirectory(java.io.File f)
Introduced in Areca v6.2 Tells whether the file is a working directory or not


markCommitted

protected void markCommitted(java.io.File archive)
                      throws java.io.IOException
Throws:
java.io.IOException

matchArchiveName

protected abstract 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


storeFileInArchive

protected abstract void storeFileInArchive(FileSystemRecoveryEntry entry,
                                           java.io.InputStream in,
                                           ProcessContext context)
                                    throws java.io.IOException,
                                           ApplicationException,
                                           TaskCancelledException
Stocke le fichier passe en argument dans l'archive (independemment des filtres, ou politique de stockage; il s'agit la d'une methode purement utilitaire; en pratique : zip ou repertoire)

Throws:
java.io.IOException
ApplicationException
TaskCancelledException

storeTargetConfigBackup

protected void storeTargetConfigBackup(ProcessContext context)
                                throws ApplicationException
Creates a copy of the target's XML configuration and stores it in the main backup directory.
This copy can be used later - in case of computer crash.

Throws:
ApplicationException