FTP-Server API

server.event
Interface UserSessionObserver

All Known Implementing Classes:
Sniffer, UserSessionObserverAdapter

public interface UserSessionObserver

Must be implemented by those, who wishes to listen on a UserSession-Object (a client).


Field Summary
static int USER_AUTO_BANNED
           
static int USER_BANNED
           
static int USER_KICKED
           
static int USER_KICKED_DUE_TO_SERVER_STOP
           
static int USER_NORMAL_END
           
static int USER_ONLINE
           
static int USER_TIMEOUT
           
 
Method Summary
 void bytesTransmitted(long[] data)
          When a file is beeing transfered, this method is called every time the server has transfered the number of bytes, that the clients may have per sek.
 void commandUpdate(String command)
          All the client sends to the server is send though here as an echo!
 void fileTransferEnded(boolean successfull)
          When a fileTransfer has ended, the method is called.
 void fileTransferStarted(File filename)
          When a fileTransfer has started, the method is called.
 void serverResponse(String response)
          All the server sends to the client is send though here as an echo!
 void userDisconnected(UserSession userSession, int reasonCode)
          When a user gets disconnected, this method is called
 void userLogedIn(UserSession usersession)
          When the user logs in, this method is called.
 void userLogedOut(UserSession usersession)
          When a user loges out, this method is called.
 

Field Detail

USER_ONLINE

public static final int USER_ONLINE
See Also:
Constant Field Values

USER_NORMAL_END

public static final int USER_NORMAL_END
See Also:
Constant Field Values

USER_KICKED

public static final int USER_KICKED
See Also:
Constant Field Values

USER_TIMEOUT

public static final int USER_TIMEOUT
See Also:
Constant Field Values

USER_BANNED

public static final int USER_BANNED
See Also:
Constant Field Values

USER_AUTO_BANNED

public static final int USER_AUTO_BANNED
See Also:
Constant Field Values

USER_KICKED_DUE_TO_SERVER_STOP

public static final int USER_KICKED_DUE_TO_SERVER_STOP
See Also:
Constant Field Values
Method Detail

commandUpdate

public void commandUpdate(String command)
All the client sends to the server is send though here as an echo!

Parameters:
command - command recived from the client

serverResponse

public void serverResponse(String response)
All the server sends to the client is send though here as an echo!

Parameters:
response - response send to the client

fileTransferStarted

public void fileTransferStarted(File filename)
When a fileTransfer has started, the method is called.

Parameters:
filename - The file, that is beeing uploaded or downloaded.

fileTransferEnded

public void fileTransferEnded(boolean successfull)
When a fileTransfer has ended, the method is called.

Parameters:
successfull - true=success, false=abort

bytesTransmitted

public void bytesTransmitted(long[] data)
When a file is beeing transfered, this method is called every time the server has transfered the number of bytes, that the clients may have per sek.

Parameters:
data - long[] arr = {startAt, transfered, file.length()};

userLogedIn

public void userLogedIn(UserSession usersession)
When the user logs in, this method is called.

Parameters:
usersession - The user that loged in..

userLogedOut

public void userLogedOut(UserSession usersession)
When a user loges out, this method is called.

Parameters:
usersession - The user that loged out..

userDisconnected

public void userDisconnected(UserSession userSession,
                             int reasonCode)
When a user gets disconnected, this method is called

Parameters:
userSession - the user, that is disconnected
reasonCode - the reason for the disconnection. (see the USER_?? statics above)

FTP-Server API