|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jurvis.util.JvDataTransferModel
public class JvDataTransferModel
A model class that contains information about a data transfer taking place between the client and server or vice versa.
| Field Summary | |
|---|---|
static int |
CANCELLED
Enumerated value indicating the transfer was cancelled by the user. |
static int |
COMPLETED
Enumerated value indicating the transfer has completed successfully. |
static int |
COPY
Enumerated value indicating the transfer is a copy. |
static int |
DOWNLOAD
Enumerated value indicating the transfer is a download. |
static int |
FAILED
Enumerated value indicating the transfer failed. |
static int |
INPROGRESS
Enumerated value indicating the transfer is in progress. |
protected EventListenerList |
listenerList
List of listeners |
static int |
PENDING
Enumerated value indicating the transfer is pending (i.e. |
static int |
UPLOAD
Enumerated value indicating the transfer is an upload. |
| Constructor Summary | |
|---|---|
JvDataTransferModel(int direction)
Construct a new JvDataTransferModel. |
|
| Method Summary | |
|---|---|
void |
addBytesTransferred(int amount)
Adjust the number of bytes transferred so far. |
void |
addDataTransferModelListener(JvDataTransferModelListener l)
Adds a listener to the list that is notified each time a change to the data model occurs. |
void |
addSecondsElapsed(int amount)
Adjust the number of seconds elapsed so far. |
boolean |
cancelRequested()
Determine if a request has been made to cancel the transfer. |
void |
fireModelChanged()
Notify all listeners that this model has changed. |
void |
fireModelChanged(EventObject e)
Notify all listeners that this model has changed. |
int |
getBytesRemaining()
Return the number of bytes remaining to transfer. |
int |
getBytesTransferred()
Return the number of bytes transferred so far. |
String |
getDestination()
Return the destination of the file being transferred. |
int |
getDirection()
Return the direction of the transfer. |
Exception |
getException()
Return the Exception of the downloaded exception. |
File |
getFile()
Return the File of the downloaded file. |
String |
getName()
Return the name of the file being transferred. |
int |
getSecondsElapsed()
Return the number of seconds elapsed so far. |
int |
getSecondsRemaining()
Return the estimated number of seconds remaining until completion. |
String |
getSource()
Return the source of the file being transferred. |
int |
getState()
Return the current state of the transfer. |
int |
getTotalBytes()
Return the total number of bytes that will be transferred. |
int |
getTransferRate()
Return the latest transfer rate expressed as bytes per second. |
void |
removeDataTransferModelListener(JvDataTransferModelListener l)
Removes a listener from the list that is notified each time a change to the data model occurs. |
void |
requestCancellation()
Request the cancellation of the transfer. |
void |
setBytesTransferred(int bytesTransferred)
Set the number of bytes transferred so far. |
void |
setDestination(String destination)
Set the destination of the file being transferred. |
void |
setDirection(int direction)
Set the current direction of the transfer. |
void |
setException(Exception exception)
Set the Exception of the downloaded exception. |
void |
setFile(File file)
Set the File of the downloaded file. |
void |
setName(String name)
Set the name of the file being transferred. |
void |
setSecondsElapsed(int secondsElapsed)
Set the number of seconds elapsed so far. |
void |
setSecondsRemaining(int secondsRemaining)
Set the estimated number of seconds remaining until completion. |
void |
setSource(String source)
Set the source of the file being transferred. |
void |
setState(int state)
Set the current state of the transfer. |
void |
setTotalBytes(int totalBytes)
Set the total number of bytes that will be transferred. |
void |
setTransferRate(int transferRate)
Set the transfer rate expressed as bytes per second. |
String |
toString()
Return a string representation of this class suitable for debugging. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int PENDING
public static final int INPROGRESS
public static final int COMPLETED
public static final int CANCELLED
public static final int FAILED
public static final int UPLOAD
public static final int DOWNLOAD
public static final int COPY
protected EventListenerList listenerList
| Constructor Detail |
|---|
public JvDataTransferModel(int direction)
JvDataTransferModel.
direction - of the transfer (one of UPLOAD, DOWNLOAD, or COPY)| Method Detail |
|---|
public int getDirection()
public void setDirection(int direction)
direction - the current direction of the transferpublic int getState()
public void setState(int state)
state - the current state of the transferpublic String getName()
public void setName(String name)
name - the name of the file being transferredpublic String getDestination()
public void setDestination(String destination)
destination - the destination of the file being transferredpublic File getFile()
File of the downloaded file.
File of the downloaded filepublic void setFile(File file)
File of the downloaded file.
file - the File of the downloaded filepublic Exception getException()
Exception of the downloaded exception.
Exception of the downloaded exceptionpublic void setException(Exception exception)
Exception of the downloaded exception.
exception - the Exception of the downloaded exceptionpublic String getSource()
public void setSource(String source)
source - the source of the file being transferredpublic int getTotalBytes()
public void setTotalBytes(int totalBytes)
totalBytes - total number of bytes that will be transferredpublic int getBytesTransferred()
public void setBytesTransferred(int bytesTransferred)
bytesTransferred - the number of bytes transferred so farpublic void addBytesTransferred(int amount)
amount - the amount to adjustpublic int getBytesRemaining()
public int getSecondsElapsed()
public void setSecondsElapsed(int secondsElapsed)
secondsElapsed - the number of seconds elapsed so farpublic void addSecondsElapsed(int amount)
amount - the amount to adjustpublic int getSecondsRemaining()
public void setSecondsRemaining(int secondsRemaining)
secondsRemaining - the number of seconds remaining until completionpublic int getTransferRate()
public void setTransferRate(int transferRate)
transferRate - the transfer rate expressed as bytes per secondpublic final void requestCancellation()
public final boolean cancelRequested()
public void fireModelChanged()
public void fireModelChanged(EventObject e)
public void addDataTransferModelListener(JvDataTransferModelListener l)
l - the JvDataTransferModelListenerpublic void removeDataTransferModelListener(JvDataTransferModelListener l)
l - the DataTransferModelListenerpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||