|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.Prominic.jFTPd.GenericServer
public class GenericServer
Interface for a generic server. This server has a connection handler wich will handle each connection.
| Field Summary | |
|---|---|
(package private) boolean |
DEBUG
|
(package private) ConnectionHandler |
handler
|
(package private) int |
port
|
(package private) java.net.ServerSocket |
ss
|
protected java.util.Date |
startedOn
|
(package private) boolean |
up
|
| Constructor Summary | |
|---|---|
GenericServer(ConnectionHandler ch,
int port)
Creates a generic server on the given port and attaches a connection handler. |
|
| Method Summary | |
|---|---|
java.util.Date |
getStartedOn()
Gets the datetime when the Generic Server was created (datetime is set in the constructor). |
long |
getUptime()
Gets the server uptime in seconds. |
boolean |
isListening()
Checks if server is bound to the given port. |
void |
run()
Starts the server and invoques the connection handler's doConnection method for each connection to the server socket. |
void |
setStartedOn(java.util.Date newStartedOn)
Sets the new date for when the server was started. |
void |
stopServer()
Stops the server (closes the server socket). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final boolean DEBUG
ConnectionHandler handler
int port
java.net.ServerSocket ss
boolean up
protected java.util.Date startedOn
| Constructor Detail |
|---|
public GenericServer(ConnectionHandler ch,
int port)
ch - - connection handlerport - - port where the server socket will be created.| Method Detail |
|---|
public java.util.Date getStartedOn()
public long getUptime()
public boolean isListening()
public void run()
run in interface java.lang.Runnablepublic void setStartedOn(java.util.Date newStartedOn)
newStartedOn - - new datetime for when the server was started.public void stopServer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||