org.xnap.transfer
Interface Queueable

All Known Implementing Classes:
JTellaDownloadContainer, OpenNapDownloadContainer, OpenNapUpload

public interface Queueable

Defines the requirements for classes that can be queued.

See Also:
TransferQueue

Method Summary
 long getEnqueueTime()
          Returns the time when the queueable was enqueued in milli seconds.
 java.lang.String getFilename()
           
 long getFilesize()
           
 Peer getPeer()
           
 int getPriority()
          Basically a boost factor.
 int getQueuePosition()
          Returns the position in the queue.
 void setQueuePosition(int position)
          Invoked by the queue to update the position.
 boolean startTransfer()
          Invoked by queue once the item moves to the top of the queue and is ready to run.
 

Method Detail

getEnqueueTime

long getEnqueueTime()
Returns the time when the queueable was enqueued in milli seconds.


getFilename

java.lang.String getFilename()
See Also:
Transfer.getFilename()

getFilesize

long getFilesize()
See Also:
Transfer.getFilesize()

getPeer

Peer getPeer()
See Also:
Transfer.getPeer()

getPriority

int getPriority()
Basically a boost factor. Higher values will yield better queue positions.


getQueuePosition

int getQueuePosition()
Returns the position in the queue.


setQueuePosition

void setQueuePosition(int position)
Invoked by the queue to update the position.

Parameters:
position - if 0, the item has been dequeued from the queue and startQueued() has been called.

startTransfer

boolean startTransfer()
Invoked by queue once the item moves to the top of the queue and is ready to run.

Returns:
true, if item has accepted the running state and should be dequeued; false, if item wants to remain queued


Copyright © 2001-2005 XNap Team. All Rights Reserved.