|
FTP-Server API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--server.UserSession
The class represents a session from a client. It is automatically instantiated by the server, when the client connects, and are send though the ServerObserver interface to the observers.
Field Summary | |
protected HashSet |
obs
All the UserSessionObservers on this UserSession |
protected int |
state
|
Constructor Summary | |
protected |
UserSession()
ONLY a Server (Probe) can and may 'make instances' of this class! |
Method Summary | |
void |
abortTransmission()
Aborts this clients current filetransmission. |
void |
addUserSessionObserver(UserSessionObserver userSessionObserver)
Adds an observer |
void |
disconnectClient(int reasonCode)
Kicks the client from the server, and cancels the filetransfer if any. |
InetAddress |
getClientInetAddress()
Returns the clients InetAddresse |
String |
getClientIP()
The clients ip. |
XMLTag |
getClientTag()
Returns the clients own XMLTag. |
Vector |
getConversation()
Al communication between the client and the server. |
String |
getLogin()
The login name of the client |
String |
getLogonTime()
The time the client logged onto the server. |
Date |
getLogonTimeAsDate()
The time the client logged onto the server |
int |
getNumberOfRecivedFiles()
The total number of files that has been recived from this client. |
int |
getNumberOfSendFiles()
The total number of send files to this client |
int |
getRecivedByteTotal()
The total number of recived bytes from this client. |
int |
getSendBytesInFile()
The number of bytes, that thas been transfered in the actuel filetransfer. |
int |
getSendByteTotal()
The total number of send bytes to this client. |
int |
getSessionNr()
This usersessions sessionnumber |
int |
getSpeedInBytesPrSek()
The number for bytes per second, that the current file are transmitted with. |
int |
getUserState()
States this client can bee in (online, kicked, banned ect.) |
boolean |
isFileDownload()
Whether the current file is downloading from the client or not. |
boolean |
isFileUpload()
Whether the current file is upload to the client or not. |
boolean |
isLogedIn()
Is the Client loged in? |
void |
removeUserSessionObserver(UserSessionObserver userSessionObserver)
Removes an observer |
boolean |
sendingFile()
Is there an upload/download/directorytransfer going on? |
protected void |
set(Session ses,
Command com)
Sets the classes references. |
void |
setSpeedInBytesPrSek(int bytes)
The number of bytes, that the server may transfer to this client per second. |
void |
tellClient(String line)
Writes a line to the client over the command-connection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected HashSet obs
protected int state
server.event.UserSessionObserver
Constructor Detail |
protected UserSession()
Method Detail |
protected void set(Session ses, Command com)
ses
- Sessioncom
- Commandpublic void addUserSessionObserver(UserSessionObserver userSessionObserver)
userSessionObserver
- observerpublic void removeUserSessionObserver(UserSessionObserver userSessionObserver)
userSessionObserver
- public InetAddress getClientInetAddress()
public String getClientIP()
Session
getClientIP
in interface Session
public XMLTag getClientTag()
public boolean isFileUpload()
public boolean isFileDownload()
public int getSpeedInBytesPrSek()
public void setSpeedInBytesPrSek(int bytes)
bytes
- bytes per secondpublic int getSendBytesInFile()
public int getSendByteTotal()
public int getRecivedByteTotal()
public int getNumberOfSendFiles()
public int getNumberOfRecivedFiles()
public void abortTransmission()
public boolean sendingFile()
public int getSessionNr()
getSessionNr
in interface Session
public void disconnectClient(int reasonCode)
public void tellClient(String line)
line
- The text to send to the client!public String getLogin()
getLogin
in interface Session
public Date getLogonTimeAsDate()
public String getLogonTime()
Session
getLogonTime
in interface Session
public Vector getConversation()
Session
getConversation
in interface Session
public boolean isLogedIn()
public int getUserState()
server.event.UserSessionObserver
|
FTP-Server API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |