public class CommandHandler extends java.lang.Object implements ClientCommandHandler, ClientEventHandler
= Protocol =
Each response starts with a status.
Command | Param | Effect |
---|---|---|
start | <<target>> | Starts target. |
stop | <<target>> | Stops target. |
restart | <<target>> | =stop+start command |
shutdown | Stops server and self. | |
kill or exit | Stops server and self and kill all threads. | |
info | <<target>> | Information about target. |
noclient | <<target>> | No Client connected to the target. |
running | <<target>> | Checks if target is running. |
get | <<target>> maxClient | Gets max no of client for the target. |
get | <<target>> port | Gets port for the target. |
get | <<target>> maxAuthTryMsg | Gets maxAuthTryMsg for the target. |
get | <<target>> clientCommandHandler | Gets ClientCommandHandler class for the target. |
get | <<target>> clientAuthenticationHandler | Gets ClientAuthenticationHandler class for the target. |
get | <<target>> clientData | Gets ClientData class for the target. |
get | <<target>> timeout | Gets timeout set for clients for the target. |
set | <<target>> maxClient <<value>> | Sets max no of client for the target. |
set | <<target>> port <<value>> | Sets port for the target.* |
set | <<target>> maxAuthTryMsg <<value>> | Sets maxAuthTryMsg for the target. * |
set | <<target>> clientCommandHandler <<value>> | Sets ClientCommandHandler class for the target. * |
set | <<target>> clientAuthenticationHandler <<value>> | Sets ClientAuthenticationHandler class for the target. * |
set | <<target>> clientData <<value>> | Sets ClientData class for the target. * |
set | <<target>> timeout <<value>> | Sets timeout set for clients for the target. * |
version | Gets the version of the QuickServer library used. | |
quit | Close session. | |
New Command in v1.2 | ||
get | self plugin | Gets pluggable command handler for QsAdminServer. * |
set | self plugin <<full class name>> | Sets Pluggable command handler for QsAdminServer. * |
New Command in v1.3 | ||
suspendService | <<target>> | Suspends target. |
resumeService | <<target>> | Resume target. |
get | <<target>> maxAuthTry | Gets maxAuthTry for the target. |
set | <<target>> maxAuthTry | Sets maxAuthTry for the target.* |
get | <<target>> clientObjectHandler | Gets ClientObjectHandler class for the target. |
set | <<target>> clientObjectHandler | Sets ClientObjectHandler class for the target.* |
get | <<target>> timeoutMsg | Gets timeout Message for the target. |
set | <<target>> timeoutMsg | Sets timeout Message for the target.* |
get | <<target>> serviceState | Gets Service State for the target. |
get | <<target>> consoleLoggingFormatter | Sets consoleLoggingFormatter for the target. |
set | <<target>> consoleLoggingFormatter | Sets consoleLoggingFormatter for the target. |
get | <<target>> consoleLoggingLevel | Sets consoleLoggingLevel for the target. |
set | <<target>> consoleLoggingLevel | Sets consoleLoggingLevel for the target. [ SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST |
set | <<target>> maxClientMsg | Sets maxClientMsg for the target. |
get | <<target>> maxClientMsg | Gets maxClientMsg for the target. |
New Command in v1.3.1 | ||
set | <<target>> loggingLevel | Sets LoggingLevel for the target. [ SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST |
New Command in v1.3.2 | ||
memoryInfo | Memory Information {Total:Used:Max} | |
set | <<target>> communicationLogging | Sets communication logging flag for the target. |
get | <<target>> communicationLogging | Gets communication logging flag for the target. |
set | <<target>> objectPoolConfig-maxActive | Sets maxActive of objectPoolConfig for the target. |
get | <<target>> objectPoolConfig-maxActive | Gets maxActive of objectPoolConfig for the target. |
set | <<target>> objectPoolConfig-maxIdle | Sets maxIdle of objectPoolConfig for the target. |
get | <<target>> objectPoolConfig-maxIdle | Gets maxIdle of objectPoolConfig for the target. |
New Command in v1.4.5 | ||
all-pool-info | <<target>> | Gives stats of all pools for the target. |
client-thread-pool-dump | <<target>> | Gives dump of all threads in pool for the target. |
start | <<console>> | Starts console shell. |
stop | <<console>> | Stops console shell. |
New Command in v1.4.6 | ||
client-handler-pool-dump | <<target>> | Gives dump of all ClientHandler in pool for the target. |
get | <<target>> clientEventHandler | Gets ClientEventHandler class for the target. |
set | <<target>> clientEventHandler <<value>> | Sets ClientEventHandler class for the target. * |
get | <<target>> clientWriteHandler | Gets ClientWriteHandler class for the target. |
set | <<target>> clientWriteHandler <<value>> | Sets ClientWriteHandler class for the target. * |
get | <<target>> clientExtendedEventHandler | Gets ClientExtendedEventHandler class for the target. |
set | <<target>> clientExtendedEventHandler <<value>> | Sets ClientExtendedEventHandler class for the target. * |
set | <<target>> objectPoolConfig-initSize | Sets initSize of objectPoolConfig for the target. |
get | <<target>> objectPoolConfig-initSize | Gets initSize of objectPoolConfig for the target. |
New Command in v2.0.0 | ||
kill-clients-all | <<target>> | Kill all ClientHandler/Client in pool for the target. |
kill-client-with | <<target>> <<search term>> | Kill all ClientHandler/Client in pool for the target which has the search term n toString (check client-handler-pool-dump command for the format). |
jvm | dumpJmapHisto file | Dump JMAP to file |
jvm | dumpJmapHisto log | Dump JMAP to jdk log |
jvm | dumpJStack file | Dump JStack to file |
jvm | dumpJStack log | Dump JStack to jdk log |
jvm | threadDump file | Take thread dump to file |
jvm | threadDump log | Take thread dump to jdk log |
jvm | dumpHeap | Dump Heap to file |
* = Take effect after a restart command. value if set null then key will be set to null
|
restart
and start
response just indicate only
if command was sent. Do check the state of the target using
running
command to see if server was started successful.
noClient server
noClient self
get server maxClient
set server maxClient 10
Constructor and Description |
---|
CommandHandler() |
Modifier and Type | Method and Description |
---|---|
void |
closingConnection(ClientHandler handler)
Method called when client connection is closed.
|
void |
gotConnected(ClientHandler handler)
Method called when there is a new client connects
to the QuickServer.
|
void |
handleCommand(ClientHandler handler,
java.lang.String command)
Method called every time client sends character/string data.
|
void |
lostConnection(ClientHandler handler)
Method called when client connection is lost.
|
public void gotConnected(ClientHandler handler) throws java.net.SocketTimeoutException, java.io.IOException
ClientEventHandler
gotConnected
in interface ClientEventHandler
java.net.SocketTimeoutException
- if socket times outjava.io.IOException
- if io error in socketpublic void lostConnection(ClientHandler handler) throws java.io.IOException
ClientEventHandler
lostConnection
in interface ClientEventHandler
java.io.IOException
- if io error in socketpublic void closingConnection(ClientHandler handler) throws java.io.IOException
ClientEventHandler
closingConnection
in interface ClientEventHandler
java.io.IOException
- if io error in socketpublic void handleCommand(ClientHandler handler, java.lang.String command) throws java.net.SocketTimeoutException, java.io.IOException
ClientCommandHandler
handleCommand
in interface ClientCommandHandler
java.net.SocketTimeoutException
- if socket times outjava.io.IOException
- if io error in socketCopyright © 2003-2014 QuickServer.org