com.application.areca
Class AbstractRecoveryTarget

java.lang.Object
  extended by com.application.areca.AbstractRecoveryTarget
All Implemented Interfaces:
HistoryEntryTypes, Identifiable, TargetActions, Duplicable
Direct Known Subclasses:
FileSystemRecoveryTarget

public abstract class AbstractRecoveryTarget
extends java.lang.Object
implements HistoryEntryTypes, Duplicable, Identifiable, TargetActions

Abstract base implementation for recovery targets.

Author:
Olivier PETRUCCI

Areca Build ID : 7299034069467778562

Field Summary
static java.lang.String BACKUP_SCHEME_DIFFERENTIAL
           
static java.lang.String BACKUP_SCHEME_FULL
           
static java.lang.String BACKUP_SCHEME_INCREMENTAL
           
protected  java.lang.String comments
           
protected  boolean createSecurityCopyOnBackup
           
protected  FilterGroup filterGroup
           
protected  TargetGroup group
           
protected  int id
           
protected  ArchiveMedium medium
           
protected  ProcessorList postProcessors
           
protected  ProcessorList preProcessors
           
protected  boolean running
           
protected  java.lang.String targetName
           
protected  java.lang.String uid
           
 
Fields inherited from interface com.application.areca.HistoryEntryTypes
HISTO_BACKUP, HISTO_BACKUP_CANCEL, HISTO_DELETE, HISTO_MERGE, HISTO_MERGE_CANCEL, HISTO_RECOVER
 
Fields inherited from interface com.application.areca.TargetActions
ACTION_ALL, ACTION_BACKUP, ACTION_DESCRIBE, ACTION_INDICATORS, ACTION_MERGE_OR_DELETE, ACTION_RECOVER, ACTION_SIMULATE
 
Constructor Summary
AbstractRecoveryTarget()
           
 
Method Summary
static void addBasicInformationsToManifest(Manifest mf)
           
 void addFilter(ArchiveFilter filter)
           
abstract  Manifest buildDefaultMergeManifest(java.util.GregorianCalendar fromDate, java.util.GregorianCalendar toDate)
           
 ActionReport checkTargetState(int action)
          Check the system state before critical operations (merges, deletions, ...)
 void clearHistory()
           
protected  void commitBackup(ProcessContext context)
          Commit the backup and release the lock on the target
protected  void commitMerge(ProcessContext context)
           
 IndicatorMap computeIndicators()
          Compute indicators on the stored data.
protected  void copyAttributes(java.lang.Object clone)
           
 void doAfterDelete()
           
 void doBeforeDelete()
           
 boolean equals(java.lang.Object arg0)
           
protected  boolean filterEntryBeforeStore(RecoveryEntry entry)
           
 java.lang.String getComments()
           
 java.lang.String getDescription()
           
 FilterGroup getFilterGroup()
           
 java.util.Iterator getFilterIterator()
           
 TargetGroup getGroup()
           
 History getHistory()
           
 int getId()
           
 ArchiveMedium getMedium()
           
 ProcessorList getPostProcessors()
           
 ProcessorList getPreProcessors()
           
protected abstract  java.lang.String getSpecificTargetDescription()
           
 java.lang.String getTargetName()
           
 java.lang.String getUid()
           
 int hashCode()
           
 boolean isCreateSecurityCopyOnBackup()
           
 boolean isRunning()
           
abstract  RecoveryEntry nextElement(ProcessContext context)
           
protected  void open(Manifest manifest, ProcessContext context, java.lang.String backupScheme)
          Open and lock the target
abstract  void processArchiveCheck(java.lang.String destination, boolean checkOnlyArchiveContent, java.util.GregorianCalendar date, ProcessContext context)
          Check the archive's content
 void processBackup(Manifest manifest, java.lang.String backupScheme, boolean disablePreCheck, boolean disableArchiveCheck, ProcessContext context)
           
 void processDeleteArchives(java.util.GregorianCalendar fromDate, ProcessContext context)
          Delete archives
 void processDeleteArchives(int delay, ProcessContext context)
          Deletes the archive which are newer than "delay" days.
 void processMerge(java.util.GregorianCalendar fromDate, java.util.GregorianCalendar toDate, Manifest manifest, boolean keepDeletedEntries, ProcessContext context)
          Merge archives
 void processMerge(int fromDelay, int toDelay, Manifest manifest, boolean keepDeletedEntries, ProcessContext context)
           
 void processRecover(java.lang.String destination, java.util.GregorianCalendar date, java.lang.String entry, boolean checkRecoveredFiles, ProcessContext context)
          Recovers a specific version of a given file
 void processRecover(java.lang.String destination, java.lang.String[] filters, java.util.GregorianCalendar date, boolean keepDeletedEntries, boolean checkRecoveredFiles, ProcessContext context)
          Recover stored data
protected abstract  void processRecoverImpl(java.lang.String destination, java.util.GregorianCalendar date, java.lang.String name, boolean checkRecoveredFiles, ProcessContext context)
          Recover stored data
