Class BackupAction

java.lang.Object
backupmanager.action.BackupAction
All Implemented Interfaces:
BackupFunction
Direct Known Subclasses:
CopyFile, DeleteFile

public abstract class BackupAction extends Object implements BackupFunction
  • Constructor Details

  • Method Details

    • doAction

      public abstract boolean doAction(BackupManager backupManager, BackupStream backupStream, StreamItem streamItem) throws BackupException
      Perform a backup action. Return false or throw an exception if the action fails.
      Parameters:
      backupManager -
      streamItem -
      streamInformation -
      Returns:
      Throws:
      BackupException
    • getSettings

      public abstract ActionSettings getSettings()
      Get settings associated with this action.
      All actions must return settings even if they have nothing in them, since the settings are needed to recreate the action based on it's class name.
      Returns:
      action settings
    • setSettings

      public abstract boolean setSettings(ActionSettings settings)
      Set settings. Will return false if they were the wrong type for this action - though that should not be possible.
      Parameters:
      settings -
      Returns:
      true if settings are OK.
    • showDialog

      public boolean showDialog(Window owner)
      Returns:
      a dialog panel for controlling any of the settings.
    • runIfPreviousActionError

      public abstract boolean runIfPreviousActionError()
      flag to say whether or not to run this action if any previous action threw an error. Actions such as a file copy would probably want to run anyway, since may be copying to different disks and if one is full, you'd want to copy to the other. But if you'd failed to copy a file to a backup drive, you probably wouldn't want to delete it!
      Returns:
      true if it's OK to run this action when a previous action failed.
    • getDialogPanel

      public abstract PamDialogPanel getDialogPanel(Window owner)
      Get a dialog panel for this action to incorporate into a larger dialog.
      Specified by:
      getDialogPanel in interface BackupFunction
      Parameters:
      owner -
      Returns:
      dialog panel (assuming most actions have one - can return null).
    • getName

      public abstract String getName()
      Specified by:
      getName in interface BackupFunction
      Returns:
      a name for the action, to display in dialogs
    • getBackupStream

      public BackupStream getBackupStream()
      Returns:
      the backupStream
    • getActionMaker

      public ActionMaker getActionMaker()
      Returns:
      the actionMaker
    • getBackupFilter

      public BackupFilter getBackupFilter()
    • setBackupFilter

      public void setBackupFilter(BackupFilter backupFilter)
    • getSpace

      public String getSpace()