|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectNetLogClient
The client side of the software that implements the remote logging capabilities for the drink software. The client simply connects to the server and sends the messages to the server. The server will log the date, the source machine, and the actual message.
| Nested Class Summary | |
private class |
NetLogClient.LogConnectionMgr
This inner class is designed to maintain the socket connection from the NetLogClient to the NetLogServer. |
| Field Summary | |
private Socket |
connection
The connection to the server which actually stores the log. |
private String |
host
The hostname or IP of the host we are connected to. |
private PrintWriter |
output
The PrintWriter that is connected to the socket that we use for sending the log message to the server. |
private int |
port
The port on the server that we are connected to. |
| Constructor Summary | |
NetLogClient(ConfigMgr configMgr)
Set up the class using the configuration values from the given ConfigMgr. |
|
| Method Summary | |
void |
initialize(String host,
int port)
Set up the client-side of the networked logging software. |
private void |
printDemarcation()
A small helper method to print the demarcation that is printed when a new server session is started. |
void |
println(String message)
Logs a message to the server. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private Socket connection
private String host
private int port
private PrintWriter output
| Constructor Detail |
public NetLogClient(ConfigMgr configMgr)
configMgr - Where to get our runtime configuration values from.| Method Detail |
public void initialize(String host,
int port)
host - The hostname or IP of the machine to use as the server.port - The port on the host machine to connect to.public void println(String message)
println in interface DrinkLoggerSpecmessage - The message to send to the server. The message should not
not contain any time stamp or other such meta-data.
The server will include this data. The message should
contain just that - only the actual message.private void printDemarcation()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||