protected abstract  void processRecoverImpl(java.lang.String destination, java.lang.String[] filters, java.util.GregorianCalendar date, boolean keepDeletedEntries, boolean checkRecoveredFiles, ProcessContext context)
          Recover stored data
 SimulationResult processSimulate(ProcessContext context)
          Launch a simulation process.
 SimulationResult processSimulateImpl(ProcessContext context, boolean returnDetailedResult)
          Launch a simulation process.
protected  void rollbackBackup(ProcessContext context)
          Rollback the backup and release the lock on the target
protected  void rollbackMerge(ProcessContext context)
           
 TargetSearchResult search(SearchCriteria criteria)
           
 void secureUpdateCurrentTask(long taskIndex, long taskCount, java.lang.String task, ProcessContext context)
           
 void secureUpdateCurrentTask(java.lang.String task, ProcessContext context)
           
 void setComments(java.lang.String comments)
           
 void setCreateSecurityCopyOnBackup(boolean createSecurityCopyOnBackup)
           
 void setFilterGroup(FilterGroup filterGroup)
           
 void setGroup(TargetGroup group)
           
 void setId(int id)
           
 void setMedium(ArchiveMedium medium, boolean revalidateMedium)
           
 void setRunning(boolean running)
           
 void setTargetName(java.lang.String taskName)
           
 void setUid(java.lang.String uid)
           
 boolean supportsBackupScheme(java.lang.String backupScheme)
           
 java.lang.String toString()
           
 void validateTargetState(int action)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.myJava.object.Duplicable
duplicate
 

Field Detail

BACKUP_SCHEME_FULL

public static final java.lang.String BACKUP_SCHEME_FULL
See Also:
Constant Field Values

BACKUP_SCHEME_INCREMENTAL

public static final java.lang.String BACKUP_SCHEME_INCREMENTAL
See Also:
Constant Field Values

BACKUP_SCHEME_DIFFERENTIAL

public static final java.lang.String BACKUP_SCHEME_DIFFERENTIAL
See Also:
Constant Field Values

medium

protected ArchiveMedium medium

filterGroup

protected FilterGroup filterGroup

id

protected int id

uid

protected java.lang.String uid

targetName

protected java.lang.String targetName

group

protected TargetGroup group

comments

protected java.lang.String comments

postProcessors

protected ProcessorList postProcessors

preProcessors

protected ProcessorList preProcessors

running

protected boolean running

createSecurityCopyOnBackup

protected boolean createSecurityCopyOnBackup
Constructor Detail

AbstractRecoveryTarget

public AbstractRecoveryTarget()
Method Detail

setGroup

public void setGroup(TargetGroup group)

copyAttributes

protected void copyAttributes(java.lang.Object clone)

supportsBackupScheme

public boolean supportsBackupScheme(java.lang.String backupScheme)

getPostProcessors

public ProcessorList getPostProcessors()

getPreProcessors

public ProcessorList getPreProcessors()

isRunning

public boolean isRunning()

isCreateSecurityCopyOnBackup

public boolean isCreateSecurityCopyOnBackup()

setCreateSecurityCopyOnBackup

public void setCreateSecurityCopyOnBackup(boolean createSecurityCopyOnBackup)

setRunning

public void setRunning(boolean running)

getFilterGroup

public FilterGroup getFilterGroup()

setFilterGroup

public void setFilterGroup(FilterGroup filterGroup)

getId

public int getId()

setId

public void setId(int id)

setUid

public void setUid(java.lang.String uid)

getUid

public java.lang.String getUid()
Specified by:
getUid in interface Identifiable

getTargetName

public java.lang.String getTargetName()

setTargetName

public void setTargetName(java.lang.String taskName)

getDescription

public java.lang.String getDescription()

getSpecificTargetDescription

protected abstract java.lang.String getSpecificTargetDescription()

getGroup

public TargetGroup getGroup()

checkTargetState

public ActionReport checkTargetState(int action)
Check the system state before critical operations (merges, deletions, ...)


validateTargetState

public void validateTargetState(int action)
                         throws ApplicationException
Throws:
ApplicationException

getComments

public java.lang.String getComments()

setComments

public void setComments(java.lang.String comments)

getMedium

public ArchiveMedium getMedium()
Returns:
Returns the medium.

search

public TargetSearchResult search(SearchCriteria criteria)
                          throws ApplicationException
Throws:
ApplicationException

setMedium

public void setMedium(ArchiveMedium medium,
                      boolean revalidateMedium)
Parameters:
medium - The medium to set.

addFilter

public void addFilter(ArchiveFilter filter)

getFilterIterator

public java.util.Iterator getFilterIterator()

getHistory

public History getHistory()

clearHistory

public void clearHistory()
                  throws ApplicationException
Throws:
ApplicationException

open

protected void open(Manifest manifest,
                    ProcessContext context,
                    java.lang.String backupScheme)
             throws ApplicationException
