com.application.areca.impl.handler
Interface ArchiveHandler

All Superinterfaces:
Duplicable
All Known Implementing Classes:
AbstractArchiveHandler, DefaultArchiveHandler, DeltaArchiveHandler

public interface ArchiveHandler
extends Duplicable

Base interface for archive handlers.
Handles :
- Merge actions
- Whole archive recovery actions
- Backup actions

Author:
Olivier PETRUCCI

Areca Build ID : 7299034069467778562

Field Summary
static short MODE_MERGE
           
static short MODE_RECOVER
           
 
Method Summary
 void archiveDeleted(java.io.File archive)
          Callback after archive deletion
 boolean autonomousArchives()
          Tells whether the handler builds autonomous archives
 void close(ProcessContext context)
          Close the handler
 RecoveryFilterMap dispatchEntries(java.io.File[] archives, java.lang.String[] entriesToRecover)
          Return, for the array of entries passed as argument, the archives that will have to be recovered among the archive list passed as argument.
 java.io.File getContentFile(java.io.File archive)
          Ugly but no time to do better
 AbstractIncrementalFileSystemMedium getMedium()
          Medium to which the handler is associated
 void init(ProcessContext context)
          Init the handler
 void recoverRawData(java.io.File[] archivesToRecover, RecoveryFilterMap filtersByArchive, short mode, ProcessContext context)
          Restore the data
 void setMedium(AbstractIncrementalFileSystemMedium medium)
          Medium to which the handler is associated
 void store(FileSystemRecoveryEntry entry, java.io.InputStream in, java.io.OutputStream out, ProcessContext context)
          The outputStream is provided by the Medium itself.
 boolean supportsImageBackup()
          Tells whether the handler supports image backups or not
(some handlers are inherently incompatible with image backups)
 
Methods inherited from interface com.myJava.object.Duplicable
duplicate
 

Field Detail

MODE_MERGE

static final short MODE_MERGE
See Also:
Constant Field Values

MODE_RECOVER

static final short MODE_RECOVER
See Also:
Constant Field Values
Method Detail

getMedium

AbstractIncrementalFileSystemMedium getMedium()
Medium to which the handler is associated


setMedium

void setMedium(AbstractIncrementalFileSystemMedium medium)
Medium to which the handler is associated


store

void store(FileSystemRecoveryEntry entry,
           java.io.InputStream in,
           java.io.OutputStream out,
           ProcessContext context)
           throws ApplicationException,
                  java.io.IOException,
                  TaskCancelledException
The outputStream is provided by the Medium itself. The inputStream is provided by the target.
Reads the inputStream and writes the data in the outputStream, according to the handler's strategy. (standard storage mode, delta storage, ...)

Throws:
ApplicationException
java.io.IOException
TaskCancelledException

recoverRawData

void recoverRawData(java.io.File[] archivesToRecover,
                    RecoveryFilterMap filtersByArchive,
                    short mode,
                    ProcessContext context)
                    throws java.io.IOException,
                           ApplicationException,
                           TaskCancelledException
Restore the data

Throws:
java.io.IOException
ApplicationException
TaskCancelledException

dispatchEntries

RecoveryFilterMap dispatchEntries(java.io.File[] archives,
                                  java.lang.String[] entriesToRecover)
                                  throws ApplicationException,
                                         java.io.IOException
Return, for the array of entries passed as argument, the archives that will have to be recovered among the archive list passed as argument.
The returned map contains entries indexed by archive file.
entriesToRecover MUST be sorted

Throws:
ApplicationException
java.io.IOException

init

void init(ProcessContext context)
          throws java.io.IOException
Init the handler

Throws:
java.io.IOException

close

void close(ProcessContext context)
           throws java.io.IOException,
                  ApplicationException
Close the handler

Throws:
java.io.IOException
ApplicationException

archiveDeleted

void archiveDeleted(java.io.File archive)
                    throws java.io.IOException
Callback after archive deletion

Throws:
java.io.IOException

supportsImageBackup

boolean supportsImageBackup()
Tells whether the handler supports image backups or not
(some handlers are inherently incompatible with image backups)


autonomousArchives

boolean autonomousArchives()
Tells whether the handler builds autonomous archives


getContentFile

java.io.File getContentFile(java.io.File archive)
Ugly but no time to do better