org.gudy.azureus2.ui.console.commands
Class TorrentCommand

java.lang.Object
  extended by org.gudy.azureus2.ui.console.commands.IConsoleCommand
      extended by org.gudy.azureus2.ui.console.commands.TorrentCommand
Direct Known Subclasses:
Hack, TorrentArchive, TorrentCheck, TorrentForceStart, TorrentHost, TorrentLog, TorrentPublish, TorrentQueue, TorrentRemove, TorrentStart, TorrentStop, TorrentSubCommand

public abstract class TorrentCommand
extends IConsoleCommand

base class for objects which need to operate on specific torrents. this class allows the torrent to be identified by hash, number or 'all' and will pass the appropriate torrent(s) to the subclasses 'performCommand' method

Author:
tobi

Nested Class Summary
 
Nested classes/interfaces inherited from class org.gudy.azureus2.ui.console.commands.IConsoleCommand
IConsoleCommand.TorrentComparator
 
Constructor Summary
TorrentCommand(java.lang.String main_name, java.lang.String short_name, java.lang.String action)
          initializes the torrent command
 
Method Summary
 void execute(java.lang.String commandName, ConsoleInput ci, java.util.List<java.lang.String> args)
          execute the command with the specified name using the specified arguments
protected  java.lang.String getAction()
           
protected abstract  boolean performCommand(ConsoleInput ci, DownloadManager dm, java.util.List<java.lang.String> args)
           
protected  boolean performCommand(ConsoleInput ci, TRHostTorrent torrent, java.util.List<java.lang.String> args)
          Stub for commands that operate on a hosted torrent rather than downloadmanager
 void printHelpExtra(java.io.PrintStream out, java.util.List args)
          prints out the syntax of this command
 
Methods inherited from class org.gudy.azureus2.ui.console.commands.IConsoleCommand
expandVariable, getCommandDescriptions, getCommandName, getCommandNames, getDefaultSummaryFormat, getShortCommandName, getTorrentSummary, printHelp, printHelp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TorrentCommand

public TorrentCommand(java.lang.String main_name,
                      java.lang.String short_name,
                      java.lang.String action)
initializes the torrent command

Parameters:
commandNames - (the first item in the array is regarded as the primary command name)
action - a description to be used when this command is executed
Method Detail

getAction

protected java.lang.String getAction()

performCommand

protected abstract boolean performCommand(ConsoleInput ci,
                                          DownloadManager dm,
                                          java.util.List<java.lang.String> args)

performCommand

protected boolean performCommand(ConsoleInput ci,
                                 TRHostTorrent torrent,
                                 java.util.List<java.lang.String> args)
Stub for commands that operate on a hosted torrent rather than downloadmanager

Parameters:
ci -
args -
Returns:

execute

public void execute(java.lang.String commandName,
                    ConsoleInput ci,
                    java.util.List<java.lang.String> args)
Description copied from class: IConsoleCommand
execute the command with the specified name using the specified arguments

Specified by:
execute in class IConsoleCommand

printHelpExtra

public void printHelpExtra(java.io.PrintStream out,
                           java.util.List args)
prints out the syntax of this command

Overrides:
printHelpExtra in class IConsoleCommand