sam.rules
Class ModusOperandi

java.lang.Object
  |
  +--sam.rules.ModusOperandi

public class ModusOperandi
extends java.lang.Object

Class describing what has to be done and how to do it.


Nested Class Summary
static class ModusOperandi.Opus
          Class defining which mode of operation is required: typically one of "archiving", "extracting", etc.
 
Field Summary
static ModusOperandi.Opus ARCHIVING
          Archiving mode of operation.
static ModusOperandi.Opus BENCHMARKING
          Benchmarking mode of operation.
static ModusOperandi.Opus CHECKING
          Probing mode of operation.
static ModusOperandi.Opus COMPARING
          Comparing mode of operation.
static ModusOperandi.Opus DESCRIBING
          Describing mode of operation.
static ModusOperandi.Opus EXTRACTING
          Extracting mode of operation.
static ModusOperandi.Opus FRESHENING
          Freshening mode of operation.
static ModusOperandi.Opus HELPING
          Helping mode of operation.
static ModusOperandi.Opus LISTING
          Listing mode of operation.
static ModusOperandi.Opus OVERWRITING
          Overwriting mode of operation.
 
Constructor Summary
ModusOperandi()
           
 
Method Summary
 java.io.File archive()
           
 long archiveSerialNumber()
          Sets the serial number of the archive
 int blockSize()
           
 boolean checkLayoutVersion()
          Checks wether the layout of the archive can be handled by this version of the application
 boolean checkSamVersion()
          Checks wether the data stored in the archive can be processed by this version of the application
 sam.cipher.Cipher[] ciphers()
          Gets the ciphers stack.
 java.lang.String comment()
           
 java.lang.String creatorGroup()
           
 java.lang.String creatorUser()
           
 int executePostCommand()
           
 sam.entry.List files()
           
 boolean hasImportedArchive()
           
 int horizontalThreads()
           
 java.io.File importedArchive()
           
 sam.entry.List importedFiles()
           
 java.lang.String infos()
          Prints a short summary of all settings
 boolean isArchiving()
           
 boolean isExtracting()
           
 boolean isSpecial()
           
 sam.entry.List newerFiles()
           
 sam.event.EventNotifier notifier()
           
 java.io.File outputDirectory()
           
 sam.io.Packer packer()
           
 void process(sam.rules.RuleSet ruleSet)
          Processes specified rule set
 sam.entry.Enumerator removedFiles()
           
 sam.entry.List setToBeProcessedFiles(sam.entry.List files)
          Sets the list of files that actually will be processed.
 java.io.File temporaryDirectory()
           
 sam.io.Tracker tracker()
           
 int verticalThreads()
           
 sam.entry.List wildcards()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ARCHIVING

public static final ModusOperandi.Opus ARCHIVING
Archiving mode of operation. This is the default mode, which consists in storing files into a new archive.


EXTRACTING

public static final ModusOperandi.Opus EXTRACTING
Extracting mode of operation. Existing local files might be overwritten.

See Also:
Settings.Constants#ASK_BEFORE_OVERWRITING_LOCAL_FILES

LISTING

public static final ModusOperandi.Opus LISTING
Listing mode of operation. Only lists the entries contained in the archive.

See Also:
Entry.list(sam.rules.ModusOperandi)

FRESHENING

public static final ModusOperandi.Opus FRESHENING
Freshening mode of operation. Entries which are newer than local files are extracted.


OVERWRITING

public static final ModusOperandi.Opus OVERWRITING
Overwriting mode of operation. Entries which are newer than local files are extracted.


COMPARING

public static final ModusOperandi.Opus COMPARING
Comparing mode of operation. Entries stored in the archive are compared against local files. No file is actually extracted onto disk.


BENCHMARKING

public static final ModusOperandi.Opus BENCHMARKING
Benchmarking mode of operation. No archive is actually created.


CHECKING

public static final ModusOperandi.Opus CHECKING
Probing mode of operation. This checks wether an archive is not damaged nor broken. No file is actually extracted onto disk, but the block trackers are probed.


HELPING

public static final ModusOperandi.Opus HELPING
Helping mode of operation. This prints help.


DESCRIBING

public static final ModusOperandi.Opus DESCRIBING
Describing mode of operation. This prints information on the considered archive.

Constructor Detail

ModusOperandi

public ModusOperandi()
Method Detail

process

public void process(sam.rules.RuleSet ruleSet)
Processes specified rule set


isArchiving

public boolean isArchiving()
Returns:
the program is run in archiving mode

isExtracting

public boolean isExtracting()
Returns:
the program is run in extracing mode

isSpecial

public boolean isSpecial()
Returns:
wether this is a special opus (i.e. neither archiving nor extracting)

notifier

public sam.event.EventNotifier notifier()
Returns:
the event dispatcher for this modus operandi.

archive

public java.io.File archive()
Returns:
the archive to be written to or read from

outputDirectory

public java.io.File outputDirectory()
Returns:
the output directory to be written to or read from.

importedArchive

public java.io.File importedArchive()
Returns:
the imported archive file for differential archiving

hasImportedArchive

public boolean hasImportedArchive()
Returns:
wether this archive is part of a multiple archive differential backup

importedFiles

public sam.entry.List importedFiles()
Returns:
the imported catalog for differential archiving

temporaryDirectory

public java.io.File temporaryDirectory()
Returns:
directory were temporary files are created

packer

public sam.io.Packer packer()
Returns:
the packer used for (de)compression Note that the returned packer is never null

tracker

public sam.io.Tracker tracker()
Returns:
the tracker used for (de)compression Note that the returned tracker is never null

blockSize

public int blockSize()
Returns:
the block size to be used (in bytes)

verticalThreads

public int verticalThreads()
Returns:
the number of vertical threads

horizontalThreads

public int horizontalThreads()
Returns:
the number of horizontal threads

comment

public java.lang.String comment()
Returns:
the archive comment/description (stored in decrypted text)

checkSamVersion

public boolean checkSamVersion()
Checks wether the data stored in the archive can be processed by this version of the application


checkLayoutVersion

public boolean checkLayoutVersion()
Checks wether the layout of the archive can be handled by this version of the application


archiveSerialNumber

public long archiveSerialNumber()
Sets the serial number of the archive


creatorUser

public java.lang.String creatorUser()
Returns:
the user creating the archive

creatorGroup

public java.lang.String creatorGroup()
Returns:
group of the the user creating the archive

executePostCommand

public int executePostCommand()
                       throws SyntaxError
Returns:
the class to be executed after program termination
SyntaxError

infos

public java.lang.String infos()
Prints a short summary of all settings


ciphers

public sam.cipher.Cipher[] ciphers()
Gets the ciphers stack. Note that instantiation is lazy.


wildcards

public sam.entry.List wildcards()
Returns:
the wildcards filtering files to be extracted

files

public sam.entry.List files()
Returns:
the list of files to be put into/contained in the archive

removedFiles

public sam.entry.Enumerator removedFiles()
Returns:
an sam.entry.Enumerator of all the files that have been removed since the previous backup of a differential set

The returned sam.entry.Enumerator is independant of the internal enumeration of files


newerFiles

public sam.entry.List newerFiles()
Returns:
an sam.entry.Enumerator of all the files that have been modified since the previous backup of a differential set

The returned sam.entry.Enumerator is independant of the internal enumeration of files


setToBeProcessedFiles

public sam.entry.List setToBeProcessedFiles(sam.entry.List files)
Sets the list of files that actually will be processed.

Returns:
the properly sorted list of to-be-processed files