org.apache.ftpserver
Class FtpStatisticsImpl

java.lang.Object
  extended by org.apache.ftpserver.FtpStatisticsImpl
All Implemented Interfaces:
FtpStatistics, ServerFtpStatistics

public class FtpStatisticsImpl
extends java.lang.Object
implements ServerFtpStatistics

This is FTP statistics implementation. TODO revisit concurrency, right now we're a bit zealous with both Atomix* counters and synchronization


Field Summary
static java.lang.String LOGIN_NUMBER
           
 
Constructor Summary
FtpStatisticsImpl()
           
 
Method Summary
 int getCurrentAnonymousLoginNumber()
          Get current number of anonymous logins.
 int getCurrentConnectionNumber()
          Get current number of connections.
 int getCurrentLoginNumber()
          Get current number of logins.
 int getCurrentUserLoginNumber(User user)
          Get the login number for the specific user
 int getCurrentUserLoginNumber(User user, java.net.InetAddress ipAddress)
          Get the login number for the specific user from the ipAddress
 java.util.Date getStartTime()
          Get server start time.
 int getTotalAnonymousLoginNumber()
          Get total number of anonymous logins.
 int getTotalConnectionNumber()
          Get total number of connections.
 int getTotalDeleteNumber()
          Get number of files deleted.
 int getTotalDirectoryCreated()
          Get total directory created.
 int getTotalDirectoryRemoved()
          Get total directory removed.
 int getTotalDownloadNumber()
          Get number of files downloaded.
 long getTotalDownloadSize()
          Get total number of bytes downloaded.
 int getTotalFailedLoginNumber()
          Get total failed login number.
 int getTotalLoginNumber()
          Get total number of logins.
 int getTotalUploadNumber()
          Get number of files uploaded.
 long getTotalUploadSize()
          Get total number of bytes uploaded.
 void resetStatisticsCounters()
          Reset the cumulative counters.
 void setCloseConnection(FtpIoSession session)
          Decrement open connection count.
 void setDelete(FtpIoSession session, FileObject file)
          Increment delete count.
 void setDownload(FtpIoSession session, FileObject file, long size)
          Increment download count.
 void setFileObserver(FileObserver observer)
          Set the file observer.
 void setLogin(FtpIoSession session)
          New login.
 void setLoginFail(FtpIoSession session)
          Increment failed login count.
 void setLogout(FtpIoSession session)
          User logout
 void setMkdir(FtpIoSession session, FileObject file)
          Increment make directory count.
 void setObserver(StatisticsObserver observer)
          Set the observer.
 void setOpenConnection(FtpIoSession session)
          Increment open connection count.
 void setRmdir(FtpIoSession session, FileObject file)
          Increment remove directory count.
 void setUpload(FtpIoSession session, FileObject file, long size)
          Increment upload count.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGIN_NUMBER

public static final java.lang.String LOGIN_NUMBER
See Also:
Constant Field Values
Constructor Detail

FtpStatisticsImpl

public FtpStatisticsImpl()
Method Detail

setObserver

public void setObserver(StatisticsObserver observer)
Set the observer.

Specified by:
setObserver in interface ServerFtpStatistics

setFileObserver

public void setFileObserver(FileObserver observer)
Set the file observer.

Specified by:
setFileObserver in interface ServerFtpStatistics

getStartTime

public java.util.Date getStartTime()
Get server start time.

Specified by:
getStartTime in interface FtpStatistics

getTotalUploadNumber

public int getTotalUploadNumber()
Get number of files uploaded.

Specified by:
getTotalUploadNumber in interface FtpStatistics

getTotalDownloadNumber

public int getTotalDownloadNumber()
Get number of files downloaded.

Specified by:
getTotalDownloadNumber in interface FtpStatistics

getTotalDeleteNumber

public int getTotalDeleteNumber()
Get number of files deleted.

Specified by:
getTotalDeleteNumber in interface FtpStatistics

getTotalUploadSize

public long getTotalUploadSize()
Get total number of bytes uploaded.

