|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Interface to a client for the poplog doc server a new client should be created in a way such that the &tl;msg type>Received methods are called from whithin the run() or main parsing method of the object, and overriden to provide event handling to the calling classes.
| Method Summary | |
void |
clientConnected()
Should be called when the client connects to the server |
void |
clientDisconnected()
Should be called when the client disconnects from the server |
void |
close()
Close connection with server |
void |
connect(java.lang.String servername,
int port)
Connect to the server |
void |
docReceived(java.io.BufferedReader doc)
Should be called when the server sends a document. |
void |
errorReceived(java.io.BufferedReader err)
Should be called when the server sends an error. |
void |
exceptionGenerated(java.lang.Exception e)
Called when a non-fatal exception is generated |
void |
getDoc(java.lang.String type,
java.lang.String name)
send a doc request to sever |
void |
getHelp()
send a help request to sever |
void |
getInfo()
send an info request to sever |
void |
getLicense()
send a license request to sever |
void |
getList(java.lang.String type)
send a list request to sever |
void |
getVersion()
send a version request to sever |
void |
helpReceived(java.io.BufferedReader hlp)
Should be called when the server sends its help. |
boolean |
isConnected()
Check if the client is connected |
void |
licenseReceived(java.io.BufferedReader lic)
Should be called when the server sends a license. |
void |
listReceived(java.io.BufferedReader list)
Should be called when the server sends a list. |
void |
messageReceived(java.io.BufferedReader msg)
Should be called when the server sends a message. |
void |
parse(java.lang.String line)
Parses a line of text into a statement that can be sent to the server |
void |
println(java.lang.String line)
Prints a line to the server |
void |
run()
Main processing method for the ClientInterface object |
void |
warningReceived(java.io.BufferedReader warn)
Should be called when the server sends a warning. |
| Method Detail |
public void println(java.lang.String line)
line - The line to printpublic boolean isConnected()
public void parse(java.lang.String line)
throws ClientException
line - The text to parse
ClientException - When something goes wrong
public void connect(java.lang.String servername,
int port)
throws java.net.UnknownHostException,
java.io.IOException
servername - Name of the serverport - The port the server listens to
java.net.UnknownHostException - When the host can't be found
java.io.IOException - When IO to the host can't be got
public void close()
throws java.io.IOException
java.io.IOExceptionpublic void listReceived(java.io.BufferedReader list)
list - The list received from the server as a BufferedReader.public void clientConnected()
public void clientDisconnected()
public void docReceived(java.io.BufferedReader doc)
doc - The document received from the server as a BufferedReader.public void messageReceived(java.io.BufferedReader msg)
msg - The message received from the server as a BufferedReader.public void warningReceived(java.io.BufferedReader warn)
warn - The warning received from the server as a BufferedReader.public void errorReceived(java.io.BufferedReader err)
err - The error received from the server as a BufferedReader.public void helpReceived(java.io.BufferedReader hlp)
hlp - The help received from the server as a BufferedReader.public void licenseReceived(java.io.BufferedReader lic)
lic - The license received from the server as a BufferedReader.public void run()
ClientInterface object
run in interface java.lang.Runnable
public void getDoc(java.lang.String type,
java.lang.String name)
throws ClientException
type - name -
ClientExceptionpublic void getList(java.lang.String type)
type - public void getHelp()
public void getInfo()
public void getVersion()
public void getLicense()
public void exceptionGenerated(java.lang.Exception e)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||