com.limegroup.gnutella
Interface ActivityCallback

All Known Implementing Classes:
Main

public interface ActivityCallback

Callback to notify the GUI of asynchronous backend events. The methods in this fall into the following categories:


Method Summary
 void acceptChat(Chatter ctr)
          Add a new incoming chat connection
 void addDownload(Downloader d)
          Add a file to the download window
 void addSharedDirectory(java.io.File directory, java.io.File parent)
          Notifies the GUI that the given directory has been shared.
 void addSharedFile(FileDesc file, java.io.File parent)
          Notifies the GUI that the given file has been shared.
 void addUpload(Uploader u)
          Add an uploader to the upload window
 void browseHostFailed(GUID guid)
          display an error message since the browse host failed.
 void chatErrorMessage(Chatter chatter, java.lang.String str)
          display an error message in the chat gui
 void chatUnavailable(Chatter chatter)
          The given chatter is no longer available
 void clearSharedFiles()
          The list of shared files has been emptied.
 void connectionClosed(Connection c)
          Mark a connection as closed
 void connectionInitialized(Connection c)
          Mark a connection as initialized
 void connectionInitializing(Connection c)
          Add a new unitialized connection.
 void downloadsComplete()
          Notifies the GUI that all active downloads have been completed.
 void fileManagerLoaded()
          Notifies a user that the filemanager has completely loaded.
 java.lang.String getHostValue(java.lang.String key)
           
 User getUserAuthenticationInfo(java.lang.String host)
          Asks user to authenticate, and returns the information received from user
 void handleQueryResult(RemoteFileDesc rfd, HostData data, java.util.Set locs)
          Add a query reply to the search result screen.
 void handleQueryString(java.lang.String query)
          Add a query string to the monitor screen
 void handleSharedFileUpdate(java.io.File file)
          Notifies the GUI that the given shared file has new information.
 void knownHost(Endpoint e)
          Add the given host/port to the host catcher
 void notifyUserAboutUpdate(java.lang.String message, boolean isPro, boolean l)
          A new version of LimeWire is available, notify user.
 void promptAboutCorruptDownload(Downloader dloader)
          Shows the user a message informing her that a file being downloaded is corrupt.
 void receiveMessage(Chatter chr)
          A new message is available from the given chatter
 void removeDownload(Downloader d)
          Remove a downloader from the download window.
 void removeUpload(Uploader u)
          Remove an uploader from the upload window.
 void restoreApplication()
          Tell the GUI to deiconify.
 void setAnnotateEnabled(boolean enabled)
          Sets the enabled/disabled state of file annotation.
 void showDownloads()
          Show active downloads
 void uploadsComplete()
          Notifies the GUI that all active uploads have been completed.
 

Method Detail

connectionInitializing

public void connectionInitializing(Connection c)
Add a new unitialized connection.


connectionInitialized

public void connectionInitialized(Connection c)
Mark a connection as initialized


connectionClosed

public void connectionClosed(Connection c)
Mark a connection as closed


knownHost

public void knownHost(Endpoint e)
Add the given host/port to the host catcher


handleQueryResult

public void handleQueryResult(RemoteFileDesc rfd,
                              HostData data,
                              java.util.Set locs)
Add a query reply to the search result screen. The reply is not guaranteed to match the query; use RouterService.matchesType for that. Also, it's possible that the user has cancelled the search.

See Also:
RouterService#query(String,int,MediaType), RouterService.matchesType(byte[],Response)

handleQueryString

public void handleQueryString(java.lang.String query)
Add a query string to the monitor screen


addDownload

public void addDownload(Downloader d)
Add a file to the download window


removeDownload

public void removeDownload(Downloader d)
Remove a downloader from the download window.


addUpload

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


removeUpload

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


acceptChat

public void acceptChat(Chatter ctr)
Add a new incoming chat connection


receiveMessage

public void receiveMessage(Chatter chr)
A new message is available from the given chatter


chatUnavailable

public void chatUnavailable(Chatter chatter)
The given chatter is no longer available


chatErrorMessage

public void chatErrorMessage(Chatter chatter,
                             java.lang.String str)
display an error message in the chat gui


browseHostFailed

public void browseHostFailed(GUID guid)
display an error message since the browse host failed.

Parameters:
guid - The GUID of the browse host.

notifyUserAboutUpdate

public void notifyUserAboutUpdate(java.lang.String message,
                                  boolean isPro,
                                  boolean l)
A new version of LimeWire is available, notify user.


fileManagerLoaded

public void fileManagerLoaded()
Notifies a user that the filemanager has completely loaded.


addSharedDirectory

public void addSharedDirectory(java.io.File directory,
                               java.io.File parent)
Notifies the GUI that the given directory has been shared. This method is called exactly once per directory per change to the shared directory and extension settings. Note that the files in directory are not necessarily yet indexed at the time of this call.

Parameters:
directory - MUST be a directory
parent - MUST be the parent of directory, or null if no parent exists.

addSharedFile

public void addSharedFile(FileDesc file,
                          java.io.File parent)
Notifies the GUI that the given file has been shared. This method is called exactly once per file per change to the shared directory and extension settings.

Parameters:
file - MUST be a file descriptor for the file.
parent - MUST be the parent of directory, or null if no parent exists.

handleSharedFileUpdate

public void handleSharedFileUpdate(java.io.File file)
Notifies the GUI that the given shared file has new information.

Parameters:
file - The File that needs updating

clearSharedFiles

public void clearSharedFiles()
The list of shared files has been emptied.


setAnnotateEnabled

public void setAnnotateEnabled(boolean enabled)
Sets the enabled/disabled state of file annotation.


downloadsComplete

public void downloadsComplete()
Notifies the GUI that all active downloads have been completed.


uploadsComplete

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


getUserAuthenticationInfo

public User getUserAuthenticationInfo(java.lang.String host)
Asks user to authenticate, and returns the information received from user

Parameters:
host - The host who is requesting authentication
Returns:
The authentication information input by user

promptAboutCorruptDownload

public void promptAboutCorruptDownload(Downloader dloader)
Shows the user a message informing her that a file being downloaded is corrupt.

This method MUST call dloader.discardCorruptDownload(boolean b) otherwise there will be threads piling up waiting for a notification


restoreApplication

public void restoreApplication()
Tell the GUI to deiconify.


showDownloads

public void showDownloads()
Show active downloads


getHostValue

public java.lang.String getHostValue(java.lang.String key)