org.apache.ftpserver
Class ConnectionService

java.lang.Object
  extended byorg.apache.ftpserver.ConnectionService

public class ConnectionService
extends java.lang.Object

Ftp connection service class. It tracks all ftp connections.

Author:
Rana Bhattacharyya

Constructor Summary
ConnectionService(FtpConfig cfg)
          Constructor.
 
Method Summary
 void closeAllConnections()
          Close all - close all the connections.
 void closeConnection(java.lang.String sessId)
          Close ftp connection for this session id.
 void dispose()
          Dispose connection service.
 java.util.List getAllUsers()
          It returns a list of all the currently connected users.
 BaseFtpConnection getConnection(java.lang.String sessId)
          Get connection object
 FtpConnectionObserver getObserver()
          Get the observer.
 boolean login(FtpUser thisUser)
          User login method.
 void newConnection(BaseFtpConnection newCon)
          New connection has been established - not yet logged-in.
 void resetAllSpyObjects()
          Reset all spy objects
 void setObserver(FtpConnectionObserver obsr)
          Set user manager observer.
 void setSpyObject(java.lang.String sessId, SpyConnectionInterface spy)
          Set connection spy object
 void timerTask()
          Timer thread will call this method periodically to close inactice connections and load user information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionService

public ConnectionService(FtpConfig cfg)
                  throws java.lang.Exception
Constructor. Start scheduler job.

Method Detail

getAllUsers

public java.util.List getAllUsers()
It returns a list of all the currently connected users.


setObserver

public void setObserver(FtpConnectionObserver obsr)
Set user manager observer.


getObserver

public FtpConnectionObserver getObserver()
Get the observer.


login

public boolean login(FtpUser thisUser)
User login method. If successfull, populates the user object.


closeConnection

public void closeConnection(java.lang.String sessId)
Close ftp connection for this session id.


closeAllConnections

public void closeAllConnections()
Close all - close all the connections.


newConnection

public void newConnection(BaseFtpConnection newCon)
New connection has been established - not yet logged-in.


setSpyObject

public void setSpyObject(java.lang.String sessId,
                         SpyConnectionInterface spy)
Set connection spy object


getConnection

public BaseFtpConnection getConnection(java.lang.String sessId)
Get connection object


resetAllSpyObjects

public void resetAllSpyObjects()
Reset all spy objects


timerTask

public void timerTask()
Timer thread will call this method periodically to close inactice connections and load user information.


dispose

public void dispose()
Dispose connection service. If logs out all the connected users and stops the cleaner thread.



Copyright © 2001-2007 Codehaus. All Rights Reserved.