Package com.enterprisedt.net.ftp
Class EventCollector
java.lang.Object
com.enterprisedt.net.ftp.EventCollector
- All Implemented Interfaces:
EventListener
Logs events in an internal buffer.
- Version:
- $Revision$
- Author:
- Hans Andersen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbytesTransferred(String connId, String remoteFilename, long count) Report the number of bytes transferred so far.voidclearLog()Clear the log of all messagesvoidcommandSent(String connId, String cmd) Log an FTP command being sent to the server.voiddownloadCompleted(String connId, String remoteFilename) Notifies that a download has completedvoiddownloadStarted(String connId, String remoteFilename) Notifies that a download has startedgetLog()Get the log of messagesbooleanAre commands and replies being logged? Default is true.booleanAre connection identifiers being logged? Default is false.booleanIs transfer progress being logged? Default is false.booleanAre transfer start and complete events being logged? Default is true.voidreplyReceived(String connId, String reply) Log an FTP reply being sent back to the client.voidsetLogCommands(boolean logCommands) Should commands and replies be logged? Default is true.voidsetLogConnectionIdentifiers(boolean logConnectionIdentifiers) Should connection identifiers be logged? Default is false.voidsetLogTransferProgress(boolean logTransferProgress) Should transfer progress be logged? Default is false.voidsetLogTransferStartComplete(boolean logTransferStartComplete) Should transfer start and complete events be logged? Default is true.voiduploadCompleted(String connId, String remoteFilename) Notifies that an upload has completedvoiduploadStarted(String connId, String remoteFilename) Notifies that an upload has started
-
Constructor Details
-
EventCollector
public EventCollector()
-
-
Method Details
-
isLogConnectionIdentifiers
public boolean isLogConnectionIdentifiers()Are connection identifiers being logged? Default is false.- Returns:
- true if connection identifiers are being logged.
-
setLogConnectionIdentifiers
public void setLogConnectionIdentifiers(boolean logConnectionIdentifiers) Should connection identifiers be logged? Default is false.- Parameters:
logConnectionIdentifiers- true to enable logging of connection identifiers.
-
isLogCommands
public boolean isLogCommands()Are commands and replies being logged? Default is true.- Returns:
- true if commands and replies are being logged.
-
setLogCommands
public void setLogCommands(boolean logCommands) Should commands and replies be logged? Default is true.- Parameters:
logCommands- true to enable logging of commands and replies.
-
isLogTransferStartComplete
public boolean isLogTransferStartComplete()Are transfer start and complete events being logged? Default is true.- Returns:
- true if transfer start and complete events are being logged.
-
setLogTransferStartComplete
public void setLogTransferStartComplete(boolean logTransferStartComplete) Should transfer start and complete events be logged? Default is true.- Parameters:
logTransferStartComplete- true if transfer start and complete events are to be logged.
-
isLogTransferProgress
public boolean isLogTransferProgress()Is transfer progress being logged? Default is false.- Returns:
- true if transfer progress being logged.
-
setLogTransferProgress
public void setLogTransferProgress(boolean logTransferProgress) Should transfer progress be logged? Default is false.- Parameters:
logTransferProgress- true if transfer progress is to be logged.
-
getLog
Get the log of messages- Returns:
- message log as a string
-
clearLog
public void clearLog()Clear the log of all messages -
commandSent
Log an FTP command being sent to the server. Not used for SFTP.- Specified by:
commandSentin interfaceEventListener- Parameters:
connId- Identifier of FTP connectioncmd- command string
-
replyReceived
Log an FTP reply being sent back to the client. Not used for SFTP.- Specified by:
replyReceivedin interfaceEventListener- Parameters:
connId- Identifier of FTP connectionreply- reply string
-
downloadStarted
Notifies that a download has started- Specified by:
downloadStartedin interfaceEventListener- Parameters:
connId- Identifier of FTP connectionremoteFilename- remote file name
-
downloadCompleted
Notifies that a download has completed- Specified by:
downloadCompletedin interfaceEventListener- Parameters:
connId- Identifier of FTP connectionremoteFilename- remote file name
-
uploadStarted
Notifies that an upload has started- Specified by:
uploadStartedin interfaceEventListener- Parameters:
connId- Identifier of FTP connectionremoteFilename- remote file name
-
uploadCompleted
Notifies that an upload has completed- Specified by:
uploadCompletedin interfaceEventListener- Parameters:
connId- Identifier of FTP connectionremoteFilename- remote file name
-
bytesTransferred
Report the number of bytes transferred so far. This may not be entirely accurate for transferring text files in ASCII mode, as new line representations can be represented differently on different platforms.- Specified by:
bytesTransferredin interfaceEventListener- Parameters:
connId- Identifier of FTP connectionremoteFilename- Name of remote filecount- count of bytes transferred
-