LimeWire Consolidated API

com.limegroup.gnutella
Interface ActivityCallback

All Superinterfaces:
DownloadCallback
All Known Implementing Classes:
ActivityCallbackAdapter

public interface ActivityCallback
extends DownloadCallback

Defines the interface of a callback to notify about asynchronous backend events. The methods in this interface fall into the following categories:


Method Summary
 void addUpload(Uploader u)
          Add an uploader to the upload window
 void handleMagnets(MagnetOptions[] magnets)
          The core passes parsed magnets to the callback and asks it if it wants to handle them itself.
 void handleQuery(QueryRequest query, String address, int port)
          Add a query string to the monitor screen
 void handleQueryResult(RemoteFileDesc rfd, QueryReply queryReply, Set<? extends IpPort> locs)
          Notifies the UI that a new query result has come in to the backend.
 void handleSaveLocationException(DownloadAction downLoadAction, SaveLocationException sle, boolean supportsNewSaveDir)
          Handles the supplied SaveLocation exception by prompting the user for a new savelocation or whether to overwrite the file.
 void handleSharedFileUpdate(File file)
           
 void handleTorrent(File torrentFile)
          Try to download the torrent file
 void installationCorrupted()
          Notification that installation may be corrupted.
 boolean isQueryAlive(GUID guid)
           
 void promptTorrentUploadCancel(ManagedTorrent torrent)
          Validates with the user that the torrent upload should be cancelled.
 void removeUpload(Uploader u)
          Remove an uploader from the upload window.
 void restoreApplication()
          Tell to deiconify.
 String translate(String s)
          Translate a String taking into account Locale.
 void uploadsComplete()
          Notifies that all active uploads have been completed.
 
Methods inherited from interface com.limegroup.gnutella.DownloadCallback
addDownload, downloadCompleted, downloadsComplete, promptAboutCorruptDownload
 

Method Detail

handleQueryResult

void handleQueryResult(RemoteFileDesc rfd,
                       QueryReply queryReply,
                       Set<? extends IpPort> locs)
Notifies the UI that a new query result has come in to the backend.

Parameters:
rfd - the descriptor for the remote file
queryReply -
locs - the Set of alternate locations for the file

handleQuery

void handleQuery(QueryRequest query,
                 String address,
                 int port)
Add a query string to the monitor screen


addUpload

void addUpload(Uploader u)
Add an uploader to the upload window


removeUpload

void removeUpload(Uploader u)
Remove an uploader from the upload window.


handleSharedFileUpdate

void handleSharedFileUpdate(File file)

uploadsComplete

void uploadsComplete()
Notifies that all active uploads have been completed.


restoreApplication

void restoreApplication()
Tell to deiconify.


isQueryAlive

boolean isQueryAlive(GUID guid)
Returns:
true If the guid that maps to a query result screen is still available/viewable to the user.

installationCorrupted

void installationCorrupted()
Notification that installation may be corrupted.


handleMagnets

void handleMagnets(MagnetOptions[] magnets)
The core passes parsed magnets to the callback and asks it if it wants to handle them itself.

If this is the case the callback should return true, otherwise the core starts the downloads itself.

Parameters:
magnets - Array of magnet information to handle

handleTorrent

void handleTorrent(File torrentFile)
Try to download the torrent file


translate

String translate(String s)
Translate a String taking into account Locale. String literals that should be translated must still be marked for translation using I18nMarker.marktr(String).

Parameters:
s - The String to translate
Returns:
the translated String

handleSaveLocationException

void handleSaveLocationException(DownloadAction downLoadAction,
                                 SaveLocationException sle,
                                 boolean supportsNewSaveDir)
Handles the supplied SaveLocation exception by prompting the user for a new savelocation or whether to overwrite the file.


promptTorrentUploadCancel

void promptTorrentUploadCancel(ManagedTorrent torrent)
Validates with the user that the torrent upload should be cancelled. There are various reasons the user will not want the cancel to go through. 1) If the torrent is still downloading, the upload cannot be cancelled without cancelling the download. 2) If the torrent is seeding, but the seed ratio is low, the user may wish to seed to at least 100% to be a good samaritan.

Parameters:
torrent -

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.