LimeWireCallback.java
| Index Score | ||
|---|---|---|
![]() |
![]() |
org.xnap.plugin.limewire |
![]() |
![]() |
XNap 3 |
View: Reasons, Metrics, Source Code
These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.
/*
* XNap - A P2P framework and client.
*
* See the file AUTHORS for copyright information.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.xnap.plugin.limewire;
import java.io.File;
import org.xnap.XNap;
import org.xnap.gui.Dialogs;
import com.limegroup.gnutella.ActivityCallback;
import com.limegroup.gnutella.Connection;
import com.limegroup.gnutella.Downloader;
import com.limegroup.gnutella.Endpoint;
import com.limegroup.gnutella.FileDesc;
import com.limegroup.gnutella.GUID;
import com.limegroup.gnutella.ManagedConnection;
import com.limegroup.gnutella.RemoteFileDesc;
import com.limegroup.gnutella.Uploader;
import com.limegroup.gnutella.chat.Chatter;
import com.limegroup.gnutella.search.HostData;
import com.limegroup.gnutella.security.User;
import com.sun.java.util.collections.Set;
/**
* @author warper
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class LimeWireCallback implements ActivityCallback {
/**
* @see com.limegroup.gnutella.ActivityCallback#connectionInitializing(com.limegroup.gnutella.Connection)
*/
public void connectionInitializing(Connection c)
{
if (c instanceof ManagedConnection) {
LimeWirePanel p = LimeWirePlugin.getConnectionPanel();
if (p != null) {
p.getTableModel().add((ManagedConnection)c);
}
}
}
/**
* @see com.limegroup.gnutella.ActivityCallback#connectionInitialized(com.limegroup.gnutella.Connection)
*/
public void connectionInitialized(Connection c)
{
// notify status panel
LimeWirePlugin.updateStatusPanel();
}
/**
* @see com.limegroup.gnutella.ActivityCallback#connectionClosed(com.limegroup.gnutella.Connection)
*/
public void connectionClosed(Connection c)
{
if (c instanceof ManagedConnection) {
LimeWirePanel p = LimeWirePlugin.getConnectionPanel();
if (p != null) {
p.getTableModel().remove((ManagedConnection)c);
}
}
// notify status panel
LimeWirePlugin.updateStatusPanel();
}
/**
* @see com.limegroup.gnutella.ActivityCallback#knownHost(com.limegroup.gnutella.Endpoint)
*/
public void knownHost(Endpoint arg0) {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#handleQueryResult(com.limegroup.gnutella.search.HostData, com.limegroup.gnutella.Response, com.sun.java.util.collections.List)
*/
public void handleQueryResult(RemoteFileDesc file, HostData data,
Set locations)
{
LimeWirePlugin.getSearchManager().received(file, data, locations);
}
/**
* @see com.limegroup.gnutella.ActivityCallback#handleQueryString(java.lang.String)
*/
public void handleQueryString(String arg0) {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#addDownload(com.limegroup.gnutella.Downloader)
*/
public void addDownload(Downloader d)
{
LimeWirePlugin.getTransferManager().add(d);
}
/**
* @see com.limegroup.gnutella.ActivityCallback#removeDownload(com.limegroup.gnutella.Downloader)
*/
public void removeDownload(Downloader d)
{
//LimeWirePlugin.getTransferManager().remove(d);
}
/**
* @see com.limegroup.gnutella.ActivityCallback#addUpload(com.limegroup.gnutella.Uploader)
*/
public void addUpload(Uploader u)
{
LimeWirePlugin.getTransferManager().add(u);
}
/**
* @see com.limegroup.gnutella.ActivityCallback#removeUpload(com.limegroup.gnutella.Uploader)
*/
public void removeUpload(Uploader u)
{
//LimeWirePlugin.getTransferManager().remove(u);
}
/**
* @see com.limegroup.gnutella.ActivityCallback#acceptChat(com.limegroup.gnutella.chat.Chatter)
*/
public void acceptChat(Chatter c)
{
// add channel to ChatManager
LimeWirePlugin.getChatManager().getChannel(c);
}
/**
* @see com.limegroup.gnutella.ActivityCallback#receiveMessage(com.limegroup.gnutella.chat.Chatter)
*/
public void receiveMessage(Chatter c)
{
LimeWireChatChannel channel = LimeWirePlugin.getChatManager().getChannel(c);
channel.messageReceived(channel.getRemotePeer(), c.getMessage());
}
/**
* @see com.limegroup.gnutella.ActivityCallback#chatUnavailable(com.limegroup.gnutella.chat.Chatter)
*/
public void chatUnavailable(Chatter c)
{
LimeWireChatChannel channel = LimeWirePlugin.getChatManager().getChannel(c);
channel.errorReceived(XNap.tr("Remote peer unavailable!"));
}
/**
* @see com.limegroup.gnutella.ActivityCallback#chatErrorMessage(com.limegroup.gnutella.chat.Chatter, java.lang.String)
*/
public void chatErrorMessage(Chatter c, String message)
{
LimeWireChatChannel channel = LimeWirePlugin.getChatManager().getChannel(c);
channel.errorReceived(message);
}
/**
* @see com.limegroup.gnutella.ActivityCallback#browseHostFailed(com.limegroup.gnutella.GUID)
*/
public void browseHostFailed(GUID guid)
{
LimeWirePlugin.getSearchManager().failed(guid);
}
/**
* @see com.limegroup.gnutella.ActivityCallback#notifyUserAboutUpdate(java.lang.String, boolean, boolean)
*/
public void notifyUserAboutUpdate(String arg0, boolean arg1, boolean arg2)
{
// not implemented, the core is updated through the
// XNap plugin facilities
}
/**
* @see com.limegroup.gnutella.ActivityCallback#fileManagerLoaded()
*/
public void fileManagerLoaded() {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#addSharedDirectory(java.io.File, java.io.File)
*/
public void addSharedDirectory(File arg0, File arg1) {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#addSharedFile(com.limegroup.gnutella.FileDesc, java.io.File)
*/
public void addSharedFile(FileDesc arg0, File arg1) {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#handleSharedFileUpdate(java.io.File)
*/
public void handleSharedFileUpdate(File arg0) {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#clearSharedFiles()
*/
public void clearSharedFiles() {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#setAnnotateEnabled(boolean)
*/
public void setAnnotateEnabled(boolean arg0) {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#downloadsComplete()
*/
public void downloadsComplete() {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#uploadsComplete()
*/
public void uploadsComplete() {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#getUserAuthenticationInfo(java.lang.String)
*/
public User getUserAuthenticationInfo(String arg0) {
return null;
}
/**
* @see com.limegroup.gnutella.ActivityCallback#promptAboutCorruptDownload(com.limegroup.gnutella.Downloader)
*/
public void promptAboutCorruptDownload(Downloader arg0) {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#restoreApplication()
*/
public void restoreApplication() {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#showDownloads()
*/
public void showDownloads() {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#getHostValue(java.lang.String)
*/
public String getHostValue(String arg0) {
return null;
}
/**
* @see com.limegroup.gnutella.ActivityCallback#indicateNewVersion()
*/
public void indicateNewVersion() {
}
/**
* @see com.limegroup.gnutella.ActivityCallback#showError(java.lang.String, java.lang.String)
*/
public void showError(String message, String messageKey) {
Dialogs.error(null, message);
}
/**
* @see com.limegroup.gnutella.ActivityCallback#isQueryAlive(com.limegroup.gnutella.GUID)
*/
public boolean isQueryAlive(GUID arg0) {
// is there a way to tell if query is still displayed on screen in XNap?
return false;
}
/**
* @see com.limegroup.gnutella.ActivityCallback#componentLoading(java.lang.String)
*/
public void componentLoading(String arg0) {
}
}
The table below shows all metrics for LimeWireCallback.java.




