org.apache.ftpserver.impl
Class DefaultFtpStatistics

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

public class DefaultFtpStatistics
extends java.lang.Object
implements ServerFtpStatistics

Internal class, do not use directly. This is FTP statistics implementation. TODO revisit concurrency, right now we're a bit over zealous with both Atomic* counters and synchronization

Version:
$Rev: 733158 $, $Date: 2009-01-09 22:37:49 +0100 (Fri, 09 Jan 2009) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Field Summary
static java.lang.String LOGIN_NUMBER
           
 
Constructor Summary
DefaultFtpStatistics()
           
 
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, FtpFile file)
          Increment delete count.
 void setDownload(FtpIoSession session, FtpFile 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, FtpFile file)
          Increment make directory count.
 void setObserver(StatisticsObserver observer)
          Set the observer.
 void setOpenConnection(FtpIoSession session)
          Increment open connection count.
 void setRmdir(FtpIoSession session, FtpFile file)
          Increment remove directory count.
 void setUpload(FtpIoSession session, FtpFile 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

DefaultFtpStatistics

public DefaultFtpStatistics()
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
Returns:
The Date when the server started

getTotalUploadNumber

public int getTotalUploadNumber()
Get number of files uploaded.

Specified by:
getTotalUploadNumber in interface FtpStatistics
Returns:
The total number of uploads

getTotalDownloadNumber

public int getTotalDownloadNumber()
Get number of files downloaded.

Specified by:
getTotalDownloadNumber in interface FtpStatistics
Returns:
The total number of downloads

getTotalDeleteNumber

public int getTotalDeleteNumber()
Get number of files deleted.

Specified by:
getTotalDeleteNumber in interface FtpStatistics
Returns:
The total number of deletions

getTotalUploadSize

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

Specified by:
getTotalUploadSize in interface FtpStatistics
Returns:
The total number of bytes uploaded

getTotalDownloadSize

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

Specified by:
getTotalDownloadSize in interface FtpStatistics
Returns:
The total number of bytes downloaded

getTotalDirectoryCreated

public int getTotalDirectoryCreated()
Get total directory created.

Specified by:
getTotalDirectoryCreated in interface FtpStatistics
Returns:
The total number of created directories

getTotalDirectoryRemoved

public int getTotalDirectoryRemoved()
Get total directory removed.

Specified by:
getTotalDirectoryRemoved in interface FtpStatistics
Returns:
The total number of removed directories

getTotalConnectionNumber

public int getTotalConnectionNumber()
Get total number of connections.

Specified by:
getTotalConnectionNumber in interface FtpStatistics
Returns:
The total number of connections

getCurrentConnectionNumber

public int getCurrentConnectionNumber()
Get current number of connections.

Specified by:
getCurrentConnectionNumber in interface FtpStatistics
Returns:
The current number of connections

getTotalLoginNumber

public int getTotalLoginNumber()
Get total number of logins.

Specified by:
getTotalLoginNumber in interface FtpStatistics
Returns:
The total number of logins

getTotalFailedLoginNumber

public int getTotalFailedLoginNumber()
Get total failed login number.

Specified by:
getTotalFailedLoginNumber in interface FtpStatistics
Returns:
The total number of failed logins

getCurrentLoginNumber

public int getCurrentLoginNumber()
Get current number of logins.

Specified by:
getCurrentLoginNumber in interface FtpStatistics
Returns:
The current number of logins

getTotalAnonymousLoginNumber

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

Specified by:
getTotalAnonymousLoginNumber in interface FtpStatistics
Returns:
The total number of anonymous logins

getCurrentAnonymousLoginNumber

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

Specified by:
getCurrentAnonymousLoginNumber in interface FtpStatistics
Returns:
The current number of anonymous logins

getCurrentUserLoginNumber

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

Specified by:
getCurrentUserLoginNumber in interface FtpStatistics
Parameters:
user - The User for which to retrieve the number of logins
Returns:
The total number of logins for the provided user

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
Returns:
The total number of logins for the provided user and IP address

setUpload

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

Specified by:
setUpload in interface ServerFtpStatistics

setDownload

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

Specified by:
setDownload in interface ServerFtpStatistics

setDelete

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

Specified by:
setDelete in interface ServerFtpStatistics

setMkdir

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

Specified by:
setMkdir in interface ServerFtpStatistics

setRmdir

public void setRmdir(FtpIoSession session,
                     FtpFile 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-2011 Apache Software Foundation. All Rights Reserved.