edu.iastate.jtm.jmed
Class UmlsSocketClient

java.lang.Object
  extended by edu.iastate.jtm.jmed.UmlsSocketClient

public class UmlsSocketClient
extends java.lang.Object

A client utilizing UMLS server's socket query facility. This client is preferred over the UmlsQueryClient for queries with huge responses. This class should be used as inheritance. Subclasses override the processLine() method.

Author:
dingjing

Field Summary
protected static java.util.regex.Matcher endMatcher
           
protected  java.io.BufferedReader fromServer
           
protected  boolean querySent
           
protected  java.nio.CharBuffer responseBuffer
           
 
Constructor Summary
UmlsSocketClient(java.io.File template)
          Create a new UmlsSocketQuery object with a template query.
 
Method Summary
 void close()
          Close the socket connection to the server.
static void main(java.lang.String[] args)
          For test.
 void processResponse()
           
 void sendQuery(java.lang.String[] args)
          Send a query to the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endMatcher

protected static final java.util.regex.Matcher endMatcher

querySent

protected boolean querySent

fromServer

protected java.io.BufferedReader fromServer

responseBuffer

protected java.nio.CharBuffer responseBuffer
Constructor Detail

UmlsSocketClient

public UmlsSocketClient(java.io.File template)
Create a new UmlsSocketQuery object with a template query.

Parameters:
template - template query file.
Method Detail

close

public void close()
Close the socket connection to the server.


sendQuery

public void sendQuery(java.lang.String[] args)
Send a query to the server. Server's responses are processed by the callback function processLine().

Parameters:
args - query arguments to be filled in the template.

processResponse

public void processResponse()

main

public static void main(java.lang.String[] args)
For test.

Parameters:
args - the command line arguments