Specified by:
getTotalUploadSize in interface FtpStatistics

getTotalDownloadSize

public long getTotalDownloadSize()
Get total number of bytes downloaded.

Specified by:
getTotalDownloadSize in interface FtpStatistics

getTotalDirectoryCreated

public int getTotalDirectoryCreated()
Get total directory created.

Specified by:
getTotalDirectoryCreated in interface FtpStatistics

getTotalDirectoryRemoved

public int getTotalDirectoryRemoved()
Get total directory removed.

Specified by:
getTotalDirectoryRemoved in interface FtpStatistics

getTotalConnectionNumber

public int getTotalConnectionNumber()
Get total number of connections.

Specified by:
getTotalConnectionNumber in interface FtpStatistics

getCurrentConnectionNumber

public int getCurrentConnectionNumber()
Get current number of connections.

Specified by:
getCurrentConnectionNumber in interface FtpStatistics

getTotalLoginNumber

public int getTotalLoginNumber()
Get total number of logins.

Specified by:
getTotalLoginNumber in interface FtpStatistics

getTotalFailedLoginNumber

public int getTotalFailedLoginNumber()
Get total failed login number.

Specified by:
getTotalFailedLoginNumber in interface FtpStatistics

getCurrentLoginNumber

public int getCurrentLoginNumber()
Get current number of logins.

Specified by:
getCurrentLoginNumber in interface FtpStatistics

getTotalAnonymousLoginNumber

public int getTotalAnonymousLoginNumber()
Get total number of anonymous logins.

Specified by:
getTotalAnonymousLoginNumber in interface FtpStatistics

getCurrentAnonymousLoginNumber

public int getCurrentAnonymousLoginNumber()
Get current number of anonymous logins.

Specified by:
getCurrentAnonymousLoginNumber in interface FtpStatistics

getCurrentUserLoginNumber

public int getCurrentUserLoginNumber(User user)
Get the login number for the specific user

Specified by:
getCurrentUserLoginNumber in interface FtpStatistics

getCurrentUserLoginNumber

public int getCurrentUserLoginNumber(User user,
                                     java.net.InetAddress ipAddress)
Get the login number for the specific user from the ipAddress

Specified by:
getCurrentUserLoginNumber in interface FtpStatistics
Parameters:
user - login user account
ipAddress - the ip address of the remote user

setUpload

public void setUpload(FtpIoSession session,
                      FileObject file,
                      long size)
Increment upload count.

Specified by:
setUpload in interface ServerFtpStatistics

setDownload

public void setDownload(FtpIoSession session,
                        FileObject file,
                        long size)
Increment download count.

Specified by:
setDownload in interface ServerFtpStatistics

setDelete

public void setDelete(FtpIoSession session,
                      FileObject file)
Increment delete count.

Specified by:
setDelete in interface ServerFtpStatistics

setMkdir

public void setMkdir(FtpIoSession session,
                     FileObject file)
Increment make directory count.

Specified by:
setMkdir in interface ServerFtpStatistics

setRmdir

public void setRmdir(FtpIoSession session,
                     FileObject file)
Increment remove directory count.

Specified by:
setRmdir in interface ServerFtpStatistics

setOpenConnection

public void setOpenConnection(FtpIoSession session)
Increment open connection count.

Specified by:
setOpenConnection in interface ServerFtpStatistics

setCloseConnection

public void setCloseConnection(FtpIoSession session)
Decrement open connection count.

Specified by:
setCloseConnection in interface ServerFtpStatistics

setLogin

public void setLogin(FtpIoSession session)
New login.

Specified by:
setLogin in interface ServerFtpStatistics

setLoginFail

public void setLoginFail(FtpIoSession session)
Increment failed login count.

Specified by:
setLoginFail in interface ServerFtpStatistics

setLogout

public void setLogout(FtpIoSession session)
User logout

Specified by:
setLogout in interface ServerFtpStatistics

resetStatisticsCounters

public void resetStatisticsCounters()
Reset the cumulative counters.

Specified by:
resetStatisticsCounters in interface ServerFtpStatistics


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.