|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.Prominic.jFTPd.AdminConnection
public class AdminConnection
jFTPd opens up an administrative port which you can use to control it.
It is a plain text socket used to send various commands to which jFTPd reacts.
These commands are "shutdown", "version" and "stats".
The "shutdown" command stops the jftpd server (active transfers are stopped too)
The "version" command returns a string with jFTPd version
The "stats" command returns a string containg some basic statistics (such as
numner of files/bytes transferred).
Creation date: (4/19/2001 4:50:42 PM)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected static FTPHandler |
ftpHandler
The server object. |
private java.lang.String |
localAddress
|
private int |
port
|
private static boolean |
running
|
private java.net.ServerSocket |
server
|
private int |
SIG_CHK
|
private int |
SIG_DUMM
|
private int |
SIG_KILL
|
private int |
SIG_STAT
|
private static java.util.Vector |
vectorOfThreads
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
AdminConnection(int portToListenTo)
Default constructor. |
Method Summary | |
---|---|
static void |
deletePidFile()
Delets jFTPd pid file (it does nothing on Windows). |
private java.lang.String |
getAddressAsString(java.net.InetAddress address)
Given an InetAddress, it returns it's IP in a string form. |
void |
processConnection(java.net.Socket client)
Handles the communication with the clients that connect to the admin port. |
java.lang.String |
readMessage(java.net.Socket client)
Reads a message from the client. |
void |
run()
When an object implementing interface Runnable is used
to create a thread, starting the thread causes the object's
run method to be called in that separately executing
thread. |
void |
sendMessage(java.net.Socket client,
java.lang.String message)
Sends a message to the client. |
static void |
shutdownJFTPD()
Stops the server and shuts down the admin connection. |
static void |
stopAdminConnection()
This stops the admin connection, breaking the internal loop. |
int |
talkWithClient(java.net.Socket client)
Talks with the client in order to find out which signal to send to the Shutdownable thread. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static java.util.Vector vectorOfThreads
private static boolean running
private java.net.ServerSocket server
private int port
private java.lang.String localAddress
private int SIG_KILL
private int SIG_STAT
private int SIG_CHK
private int SIG_DUMM
protected static FTPHandler ftpHandler
Constructor Detail |
---|
public AdminConnection(int portToListenTo)
portToListenTo
- the port where the admin connection should be bound to.Method Detail |
---|
public static void deletePidFile()
private java.lang.String getAddressAsString(java.net.InetAddress address)
address
- - InetAddress object
public void processConnection(java.net.Socket client)
client
- - socket where the client is connected.
Creation date: (4/19/2001 5:19:17 PM)public java.lang.String readMessage(java.net.Socket client) throws java.io.IOException
java.io.IOException
public void run()
Runnable
is used
to create a thread, starting the thread causes the object's
run
method to be called in that separately executing
thread.
The general contract of the method run
is that it may
take any action whatsoever.
This opens up a server socket on the port passed to the constructor.
Sets thje timeout to 10 seconds.
run
in interface java.lang.Runnable
run
in class java.lang.Thread
Thread.run()
public void sendMessage(java.net.Socket client, java.lang.String message) throws java.io.IOException
message
- message to be sent to the client.
java.io.IOException
public static void shutdownJFTPD()
public static void stopAdminConnection()
public int talkWithClient(java.net.Socket client) throws java.io.IOException
client
- - client socket.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |