|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.service.protocol.AbstractFileTransfer
public abstract class AbstractFileTransfer
An abstract implementation of the FileTransfer interface providing implementation of status and progress events related methods and leaving all protocol specific methods abstract. A protocol specific implementation could extend this class and implement only cancel() and getTransferredBytes().
| Field Summary |
|---|
| Fields inherited from interface net.java.sip.communicator.service.protocol.FileTransfer |
|---|
IN, OUT |
| Constructor Summary | |
|---|---|
AbstractFileTransfer()
|
|
| Method Summary | |
|---|---|
void |
addProgressListener(FileTransferProgressListener listener)
Adds the given FileTransferProgressListener to listen for status changes on this file transfer. |
void |
addStatusListener(FileTransferStatusListener listener)
Adds the given FileTransferStatusListener to listen for status changes on this file transfer. |
abstract void |
cancel()
Cancels this file transfer. |
void |
fireProgressChangeEvent(long timestamp,
long progress)
Notifies all status listeners that a new FileTransferProgressEvent occured. |
void |
fireStatusChangeEvent(int newStatus)
Notifies all status listeners that a new FileTransferStatusChangeEvent occured. |
void |
fireStatusChangeEvent(int newStatus,
String reason)
Notifies all status listeners that a new FileTransferStatusChangeEvent occured. |
int |
getStatus()
Returns the current status of the transfer. |
abstract long |
getTransferedBytes()
Returns the number of bytes already transfered through this file transfer. |
void |
removeProgressListener(FileTransferProgressListener listener)
Removes the given FileTransferProgressListener. |
void |
removeStatusListener(FileTransferStatusListener listener)
Removes the given FileTransferStatusListener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.java.sip.communicator.service.protocol.FileTransfer |
|---|
getContact, getDirection, getID, getLocalFile |
| Constructor Detail |
|---|
public AbstractFileTransfer()
| Method Detail |
|---|
public abstract void cancel()
cancel in interface FileTransferpublic abstract long getTransferedBytes()
getTransferedBytes in interface FileTransferpublic void addProgressListener(FileTransferProgressListener listener)
addProgressListener in interface FileTransferlistener - the listener to addpublic void addStatusListener(FileTransferStatusListener listener)
addStatusListener in interface FileTransferlistener - the listener to addpublic void removeProgressListener(FileTransferProgressListener listener)
removeProgressListener in interface FileTransferlistener - the listener to removepublic void removeStatusListener(FileTransferStatusListener listener)
removeStatusListener in interface FileTransferlistener - the listener to removepublic int getStatus()
getStatus in interface FileTransferpublic void fireStatusChangeEvent(int newStatus)
newStatus - the new status
public void fireStatusChangeEvent(int newStatus,
String reason)
newStatus - the new statusreason - the reason of the status change
public void fireProgressChangeEvent(long timestamp,
long progress)
timestamp - the date on which the event occuredprogress - the bytes representing the progress of the transfer
|
SIP Communicator: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||