com.languagecomputer.client
Class BatchWebClient

java.lang.Object
  extended by com.languagecomputer.client.WebClient
      extended by com.languagecomputer.client.BatchWebClient
Direct Known Subclasses:
StreamingBatchWebClient

public class BatchWebClient
extends WebClient

WebClient For batch processing Files.

Since:
1.0
Author:
Toby Jungen / Matt Titsworth

Field Summary
 
Fields inherited from class com.languagecomputer.client.WebClient
ANNOTATION_META_SERVICE, ATTRIBUTE_SERVICE, COREFERENCE_SERVICE, DOCUMENT_SERVICE, ENTITY_SERVICE, EVENT_SERVICE, INDEX_SERVICE, SPATIAL_SERVICE, TEMPORAL_SERVICE
 
Constructor Summary
BatchWebClient(String host, List<String> services)
          Creates a new BatchWebClient with the services located on the given host.
 
Method Summary
protected static List<String> getFiles(String path)
          Recursively constructs a list of all files within a directory.
 String getHost(String service)
          Returns the default host (localhost).
static void main(String[] args)
          Client driver, called from command line.
protected  Document process(String file)
          Processes the given file as either a URL or File.
 void runBatch(List<String> filesToProcess)
          Runs the given files through the chosen services.
 void setIndexPath(String indexPath)
          Sets the index path for the IndexService.
 
Methods inherited from class com.languagecomputer.client.WebClient
getAnnotationMetaService, getAttributeService, getConnectTimeout, getCoreferenceService, getDocumentService, getEntityService, getEventService, getIndexService, getPort, getReceiveTimeout, getSpatialService, getTemporalService, getURL, print, setSessionID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchWebClient

public BatchWebClient(String host,
                      List<String> services)
Creates a new BatchWebClient with the services located on the given host.

Method Detail

main

public static void main(String[] args)
                 throws Exception
Client driver, called from command line.

Parameters:
args - Command line arguments.
Throws:
Exception - In case of service call failure.

getFiles

protected static List<String> getFiles(String path)
Recursively constructs a list of all files within a directory.


getHost

public String getHost(String service)
Returns the default host (localhost). May be overriden to change which host is used for the given service.

Overrides:
getHost in class WebClient

setIndexPath

public void setIndexPath(String indexPath)
Sets the index path for the IndexService.


runBatch

public void runBatch(List<String> filesToProcess)
              throws Exception
Runs the given files through the chosen services.

Throws:
Exception

process

protected Document process(String file)
                    throws IOException
Processes the given file as either a URL or File.

Throws:
IOException


Copyright © 2009. All Rights Reserved.