|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xnap.transfer.AbstractTransfer org.xnap.plugin.opennap.net.OpenNapUpload
public class OpenNapUpload
Field Summary | |
---|---|
static int |
ACK_TIMEOUT
If the upload is not received within this timeout after the ack message has been sent, the upload will be cancelled. |
protected static org.apache.log4j.Logger |
logger
|
static int |
MAX_REREQUST_INTERVAL
If the upload request is not renewed within this interval, the upload will be cancelled. |
Fields inherited from class org.xnap.transfer.AbstractTransfer |
---|
MIN_RECALC_INTERVAL, RECALC_INTERVAL, SOCKET_TIMEOUT |
Fields inherited from interface org.xnap.transfer.Transfer |
---|
TRANSFER_TIMEOUT |
Constructor Summary | |
---|---|
OpenNapUpload(OpenNapServer server,
OpenNapUser user,
java.io.File file,
java.lang.String requestFilename)
|
Method Summary | |
---|---|
void |
exceptionThrown(java.lang.Exception e)
|
javax.swing.Action[] |
getActions()
Returns the actions that can performed by the transfer. |
long |
getBytesTransferred()
Returns how many bytes have been transferred since the transfer was started. |
long |
getEnqueueTime()
Returns the time when the queueable was enqueued in milli seconds. |
java.io.File |
getFile()
Returns the file the transfer is using. |
long |
getFilesize()
Returns the final filesize. |
java.lang.String |
getHash()
|
javax.swing.Icon |
getIcon()
Returns null. |
Peer |
getPeer()
Returns the peer. |
Plugin |
getPlugin()
Returns the plugin. |
int |
getPriority()
Basically a boost factor. |
int |
getQueuePosition()
Returns the position in the UploadManager queue. |
Segment[] |
getSegments()
Returns the segments for segmented downloads. |
java.lang.String |
getStatus()
Returns the current status that should be presented to the user. |
long |
getTotalBytesTransferred()
Returns how many bytes have been transferred. |
boolean |
isDone()
Returns true if the transfer is finished. |
boolean |
isRunning()
Returns true if the transfer is running. |
void |
messageReceived(ServerMessage msg)
|
void |
setHash(java.lang.String hash)
|
void |
setQueuePosition(int position)
Invoked by the queue to update the position. |
boolean |
socketReceived(IncomingSocket s)
Invoked when an incoming connect is recognized. |
void |
start()
Inovked by OpenNapTransferManager after the instanciation. |
boolean |
startTransfer()
Starts the transfer. |
void |
stop()
|
Methods inherited from class org.xnap.transfer.AbstractTransfer |
---|
addStateListener, cleared, getAverageRate, getCurrentRate, getDescription, getElapsedTime, getFilename, getRemainingTime, removeStateListener, stateChanged, toString, transferStarted, transferStopped |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.xnap.transfer.Queueable |
---|
getFilename |
Methods inherited from interface org.xnap.transfer.Transfer |
---|
addStateListener, cleared, getAverageRate, getCurrentRate, getDescription, getFilename, getRemainingTime, removeStateListener |
Field Detail |
---|
public static final int ACK_TIMEOUT
public static final int MAX_REREQUST_INTERVAL
protected static org.apache.log4j.Logger logger
Constructor Detail |
---|
public OpenNapUpload(OpenNapServer server, OpenNapUser user, java.io.File file, java.lang.String requestFilename)
Method Detail |
---|
public void exceptionThrown(java.lang.Exception e)
exceptionThrown
in interface ExceptionListener
public java.io.File getFile()
Transfer
getFile
in interface Transfer
public long getFilesize()
Transfer
getFilesize
in interface Queueable
getFilesize
in interface Transfer
getFilesize
in class AbstractTransfer
Transfer.getFilesize()
public Plugin getPlugin()
Transfer
getPlugin
in interface Transfer
public javax.swing.Action[] getActions()
Transfer
getActions
in interface Transfer
xnap.transfer.Transfer#getActions()
public long getBytesTransferred()
AbstractTransfer
getBytesTransferred
in class AbstractTransfer
AbstractTransfer.getCurrentRate()
public long getEnqueueTime()
Queueable
getEnqueueTime
in interface Queueable
public java.lang.String getHash()
public javax.swing.Icon getIcon()
AbstractTransfer
getIcon
in interface Transfer
getIcon
in class AbstractTransfer
public int getPriority()
Queueable
getPriority
in interface Queueable
public int getQueuePosition()
UploadManager
queue.
getQueuePosition
in interface Queueable
getQueuePosition
in interface Transfer
getQueuePosition
in class AbstractTransfer
public Peer getPeer()
Transfer
getPeer
in interface Queueable
getPeer
in interface Transfer
xnap.transfer.Transfer#getPeer()
public Segment[] getSegments()
Transfer
getSegments
in interface Transfer
getSegments
in class AbstractTransfer
public java.lang.String getStatus()
Transfer
getStatus
in interface Transfer
xnap.transfer.Transfer#getStatus()
public long getTotalBytesTransferred()
Transfer
getTotalBytesTransferred
in interface Transfer
xnap.transfer.Transfer#getTotalBytesTransferred()
public boolean isDone()
Transfer
isDone
in interface Transfer
public boolean isRunning()
Transfer
isRunning
in interface Transfer
public void messageReceived(ServerMessage msg)
messageReceived
in interface MessageListener
public void setHash(java.lang.String hash)
public void setQueuePosition(int position)
Queueable
setQueuePosition
in interface Queueable
position
- if 0, the item has been dequeued from the
queue and startQueued() has been called.public boolean socketReceived(IncomingSocket s)
SocketListener
socketReceived
in interface SocketListener
public void start()
public boolean startTransfer()
startTransfer
in interface Queueable
public void stop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |