org.gudy.azureus2.pluginsimpl.local.disk
Class DiskManagerChannelImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.disk.DiskManagerChannelImpl
All Implemented Interfaces:
PieceRTAProvider, DiskManagerFileInfoListener, DownloadManagerPeerListener, DiskManagerChannel

public class DiskManagerChannelImpl
extends java.lang.Object
implements DiskManagerChannel, DiskManagerFileInfoListener, DownloadManagerPeerListener, PieceRTAProvider


Nested Class Summary
static interface DiskManagerChannelImpl.channelCreateListener
           
protected static class DiskManagerChannelImpl.dataEntry
           
protected  class DiskManagerChannelImpl.request
           
 
Constructor Summary
protected DiskManagerChannelImpl(DownloadImpl _download, DiskManagerFileInfoImpl _plugin_file)
           
 
Method Summary
static void addListener(DiskManagerChannelImpl.channelCreateListener l)
           
 DiskManagerRequest createRequest()
           
 void dataChecked(long offset, long length)
           
 void dataWritten(long offset, long length)
           
 void destroy()
           
 long getBlockingPosition()
           
 long getCurrentPosition()
           
 DiskManagerFileInfo getFile()
           
 long getPosition()
           
 long getStartPosition()
           
 long getStartTime()
           
 java.lang.String getUserAgent()
          Returns the user-agent associated with this RTA activity, if known
 boolean isDestroyed()
           
 void peerAdded(PEPeer peer)
           
 void peerManagerAdded(PEPeerManager manager)
           
 void peerManagerRemoved(PEPeerManager manager)
           
 void peerManagerWillBeAdded(PEPeerManager manager)
          Called when a peer manager is created but not yet started
 void peerRemoved(PEPeer peer)
           
static void removeListener(DiskManagerChannelImpl.channelCreateListener l)
           
protected static void reportCreated(DiskManagerChannel channel)
           
 void setBufferMillis(long millis, long delay_millis)
          Sets an external view of how much buffer is being maintained by an external source.
 long[] updateRTAs(PiecePicker picker)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiskManagerChannelImpl

protected DiskManagerChannelImpl(DownloadImpl _download,
                                 DiskManagerFileInfoImpl _plugin_file)
                          throws DownloadException
Throws:
DownloadException
Method Detail

addListener

public static void addListener(DiskManagerChannelImpl.channelCreateListener l)

removeListener

public static void removeListener(DiskManagerChannelImpl.channelCreateListener l)

reportCreated

protected static void reportCreated(DiskManagerChannel channel)

getFile

public DiskManagerFileInfo getFile()
Specified by:
getFile in interface DiskManagerChannel

createRequest

public DiskManagerRequest createRequest()
Specified by:
createRequest in interface DiskManagerChannel

getPosition

public long getPosition()
Specified by:
getPosition in interface DiskManagerChannel

isDestroyed

public boolean isDestroyed()
Specified by:
isDestroyed in interface DiskManagerChannel

dataWritten

public void dataWritten(long offset,
                        long length)
Specified by:
dataWritten in interface DiskManagerFileInfoListener

dataChecked

public void dataChecked(long offset,
                        long length)
Specified by:
dataChecked in interface DiskManagerFileInfoListener

peerManagerWillBeAdded

public void peerManagerWillBeAdded(PEPeerManager manager)
Description copied from interface: DownloadManagerPeerListener
Called when a peer manager is created but not yet started

Specified by:
peerManagerWillBeAdded in interface DownloadManagerPeerListener

peerManagerAdded

public void peerManagerAdded(PEPeerManager manager)
Specified by:
peerManagerAdded in interface DownloadManagerPeerListener

peerManagerRemoved

public void peerManagerRemoved(PEPeerManager manager)
Specified by:
peerManagerRemoved in interface DownloadManagerPeerListener

peerAdded

public void peerAdded(PEPeer peer)
Specified by:
peerAdded in interface DownloadManagerPeerListener

peerRemoved

public void peerRemoved(PEPeer peer)
Specified by:
peerRemoved in interface DownloadManagerPeerListener

updateRTAs

public long[] updateRTAs(PiecePicker picker)
Specified by:
updateRTAs in interface PieceRTAProvider

getStartTime

public long getStartTime()
Specified by:
getStartTime in interface PieceRTAProvider

getStartPosition

public long getStartPosition()
Specified by:
getStartPosition in interface PieceRTAProvider

getCurrentPosition

public long getCurrentPosition()
Specified by:
getCurrentPosition in interface PieceRTAProvider

getBlockingPosition

public long getBlockingPosition()
Specified by:
getBlockingPosition in interface PieceRTAProvider

setBufferMillis

public void setBufferMillis(long millis,
                            long delay_millis)
Description copied from interface: PieceRTAProvider
Sets an external view of how much buffer is being maintained by an external source. This reduces piece urgency and therefore reduces discard.

Specified by:
setBufferMillis in interface PieceRTAProvider

getUserAgent

public java.lang.String getUserAgent()
Description copied from interface: PieceRTAProvider
Returns the user-agent associated with this RTA activity, if known

Specified by:
getUserAgent in interface PieceRTAProvider
Returns:

destroy

public void destroy()
Specified by:
destroy in interface DiskManagerChannel