org.gudy.azureus2.pluginsimpl.local.download
Class DownloadEventNotifierImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.download.DownloadEventNotifierImpl
All Implemented Interfaces:
DownloadEventNotifier

public class DownloadEventNotifierImpl
extends java.lang.Object
implements DownloadEventNotifier

This is an implementation of DownloadEventNotifier to be simplify life for plugins if they want to register event listeners across all downloads managed by Azureus.


Nested Class Summary
 class DownloadEventNotifierImpl.DownloadActivationNotifier
           
 class DownloadEventNotifierImpl.DownloadAttributeNotifier
           
 class DownloadEventNotifierImpl.DownloadCompletionNotifier
           
 class DownloadEventNotifierImpl.DownloadNotifier
           
 class DownloadEventNotifierImpl.DownloadPeerNotifier
           
 class DownloadEventNotifierImpl.DownloadPropertyNotifier
           
 class DownloadEventNotifierImpl.DownloadTrackerNotifier
           
 class DownloadEventNotifierImpl.DownloadWillBeRemovedNotifier
           
 
Constructor Summary
DownloadEventNotifierImpl(DownloadManager dm)
           
 
Method Summary
 void addActivationListener(DownloadActivationListener l)
          Adds a listener that will be invoked when a request is made to activate a torrent.
 void addAttributeListener(DownloadAttributeListener listener, TorrentAttribute ta, int event_type)
          Adds a listener that will be informed of when attributes on a download have been read / modified.
 void addCompletionListener(DownloadCompletionListener l)
          Adds a listener that will be informed when a download moves into a completed state.
 void addDownloadWillBeRemovedListener(DownloadWillBeRemovedListener l)
          Adds a listener that will be informed when a download is about to be removed.
 void addListener(DownloadListener l)
          Adds a listener that will be informed of changes to a download's state.
 void addPeerListener(DownloadPeerListener l)
          Adds a listener that will be informed of when peer managers have been added / removed for a download.
 void addPropertyListener(DownloadPropertyListener l)
          Adds a listener that will be informed of when properties on a download have been read / modified.
 void addTrackerListener(DownloadTrackerListener l)
          Adds a listener that will be informed when the latest announce/scrape results change.
 void addTrackerListener(DownloadTrackerListener l, boolean immediateTrigger)
          Adds a listener that will be informed when the latest announce/scrape results change.
 void removeActivationListener(DownloadActivationListener l)
          Removes a listener object added via the DownloadEventNotifier.addActivationListener(DownloadActivationListener) method.
 void removeAttributeListener(DownloadAttributeListener listener, TorrentAttribute ta, int event_type)
          Removes a listener object added via the {@link #addAttributeListener(DownloadAttributeListener, TorrentAttribute, int) method.
 void removeCompletionListener(DownloadCompletionListener l)
          Removes a listener object removed via the DownloadEventNotifier.addCompletionListener(DownloadCompletionListener) method.
 void removeDownloadWillBeRemovedListener(DownloadWillBeRemovedListener l)
          Removes a listener object added via the DownloadEventNotifier.addDownloadWillBeRemovedListener(DownloadWillBeRemovedListener) method.
 void removeListener(DownloadListener l)
          Removes a listener object added via the #addDownloadListener(DownloadListener) method.
 void removePeerListener(DownloadPeerListener l)
          Removes a listener object added via the DownloadEventNotifier.addPeerListener(DownloadPeerListener) method.
 void removePropertyListener(DownloadPropertyListener l)
          Removes a listener object added via the DownloadEventNotifier.addPropertyListener(DownloadPropertyListener) method.
 void removeTrackerListener(DownloadTrackerListener l)
          Removes a listener object added via the DownloadEventNotifier.addTrackerListener(DownloadTrackerListener) or DownloadEventNotifier.addTrackerListener(DownloadTrackerListener, boolean) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DownloadEventNotifierImpl

public DownloadEventNotifierImpl(DownloadManager dm)
Method Detail

addActivationListener

public void addActivationListener(DownloadActivationListener l)
Description copied from interface: DownloadEventNotifier
Adds a listener that will be invoked when a request is made to activate a torrent.

Specified by:
addActivationListener in interface DownloadEventNotifier
Parameters:
l - The listener to add.

addCompletionListener

public void addCompletionListener(DownloadCompletionListener l)
Description copied from interface: DownloadEventNotifier
Adds a listener that will be informed when a download moves into a completed state.

Specified by:
addCompletionListener in interface DownloadEventNotifier
Parameters:
l - The listener to add.

addDownloadWillBeRemovedListener

public void addDownloadWillBeRemovedListener(DownloadWillBeRemovedListener l)
Description copied from interface: DownloadEventNotifier
Adds a listener that will be informed when a download is about to be removed. This gives the implementor the opportunity to veto the removal.

Specified by:
addDownloadWillBeRemovedListener in interface DownloadEventNotifier
Parameters:
l - The listener to add.

addListener

public void addListener(DownloadListener l)
Description copied from interface: DownloadEventNotifier
Adds a listener that will be informed of changes to a download's state.

Specified by:
addListener in interface DownloadEventNotifier
Parameters:
l - The listener to add.

addPeerListener

public void addPeerListener(DownloadPeerListener l)
Description copied from interface: DownloadEventNotifier
Adds a listener that will be informed of when peer managers have been added / removed for a download.

Specified by:
addPeerListener in interface DownloadEventNotifier
Parameters:
l - The listener to add.

addPropertyListener

public void addPropertyListener(DownloadPropertyListener l)
Description copied from interface: DownloadEventNotifier
Adds a listener that will be informed of when properties on a download have been read / modified.

Specified by:
addPropertyListener in interface DownloadEventNotifier
Parameters:
l - The listener to add.

addTrackerListener

public void addTrackerListener(DownloadTrackerListener l)
Description copied from interface: DownloadEventNotifier
Adds a listener that will be informed when the latest announce/scrape results change.

Listener events will be immediately triggered after the listener has been added.

Specified by:
addTrackerListener in interface DownloadEventNotifier
Parameters:
l - The listener to add.

addTrackerListener

public void addTrackerListener(DownloadTrackerListener l,
                               boolean immediateTrigger)
Description copied from interface: DownloadEventNotifier
Adds a listener that will be informed when the latest announce/scrape results change.

Specified by:
addTrackerListener in interface DownloadEventNotifier
Parameters:
l - The listener to add.
immediateTrigger - Whether to immediately trigger listener's events.

removeActivationListener

public void removeActivationListener(DownloadActivationListener l)
Description copied from interface: DownloadEventNotifier
Removes a listener object added via the DownloadEventNotifier.addActivationListener(DownloadActivationListener) method.

Specified by:
removeActivationListener in interface DownloadEventNotifier
Parameters:
l - The listener to remove.

removeCompletionListener

public void removeCompletionListener(DownloadCompletionListener l)
Description copied from interface: DownloadEventNotifier
Removes a listener object removed via the DownloadEventNotifier.addCompletionListener(DownloadCompletionListener) method.

Specified by:
removeCompletionListener in interface DownloadEventNotifier
Parameters:
l - The listener to remove.

removeDownloadWillBeRemovedListener

public void removeDownloadWillBeRemovedListener(DownloadWillBeRemovedListener l)
Description copied from interface: DownloadEventNotifier
Removes a listener object added via the DownloadEventNotifier.addDownloadWillBeRemovedListener(DownloadWillBeRemovedListener) method.

Specified by:
removeDownloadWillBeRemovedListener in interface DownloadEventNotifier
Parameters:
l - The listener to remove.

removeListener

public void removeListener(DownloadListener l)
Description copied from interface: DownloadEventNotifier
Removes a listener object added via the #addDownloadListener(DownloadListener) method.

Specified by:
removeListener in interface DownloadEventNotifier
Parameters:
l - The listener to remove.

removePeerListener

public void removePeerListener(DownloadPeerListener l)
Description copied from interface: DownloadEventNotifier
Removes a listener object added via the DownloadEventNotifier.addPeerListener(DownloadPeerListener) method.

Specified by:
removePeerListener in interface DownloadEventNotifier
Parameters:
l - The listener to remove.

removePropertyListener

public void removePropertyListener(DownloadPropertyListener l)
Description copied from interface: DownloadEventNotifier
Removes a listener object added via the DownloadEventNotifier.addPropertyListener(DownloadPropertyListener) method.

Specified by:
removePropertyListener in interface DownloadEventNotifier
Parameters:
l - The listener to remove.

removeTrackerListener

public void removeTrackerListener(DownloadTrackerListener l)
Description copied from interface: DownloadEventNotifier
Removes a listener object added via the DownloadEventNotifier.addTrackerListener(DownloadTrackerListener) or DownloadEventNotifier.addTrackerListener(DownloadTrackerListener, boolean) method.

Specified by:
removeTrackerListener in interface DownloadEventNotifier
Parameters:
l - The listener to remove.

addAttributeListener

public void addAttributeListener(DownloadAttributeListener listener,
                                 TorrentAttribute ta,
                                 int event_type)
Description copied from interface: DownloadEventNotifier
Adds a listener that will be informed of when attributes on a download have been read / modified.

Specified by:
addAttributeListener in interface DownloadEventNotifier
Parameters:
listener - The listener to add.
ta - The torrent attribute to be notified about.
event_type - The type of event to be notified of, as defined on DownloadAttributeListener.

removeAttributeListener

public void removeAttributeListener(DownloadAttributeListener listener,
                                    TorrentAttribute ta,
                                    int event_type)
Description copied from interface: DownloadEventNotifier
Removes a listener object added via the {@link #addAttributeListener(DownloadAttributeListener, TorrentAttribute, int) method.

Specified by:
removeAttributeListener in interface DownloadEventNotifier
Parameters:
listener - The listener to remove.
ta - The torrent attribute which it registered with.
event_type - The type of event which it registered with.