|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--uk.org.iscream.cms.server.clientinterface.TCPControlHandler
Acts as a Control Handler to a TCP based client.
Field Summary | |
private String |
_clientName
The name of the Client we're connected to |
private ConfigurationManager |
_configManager
A reference to the Configuration Manager the system is using |
private TCPDataHandler |
_dataHandler
A reference to the DataHandler, if there is one |
private String |
_hostList
The host list the Client has requested |
private Logger |
_logger
This holds a reference to the system logger that is being used. |
private String |
_name
This is the friendly identifier of the component this class is running in. |
private PacketSorter |
_packetSorter
A reference to the PacketSorter. |
private Socket |
_socket
The socket we are talking on |
private BufferedReader |
_socketIn
A hook to the inbound data from the socket |
private PrintWriter |
_socketOut
A hook to the outbound stream for the socket |
static String |
PROTOVER
This is our protocol version. |
String |
REVISION
The current CVS revision of this class |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
TCPControlHandler(Socket socket,
PacketSorter packetSorter)
Construct a new TCPControlHandler, and setup the reader and writer for the new Socket. |
Method Summary | |
private boolean |
closeData()
Attempt to close down the DataHandler. |
void |
run()
This method initiates the thread, setting things up, and then reading commands from the Client. |
private void |
send(String message)
Send any String message to the outgoing Socket. |
private void |
sendERROR()
Send an ERROR message to the outgoing Socket. |
private void |
sendOK()
Send an OK message to the outgoing Socket |
String |
toString()
Overrides the Object.toString()
method to provide clean logging (every class should have this). |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final String REVISION
public static final String PROTOVER
private String _name
private Logger _logger
private ConfigurationManager _configManager
private Socket _socket
private BufferedReader _socketIn
private PrintWriter _socketOut
private PacketSorter _packetSorter
private TCPDataHandler _dataHandler
private String _clientName
private String _hostList
Constructor Detail |
public TCPControlHandler(Socket socket, PacketSorter packetSorter) throws IOException
socket
- The Socket connected to the new ClientpacketSorter
- A reference to the PacketSorter in the componentMethod Detail |
public void run()
run
in interface Runnable
run
in class Thread
public String toString()
Object.toString()
method to provide clean logging (every class should have this).
This uses the uk.org.iscream.cms.util.NameFormat class
to format the toString()
toString
in class Thread
private boolean closeData()
private void sendOK()
private void sendERROR()
private void send(String message)
message
- The message/command to send.
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |