Package unlimited.fc.client.api
Class TransferHook
- java.lang.Object
-
- java.util.Observable
-
- unlimited.fc.client.api.TransferHook
-
- All Implemented Interfaces:
unlimited.core.transfers.UDPTransferMetrics,TransferState
- Direct Known Subclasses:
MultiClientTransferHook,MultiTransferHandler,SnapShotHook,ThreadSafeMultiHook
public abstract class TransferHook extends java.util.Observable implements unlimited.core.transfers.UDPTransferMetrics, TransferState
This interface provides a hook into the status of FileCatalyst transfers. This class is also observable, and will update registered observers upon each status change. The current status may be obtained by calling getStatus(). The returned codes will correspond to one of the status constants defined in this class. A corresponding message can be obtained using the getStatusMessage() method.
-
-
Field Summary
Fields Modifier and Type Field Description static intBIDIRECTIONALThis direction indicates the current transfer is in both a download and uploadstatic intCANCELLEDThis status code means the transfer was cancelled (2)static intCHECKINGThis status code means this handler is checking the status of a file prior to transferring (12)static intCOMPRESSINGThis status code means this handler is currently compressing a file (not yet implemented) (6)static intCREATINGDMGThis status code means this handle is rebuilding the file or issuing the rebuild file command to the server (16)protected java.util.Map<java.lang.String,java.lang.Integer>currentFileToIDsstatic intDECOMPRESSINGThis status code means the connection is in a decompressing state (19)static intDELTAThis status code means this handler is creating delta file or issuing the delta command to the server (14)static intDOINGCHMODThis status code means this handler is currently changing the permissions on a file (9)static intDOINGMDTMThis status code means this handler is currently updating the Date/Time stamp on a file (8)static intDONEFILEThis status code means this handler is done transferring the current file (11)static intDOWNLOADThis direction indicates the current transfer is a downloadstatic intERRORThis status code means the transfer failed with an error (3)protected java.util.LinkedList<ErrorCodes>errorMessageStackstatic intFINISHEDThis status code means this handler is finished all files (10)static intIDLEThis status code means the connection is in an idle state (54)static intINITIALIZINGThis status code means this handler is currently initializing a transfer (7)static intMONITORINGThis status code means the connection is in a monitoring state (20)static intMOVINGFILESThis status code means this handle is int HTTP mode, and the FTP server didn't support APPE commands, and thus the files are being moved to the FTP server with one STOR command (17)static intNOTATTEMPTEDThis status code means the transfer was not attempted (0)static intPROCESSINGThis status code means the connection is in a processing state (55)static intREBUILDThis status code means this handle is rebuilding the file or issuing the rebuild file command to the server (15)static intRECONNECTINGThis status code means the connection has been lost, and is currently in a retry loop.static intSIGNATUREThis status code means this handler is creating signature or issuing the signature command to the server (13)static intSUCCESSThis status code means the transfer was successful (1)static intTRANSFERRINGThis status code means this handler is currently transferring a file (4)static intUPLOADThis direction indicates the current transfer is a uploadstatic intVERIFYINGThis status code means this handler is currently verifying the integrity of a file (5)
-
Constructor Summary
Constructors Constructor Description TransferHook()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddErrorMessage(ErrorCodes newError)Add a new error onto the stack.voidaddObserver(java.util.Observer o)Deprecated.intgetActualRate()Deprecated.Method deprecated.ErrorCodes[]getAllErrorMessages()Cycle through all errors in the stack and return them.java.util.List<java.lang.String>getAllFilePaths()Returns a list of all file paths contained within this TransferHooklonggetBytesSoFarAllFiles()Returns the number of bytes transferred so far for all files.longgetBytesSoFarCurrentFile()Returns the number of bytes transferred so far for the current file.intgetCountTransferred()Returns the number of files that were actually transferred.intgetCurrentEffectiveRate()Returns the rate for the current file in Kbps.java.lang.StringgetCurrentFilename()Returns the name of the file currently being transferred.java.util.Map<java.lang.String,java.lang.Integer>getCurrentFileToIDs()Returns a list of IDs for the fileslonggetCurrentFileTransferTime()Returns the transfer time for the current file in millisecondsintgetCurrentPercent()Returns the percent complete for the current fileintgetCurrentRate()Returns the rate in the last second for the current file in Kbps.intgetDirection()Returns either UPLOAD or DOWNLOAD constant depending on the direction of this transferintgetEffectiveRateAverage()Returns the effective rate for the current file in Kbps as an average over last 30 seconds.ErrorCodesgetErrorCodes()Returns the last error codes placed into the stack.java.lang.StringgetErrorMessage()Legacy method to get error messages.java.util.Set<ErrorCodes>getErrorSet()Returns the set of error codes for all error messages in this TransferHooksintgetFilesSoFar()Returns the number of files transferred so far.java.util.List<java.lang.String>getFilesTransferredLocal()Returns a List containing the full local paths (Strings) of all files that were transferred.java.util.List<java.lang.String>getFilesTransferredRemote()Returns a List containing the full remote paths (Strings) of all files that were transferred.java.lang.StringgetFormattedCurrentFileTransferTime()Returns a human readable file transfer timejava.lang.StringgetFormattedOverallTransferTime()Returns the time taken to transfer all files formatted to a String i.e 5 mins 21 secsjava.lang.StringgetFormattedTransferTime()Returns the time taken to transfer the current file formatted to a String i.e 5 mins 21 secsjava.lang.StringgetLocalFilename()Returns the full path of the local file currently being transferredintgetMeanEffectiveRate()Returns the rate for the current file in Kbps.intgetOverallRate()Returns the average rate (in Kbps) spanned over all files averaged over the entire transfer.doublegetOverallRateInKBperSecond()Returns the average rate (in KB/s) spanned over all files averageed over the entire transfer.java.lang.StringgetOverallTimeRemaining()Return the time remaining for the all files formatted to a String i.e 5 mins 21 secslonggetOverallTimeRemainingMillis()Returns the time remaining in milliseconds for all fileslonggetOverallTransferTime()Returns the time taken to transfer all files so far in millisecondsdoublegetPacketLossPercent()Returns the packet loss percent for the current transfer.intgetPercent()Returns the percentage complete of all files to be transferredintgetRate()Deprecated.intgetRateAverage()Returns the network rate for the current file in Kbps as an average over last 30 seconds.doublegetRateAverageInKBperSecond()Returns the rate for the current file in KB/s as an average over last 30 secondsdoublegetRateInKBperSecond()Returns the rate for the current file in KB/sjava.lang.StringgetRemoteFilename()Returns the full path of the remote file currently being transferredintgetRoundTripTime()Returns the current round trip timelonggetSizeAllFiles()Returns the total size in bytes of all files that will be transferredlonggetSizeCurrentFile()Returns the size in bytes of the file currently being transferred.longgetSizeTransferredAlreadyAllFiles()Returns the number of bytes that were already transferred for all files (usually due to a resume)longgetSizeTransferredAlreadyCurrentFile()Returns the number of bytes that were already transferred for this file (usually due to a resume)SnapShotHookgetSnapShot()Creates and returns a read-only snapshot of the current hook informationjava.lang.StringgetStatusAsParsableString()intgetStatusCode()Returns the current status code, indicates what is currently happening with the transferjava.lang.StringgetStatusMessage()Returns a String representation of the current status of this transfer handler.java.lang.StringgetTimeRemaining()Return the time remaining for the current file formatted to a String i.e 5 mins 21 secslonggetTimeRemainingMillis()Returns the time remaining in milliseconds for the current fileintgetTotalFiles()Returns the total number of files to be transferred.unlimited.core.transfers.UDPTransferMetricsContainergetTransferMetrics()intgetTransferMode()Returns the current transfer modelonggetTransferStartTime()Returns the transfer start time for the total transfer in millisecondsjava.util.List<java.lang.Integer>getTransferStatus()Returns a list of all the status codes for current transfers within this TransferHooklonggetTransferTime()Returns the transfer time for the total transfer in millisecondsjava.lang.StringgetTransferWarningMessage()Returns the transfer warning message if a transfer warning has occurred.booleanisFatal()Return true if a fatal error has occurredbooleanisSecure()Returns true if transfer is secureabstract booleanisTransferCancelled()Returns true if the transfer was cancelled.abstract booleanisTransferComplete()Returns true if all files are successfully transferredabstract booleanisTransferError()Returns true if an error occuredbooleanisTransferWarning()Returns true a recoverable transfer warning has occured.voidkillAll()voidsetCancelled()Calling this method will cancel the current transfer.voidsetFormatter(unlimited.core.util.common.formatter.Formatter formatter)Sets the formatter information to the values of this object
-
-
-
Field Detail
-
NOTATTEMPTED
public static final int NOTATTEMPTED
This status code means the transfer was not attempted (0)- See Also:
- Constant Field Values
-
SUCCESS
public static final int SUCCESS
This status code means the transfer was successful (1)- See Also:
- Constant Field Values
-
CANCELLED
public static final int CANCELLED
This status code means the transfer was cancelled (2)- See Also:
- Constant Field Values
-
ERROR
public static final int ERROR
This status code means the transfer failed with an error (3)- See Also:
- Constant Field Values
-
TRANSFERRING
public static final int TRANSFERRING
This status code means this handler is currently transferring a file (4)- See Also:
- Constant Field Values
-
VERIFYING
public static final int VERIFYING
This status code means this handler is currently verifying the integrity of a file (5)- See Also:
- Constant Field Values
-
COMPRESSING
public static final int COMPRESSING
This status code means this handler is currently compressing a file (not yet implemented) (6)- See Also:
- Constant Field Values
-
INITIALIZING
public static final int INITIALIZING
This status code means this handler is currently initializing a transfer (7)- See Also:
- Constant Field Values
-
DOINGMDTM
public static final int DOINGMDTM
This status code means this handler is currently updating the Date/Time stamp on a file (8)- See Also:
- Constant Field Values
-
DOINGCHMOD
public static final int DOINGCHMOD
This status code means this handler is currently changing the permissions on a file (9)- See Also:
- Constant Field Values
-
FINISHED
public static final int FINISHED
This status code means this handler is finished all files (10)- See Also:
- Constant Field Values
-
DONEFILE
public static final int DONEFILE
This status code means this handler is done transferring the current file (11)- See Also:
- Constant Field Values
-
CHECKING
public static final int CHECKING
This status code means this handler is checking the status of a file prior to transferring (12)- See Also:
- Constant Field Values
-
SIGNATURE
public static final int SIGNATURE
This status code means this handler is creating signature or issuing the signature command to the server (13)- See Also:
- Constant Field Values
-
DELTA
public static final int DELTA
This status code means this handler is creating delta file or issuing the delta command to the server (14)- See Also:
- Constant Field Values
-
REBUILD
public static final int REBUILD
This status code means this handle is rebuilding the file or issuing the rebuild file command to the server (15)- See Also:
- Constant Field Values
-
CREATINGDMG
public static final int CREATINGDMG
This status code means this handle is rebuilding the file or issuing the rebuild file command to the server (16)- See Also:
- Constant Field Values
-
MOVINGFILES
public static final int MOVINGFILES
This status code means this handle is int HTTP mode, and the FTP server didn't support APPE commands, and thus the files are being moved to the FTP server with one STOR command (17)- See Also:
- Constant Field Values
-
RECONNECTING
public static final int RECONNECTING
This status code means the connection has been lost, and is currently in a retry loop. (18)- See Also:
- Constant Field Values
-
DECOMPRESSING
public static final int DECOMPRESSING
This status code means the connection is in a decompressing state (19)- See Also:
- Constant Field Values
-
MONITORING
public static final int MONITORING
This status code means the connection is in a monitoring state (20)- See Also:
- Constant Field Values
-
UPLOAD
public static final int UPLOAD
This direction indicates the current transfer is a upload- See Also:
- Constant Field Values
-
DOWNLOAD
public static final int DOWNLOAD
This direction indicates the current transfer is a download- See Also:
- Constant Field Values
-
BIDIRECTIONAL
public static final int BIDIRECTIONAL
This direction indicates the current transfer is in both a download and upload- See Also:
- Constant Field Values
-
IDLE
public static final int IDLE
This status code means the connection is in an idle state (54)- See Also:
- Constant Field Values
-
PROCESSING
public static final int PROCESSING
This status code means the connection is in a processing state (55)- See Also:
- Constant Field Values
-
errorMessageStack
protected java.util.LinkedList<ErrorCodes> errorMessageStack
-
currentFileToIDs
protected java.util.Map<java.lang.String,java.lang.Integer> currentFileToIDs
-
-
Method Detail
-
getRate
@Deprecated public int getRate()
Deprecated.Returns the rate for the current file in Kbps. This is the average rate for the current file. you should use getMeanEffectiveRate() instead- Returns:
- the rate for the current file in Kbps
-
getActualRate
@Deprecated public int getActualRate()
Deprecated.Method deprecated. Use getMeanEffectiveRate() insteadReturns the rate for the current file in Kbps. This is the average rate for the current file. you should use getMeanEffectiveRate() instead- Returns:
- the rate for the current file in Kbps
-
isTransferComplete
public abstract boolean isTransferComplete()
Description copied from interface:TransferStateReturns true if all files are successfully transferred- Specified by:
isTransferCompletein interfaceTransferState- Returns:
- true if all files are successfully transferred
-
isTransferCancelled
public abstract boolean isTransferCancelled()
Description copied from interface:TransferStateReturns true if the transfer was cancelled.- Specified by:
isTransferCancelledin interfaceTransferState- Returns:
- true if the transfer was cancelled.
-
isTransferError
public abstract boolean isTransferError()
Description copied from interface:TransferStateReturns true if an error occured- Specified by:
isTransferErrorin interfaceTransferState- Returns:
- true if an error occured
-
isFatal
public boolean isFatal()
Return true if a fatal error has occurred- Returns:
-
getStatusAsParsableString
public java.lang.String getStatusAsParsableString()
-
getSnapShot
public SnapShotHook getSnapShot()
Creates and returns a read-only snapshot of the current hook information- Returns:
- returns a read only snapshot of the current hook
-
addErrorMessage
public void addErrorMessage(ErrorCodes newError)
Add a new error onto the stack.- Parameters:
newError- ErrorCodes
-
getAllErrorMessages
public ErrorCodes[] getAllErrorMessages()
Cycle through all errors in the stack and return them.- Returns:
- ErrorCodes[]
-
getErrorCodes
public ErrorCodes getErrorCodes()
Returns the last error codes placed into the stack.- Returns:
- ErrorCodes
-
getErrorMessage
public java.lang.String getErrorMessage()
Legacy method to get error messages.- Returns:
- String
-
setFormatter
public void setFormatter(unlimited.core.util.common.formatter.Formatter formatter)
Sets the formatter information to the values of this object- Parameters:
formatter- Formatter to set
-
getErrorSet
public java.util.Set<ErrorCodes> getErrorSet()
Returns the set of error codes for all error messages in this TransferHooks- Returns:
- Set containing all the ErrorCodes
-
getCurrentFileToIDs
public java.util.Map<java.lang.String,java.lang.Integer> getCurrentFileToIDs()
Returns a list of IDs for the files- Returns:
-
getTotalFiles
public int getTotalFiles()
Description copied from interface:TransferStateReturns the total number of files to be transferred.- Specified by:
getTotalFilesin interfaceTransferState- Returns:
- the total number of files to be transferred.
-
setCancelled
public void setCancelled()
Description copied from interface:TransferStateCalling this method will cancel the current transfer. This method will block until the transfer is actually cancelled.- Specified by:
setCancelledin interfaceTransferState
-
getFilesSoFar
public int getFilesSoFar()
Description copied from interface:TransferStateReturns the number of files transferred so far. This includes files that were skipped because incremental is enabled and the file has not been changed.- Specified by:
getFilesSoFarin interfaceTransferState- Returns:
- the number of files transferred so far.
-
getStatusMessage
public java.lang.String getStatusMessage()
Description copied from interface:TransferStateReturns a String representation of the current status of this transfer handler.- Specified by:
getStatusMessagein interfaceTransferState- Returns:
- A String representation of the current status of this transfer handler.
-
getSizeTransferredAlreadyCurrentFile
public long getSizeTransferredAlreadyCurrentFile()
Description copied from interface:TransferStateReturns the number of bytes that were already transferred for this file (usually due to a resume)- Specified by:
getSizeTransferredAlreadyCurrentFilein interfaceTransferState- Returns:
- long the number of bytes that were already transferred for this file (usually due to a resume)
-
getSizeTransferredAlreadyAllFiles
public long getSizeTransferredAlreadyAllFiles()
Description copied from interface:TransferStateReturns the number of bytes that were already transferred for all files (usually due to a resume)- Specified by:
getSizeTransferredAlreadyAllFilesin interfaceTransferState- Returns:
- long the number of bytes that were already transferred for all files (usually due to a resume)
-
getBytesSoFarCurrentFile
public long getBytesSoFarCurrentFile()
Description copied from interface:TransferStateReturns the number of bytes transferred so far for the current file.- Specified by:
getBytesSoFarCurrentFilein interfaceTransferState- Returns:
- the number of bytes transferred so far for the current file (excluding data skipped due to resume).
-
getSizeCurrentFile
public long getSizeCurrentFile()
Description copied from interface:TransferStateReturns the size in bytes of the file currently being transferred.- Specified by:
getSizeCurrentFilein interfaceTransferState- Returns:
- the size in bytes of the file currently being transferred.
-
getSizeAllFiles
public long getSizeAllFiles()
Description copied from interface:TransferStateReturns the total size in bytes of all files that will be transferred- Specified by:
getSizeAllFilesin interfaceTransferState- Returns:
- the total size in bytes of all files that will be transferred
-
getBytesSoFarAllFiles
public long getBytesSoFarAllFiles()
Description copied from interface:TransferStateReturns the number of bytes transferred so far for all files.- Specified by:
getBytesSoFarAllFilesin interfaceTransferState- Returns:
- the number of bytes transferred so far for all files (excluding data skipped due to resume).
-
getPercent
public int getPercent()
Description copied from interface:TransferStateReturns the percentage complete of all files to be transferred- Specified by:
getPercentin interfaceTransferState- Returns:
- the percentage complete of all files to be transferred
-
getCurrentPercent
public int getCurrentPercent()
Description copied from interface:TransferStateReturns the percent complete for the current file- Specified by:
getCurrentPercentin interfaceTransferState- Returns:
- the percent complete for the current file
-
getOverallRate
public int getOverallRate()
Description copied from interface:TransferStateReturns the average rate (in Kbps) spanned over all files averaged over the entire transfer.- Specified by:
getOverallRatein interfaceTransferState- Returns:
- rate in Kbps
-
getCurrentEffectiveRate
public int getCurrentEffectiveRate()
Description copied from interface:TransferStateReturns the rate for the current file in Kbps. This is the current rate for the current file.- Specified by:
getCurrentEffectiveRatein interfaceTransferState- Returns:
- the rate for the current file in Kbps
-
getMeanEffectiveRate
public int getMeanEffectiveRate()
Description copied from interface:TransferStateReturns the rate for the current file in Kbps. This is the average rate for the current file.- Specified by:
getMeanEffectiveRatein interfaceTransferState- Returns:
- the rate for the current file in Kbps
-
getRateAverage
public int getRateAverage()
Description copied from interface:TransferStateReturns the network rate for the current file in Kbps as an average over last 30 seconds.- Specified by:
getRateAveragein interfaceTransferState- Returns:
- the rate for the current file in Kbps
-
getEffectiveRateAverage
public int getEffectiveRateAverage()
Description copied from interface:TransferStateReturns the effective rate for the current file in Kbps as an average over last 30 seconds.- Specified by:
getEffectiveRateAveragein interfaceTransferState- Returns:
- the effective rate for the current file in Kbps
-
getRateInKBperSecond
public double getRateInKBperSecond()
Description copied from interface:TransferStateReturns the rate for the current file in KB/s- Specified by:
getRateInKBperSecondin interfaceTransferState- Returns:
- the rate for the current file in KB/s
-
getRateAverageInKBperSecond
public double getRateAverageInKBperSecond()
Description copied from interface:TransferStateReturns the rate for the current file in KB/s as an average over last 30 seconds- Specified by:
getRateAverageInKBperSecondin interfaceTransferState- Returns:
- the rate for the current file in KB/s
-
getOverallRateInKBperSecond
public double getOverallRateInKBperSecond()
Description copied from interface:TransferStateReturns the average rate (in KB/s) spanned over all files averageed over the entire transfer.- Specified by:
getOverallRateInKBperSecondin interfaceTransferState- Returns:
- rate in KB/s
-
getTimeRemainingMillis
public long getTimeRemainingMillis()
Description copied from interface:TransferStateReturns the time remaining in milliseconds for the current file- Specified by:
getTimeRemainingMillisin interfaceTransferState- Returns:
- the time remaining in milliseconds for the current file
-
getOverallTimeRemainingMillis
public long getOverallTimeRemainingMillis()
Description copied from interface:TransferStateReturns the time remaining in milliseconds for all files- Specified by:
getOverallTimeRemainingMillisin interfaceTransferState- Returns:
- the time remaining in milliseconds for all files
-
getTimeRemaining
public java.lang.String getTimeRemaining()
Description copied from interface:TransferStateReturn the time remaining for the current file formatted to a String i.e 5 mins 21 secs- Specified by:
getTimeRemainingin interfaceTransferState- Returns:
- the time remaining for the current file formatted to a String
-
getOverallTimeRemaining
public java.lang.String getOverallTimeRemaining()
Description copied from interface:TransferStateReturn the time remaining for the all files formatted to a String i.e 5 mins 21 secs- Specified by:
getOverallTimeRemainingin interfaceTransferState- Returns:
- the time remaining for the all files formatted to a String
-
getOverallTransferTime
public long getOverallTransferTime()
Description copied from interface:TransferStateReturns the time taken to transfer all files so far in milliseconds- Specified by:
getOverallTransferTimein interfaceTransferState- Returns:
- the time taken to transfer all files so far in milliseconds
-
getFormattedOverallTransferTime
public java.lang.String getFormattedOverallTransferTime()
Description copied from interface:TransferStateReturns the time taken to transfer all files formatted to a String i.e 5 mins 21 secs- Specified by:
getFormattedOverallTransferTimein interfaceTransferState- Returns:
- the time taken to transfer all files formatted to a String i.e 5 mins 21 secs
-
getFormattedTransferTime
public java.lang.String getFormattedTransferTime()
Description copied from interface:TransferStateReturns the time taken to transfer the current file formatted to a String i.e 5 mins 21 secs- Specified by:
getFormattedTransferTimein interfaceTransferState- Returns:
- the time taken to transfer the current file formatted to a String i.e 5 mins 21 secs
-
getTransferWarningMessage
public java.lang.String getTransferWarningMessage()
Description copied from interface:TransferStateReturns the transfer warning message if a transfer warning has occurred.- Specified by:
getTransferWarningMessagein interfaceTransferState- Returns:
- String the warning message
-
getStatusCode
public int getStatusCode()
Description copied from interface:TransferStateReturns the current status code, indicates what is currently happening with the transfer- Specified by:
getStatusCodein interfaceTransferState- Returns:
- the current status code
-
getCurrentFilename
public java.lang.String getCurrentFilename()
Description copied from interface:TransferStateReturns the name of the file currently being transferred.- Specified by:
getCurrentFilenamein interfaceTransferState- Returns:
- the name of the file currently being transferred.
-
getLocalFilename
public java.lang.String getLocalFilename()
Description copied from interface:TransferStateReturns the full path of the local file currently being transferred- Specified by:
getLocalFilenamein interfaceTransferState- Returns:
- the full path of the local file currently being transferred
-
getRemoteFilename
public java.lang.String getRemoteFilename()
Description copied from interface:TransferStateReturns the full path of the remote file currently being transferred- Specified by:
getRemoteFilenamein interfaceTransferState- Returns:
- the full path of the remote file currently being transferred
-
getTransferTime
public long getTransferTime()
Description copied from interface:TransferStateReturns the transfer time for the total transfer in milliseconds- Specified by:
getTransferTimein interfaceTransferState- Returns:
- the transfer time for the total transfer in milliseconds
-
getTransferStartTime
public long getTransferStartTime()
Description copied from interface:TransferStateReturns the transfer start time for the total transfer in milliseconds- Specified by:
getTransferStartTimein interfaceTransferState- Returns:
- the transfer start time for the total transfer in milliseconds
-
getCurrentFileTransferTime
public long getCurrentFileTransferTime()
Description copied from interface:TransferStateReturns the transfer time for the current file in milliseconds- Specified by:
getCurrentFileTransferTimein interfaceTransferState- Returns:
- the transfer time for the current file in milliseconds
-
getCountTransferred
public int getCountTransferred()
Description copied from interface:TransferStateReturns the number of files that were actually transferred. This differs from getFilesSofar() in that it only includes files that actually got transferred. Some may be skipped because incremental is set to true and had not changed on the server.- Specified by:
getCountTransferredin interfaceTransferState- Returns:
- number of files actually transferred
-
getPacketLossPercent
public double getPacketLossPercent()
Description copied from interface:TransferStateReturns the packet loss percent for the current transfer. Always returns 0 for non-UDP transfers.- Specified by:
getPacketLossPercentin interfaceTransferState- Returns:
- packet loss percentage for current transfer
-
getRoundTripTime
public int getRoundTripTime()
Description copied from interface:TransferStateReturns the current round trip time- Specified by:
getRoundTripTimein interfaceTransferState- Returns:
- the current round trip time
-
getFilesTransferredRemote
public java.util.List<java.lang.String> getFilesTransferredRemote()
Description copied from interface:TransferStateReturns a List containing the full remote paths (Strings) of all files that were transferred. Calling this method through JavaScript to the applet will return a String delimited by the default delimiter, or whatever delimiter was specified via the applet "delimiter" param- Specified by:
getFilesTransferredRemotein interfaceTransferState- Returns:
- List containing the full remote paths (Strings) of all files that were transferred.
-
getFilesTransferredLocal
public java.util.List<java.lang.String> getFilesTransferredLocal()
Description copied from interface:TransferStateReturns a List containing the full local paths (Strings) of all files that were transferred. Calling this method through JavaScript to the applet will return a String delimited by the default delimiter, or whatever delimiter was specified via the applet "delimiter" param- Specified by:
getFilesTransferredLocalin interfaceTransferState- Returns:
- List containing the full local paths (Strings) of all files that were transferred.
-
getDirection
public int getDirection()
Description copied from interface:TransferStateReturns either UPLOAD or DOWNLOAD constant depending on the direction of this transfer- Specified by:
getDirectionin interfaceTransferState- Returns:
- either UPLOAD or DOWNLOAD constant depending on the direction of this transfer
-
getTransferMode
public int getTransferMode()
Description copied from interface:TransferStateReturns the current transfer mode- Specified by:
getTransferModein interfaceTransferState- Returns:
- current transfer mode
-
isSecure
public boolean isSecure()
Description copied from interface:TransferStateReturns true if transfer is secure- Specified by:
isSecurein interfaceTransferState- Returns:
- true if transfer is secure
-
getTransferStatus
public java.util.List<java.lang.Integer> getTransferStatus()
Description copied from interface:TransferStateReturns a list of all the status codes for current transfers within this TransferHook- Specified by:
getTransferStatusin interfaceTransferState- Returns:
-
getAllFilePaths
public java.util.List<java.lang.String> getAllFilePaths()
Description copied from interface:TransferStateReturns a list of all file paths contained within this TransferHook- Specified by:
getAllFilePathsin interfaceTransferState- Returns:
-
getFormattedCurrentFileTransferTime
public java.lang.String getFormattedCurrentFileTransferTime()
Description copied from interface:TransferStateReturns a human readable file transfer time- Specified by:
getFormattedCurrentFileTransferTimein interfaceTransferState- Returns:
- Human readable transfer time
-
getCurrentRate
public int getCurrentRate()
Description copied from interface:TransferStateReturns the rate in the last second for the current file in Kbps.- Specified by:
getCurrentRatein interfaceTransferState- Returns:
- the rate for the current file in Kbps over the past second.
-
isTransferWarning
public boolean isTransferWarning()
Description copied from interface:TransferStateReturns true a recoverable transfer warning has occured.- Specified by:
isTransferWarningin interfaceTransferState- Returns:
- boolean true if a recoverable transfer warning has occured.
-
getTransferMetrics
public unlimited.core.transfers.UDPTransferMetricsContainer getTransferMetrics()
- Specified by:
getTransferMetricsin interfaceunlimited.core.transfers.UDPTransferMetrics
-
addObserver
@Deprecated public void addObserver(java.util.Observer o)
Deprecated.Java has Deprecated Observable due to it being an anti-pattern.- Overrides:
addObserverin classjava.util.Observable
-
killAll
public void killAll()
-
-