public class PingRequestHandler extends java.lang.Object implements RequestHandler
ping
command. It simply returns
OK if the command is ping
. Otherwise it returns
FAILED Unhandled command: <cmd>
.Constructor and Description |
---|
PingRequestHandler(Agent agent)
Create a new handler for the ping command.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
handleCmd(java.net.Socket incoming,
java.lang.String cmd)
Handle a command that was sent by an incoming request.
|
public PingRequestHandler(Agent agent)
agent
- The agentpublic java.lang.String handleCmd(java.net.Socket incoming, java.lang.String cmd)
RequestHandler
handleCmd
in interface RequestHandler
incoming
- The socket that is handling the communication with the
remote clientcmd
- The commandcmd=ping