Open and lock the target

Throws:
ApplicationException

processBackup

public void processBackup(Manifest manifest,
                          java.lang.String backupScheme,
                          boolean disablePreCheck,
                          boolean disableArchiveCheck,
                          ProcessContext context)
                   throws ApplicationException
Throws:
ApplicationException

processSimulate

public SimulationResult processSimulate(ProcessContext context)
                                 throws ApplicationException
Launch a simulation process.

Throws:
ApplicationException

processSimulateImpl

public SimulationResult processSimulateImpl(ProcessContext context,
                                            boolean returnDetailedResult)
                                     throws ApplicationException
Launch a simulation process.

Throws:
ApplicationException

addBasicInformationsToManifest

public static void addBasicInformationsToManifest(Manifest mf)

commitBackup

protected void commitBackup(ProcessContext context)
                     throws ApplicationException
Commit the backup and release the lock on the target

Throws:
ApplicationException

rollbackBackup

protected void rollbackBackup(ProcessContext context)
                       throws ApplicationException
Rollback the backup and release the lock on the target

Throws:
ApplicationException

processMerge

public void processMerge(int fromDelay,
                         int toDelay,
                         Manifest manifest,
                         boolean keepDeletedEntries,
                         ProcessContext context)
                  throws ApplicationException
Throws:
ApplicationException

processMerge

public void processMerge(java.util.GregorianCalendar fromDate,
                         java.util.GregorianCalendar toDate,
                         Manifest manifest,
                         boolean keepDeletedEntries,
                         ProcessContext context)
                  throws ApplicationException
Merge archives

Throws:
ApplicationException

processDeleteArchives

public void processDeleteArchives(java.util.GregorianCalendar fromDate,
                                  ProcessContext context)
                           throws ApplicationException
Delete archives

Throws:
ApplicationException

processDeleteArchives

public void processDeleteArchives(int delay,
                                  ProcessContext context)
                           throws ApplicationException
Deletes the archive which are newer than "delay" days.

Throws:
ApplicationException

commitMerge

protected void commitMerge(ProcessContext context)
                    throws ApplicationException
Throws:
ApplicationException

rollbackMerge

protected void rollbackMerge(ProcessContext context)
                      throws ApplicationException
Throws:
ApplicationException

processRecover

public void processRecover(java.lang.String destination,
                           java.lang.String[] filters,
                           java.util.GregorianCalendar date,
                           boolean keepDeletedEntries,
                           boolean checkRecoveredFiles,
                           ProcessContext context)
                    throws ApplicationException
Recover stored data

Throws:
ApplicationException

processRecover

public void processRecover(java.lang.String destination,
                           java.util.GregorianCalendar date,
                           java.lang.String entry,
                           boolean checkRecoveredFiles,
                           ProcessContext context)
                    throws ApplicationException
Recovers a specific version of a given file

Throws:
ApplicationException

processRecoverImpl

protected abstract void processRecoverImpl(java.lang.String destination,
                                           java.lang.String[] filters,
                                           java.util.GregorianCalendar date,
                                           boolean keepDeletedEntries,
                                           boolean checkRecoveredFiles,
                                           ProcessContext context)
                                    throws ApplicationException
Recover stored data

Throws:
ApplicationException

processArchiveCheck

public abstract void processArchiveCheck(java.lang.String destination,
                                         boolean checkOnlyArchiveContent,
                                         java.util.GregorianCalendar date,
                                         ProcessContext context)
                                  throws ApplicationException
Check the archive's content

Throws:
ApplicationException

processRecoverImpl

protected abstract void processRecoverImpl(java.lang.String destination,
                                           java.util.GregorianCalendar date,
                                           java.lang.String name,
                                           boolean checkRecoveredFiles,
                                           ProcessContext context)
                                    throws ApplicationException
Recover stored data

Throws:
ApplicationException

doBeforeDelete

public void doBeforeDelete()

doAfterDelete

public void doAfterDelete()

nextElement

public abstract RecoveryEntry nextElement(ProcessContext context)
                                   throws ApplicationException
Throws:
ApplicationException

buildDefaultMergeManifest

public abstract Manifest buildDefaultMergeManifest(java.util.GregorianCalendar fromDate,
                                                   java.util.GregorianCalendar toDate)
                                            throws ApplicationException
Throws:
ApplicationException

filterEntryBeforeStore

protected boolean filterEntryBeforeStore(RecoveryEntry entry)

toString

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

equals

public boolean equals(java.lang.Object arg0)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

computeIndicators

public IndicatorMap computeIndicators()
                               throws ApplicationException
Compute indicators on the stored data.

Throws:
ApplicationException

secureUpdateCurrentTask

public void secureUpdateCurrentTask(long taskIndex,
                                    long taskCount,
                                    java.lang.String task,
                                    ProcessContext context)

secureUpdateCurrentTask

public void secureUpdateCurrentTask(java.lang.String task,
                                    ProcessContext context)