org.stanwood.media.actions
Interface IAction

All Superinterfaces:
IExtension
All Known Implementing Classes:
AbstractAction, ExecuteSystemCommandAction, PodCastAction, RenameAction

public interface IAction
extends IExtension

This interface should be implemented by classes that are used to represent actions that can be performed on media files in a media directory


Method Summary
 void finished(MediaDirectory dir)
          This is called once for each action after they have finished performing on all media files within the media directory.
 void init(MediaDirectory dir)
          This is called once before any of the media files are processed to allow the action to perform setup tasks
 boolean isTestMode()
          Used to find out if test mode is enabled
 void perform(MediaDirectory dir, IEpisode episode, java.io.File mediaFile, IActionEventHandler actionEventHandler)
          Used to perform the action upon a TV episode file.
 void perform(MediaDirectory dir, IFilm film, java.io.File mediaFile, java.lang.Integer part, IActionEventHandler actionEventHandler)
          Used to perform the action upon a film file.
 void performOnDirectory(MediaDirectory mediaDir, java.io.File dir, IActionEventHandler actionEventHandler)
          This is called so the action can perform on directories within the media directory
 void setParameter(java.lang.String key, java.lang.String value)
          Used to set the value of actions parameter
 void setTestMode(boolean testMode)
          Used to notify the action if test mode is enabled
 

Method Detail

init

void init(MediaDirectory dir)
          throws ActionException
This is called once before any of the media files are processed to allow the action to perform setup tasks

Parameters:
dir - The media directory
Throws:
ActionException - Thrown if their is a problem with the action

perform

void perform(MediaDirectory dir,
             IEpisode episode,
             java.io.File mediaFile,
             IActionEventHandler actionEventHandler)
             throws ActionException
Used to perform the action upon a TV episode file.

Parameters:
episode - The episode information
mediaFile - The media file
dir - File media directory the files belongs to
actionEventHandler - Used to notify the action performer about changes
Throws:
ActionException - Thrown if their is a problem with the action

perform

void perform(MediaDirectory dir,
             IFilm film,
             java.io.File mediaFile,
             java.lang.Integer part,
             IActionEventHandler actionEventHandler)
             throws ActionException
Used to perform the action upon a film file.

Parameters:
film - The film information
part - The part number of the film, or null if it does not have parts
mediaFile - The media file
dir - File media directory the files belongs to
actionEventHandler - Used to notify the action performer about changes
Throws:
ActionException - Thrown if their is a problem with the action

setParameter

void setParameter(java.lang.String key,
                  java.lang.String value)
                  throws ActionException
Used to set the value of actions parameter

Parameters:
key - The key of the parameter
value - The value of the parameter
Throws:
ActionException - Thrown if their is a problem setting the parameter

setTestMode

void setTestMode(boolean testMode)
Used to notify the action if test mode is enabled

Parameters:
testMode - True if test mode is enabled, otherwise false

isTestMode

boolean isTestMode()
Used to find out if test mode is enabled

Returns:
True if test mode is enabled, otherwise false

performOnDirectory

void performOnDirectory(MediaDirectory mediaDir,
                        java.io.File dir,
                        IActionEventHandler actionEventHandler)
                        throws ActionException
This is called so the action can perform on directories within the media directory

Parameters:
mediaDir - The media directory
dir - The directory the action is to perform on
actionEventHandler - Used to notify the action performer about changes
Throws:
ActionException - Thrown if their is a problem with the action

finished

void finished(MediaDirectory dir)
              throws ActionException
This is called once for each action after they have finished performing on all media files within the media directory.

Parameters:
dir - The media directory
Throws:
ActionException - Thrown if their is a problem with the action