com.languagecomputer.client
Class WebClient

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

public class WebClient
extends Object

Base web service client.

Since:
1.0
Author:
Kirk Roberts

Field Summary
static String ANNOTATION_META_SERVICE
           
static String ATTRIBUTE_SERVICE
           
static String COREFERENCE_SERVICE
           
static String DOCUMENT_SERVICE
           
static String ENTITY_SERVICE
           
static String EVENT_SERVICE
           
static String INDEX_SERVICE
           
static String SPATIAL_SERVICE
           
static String TEMPORAL_SERVICE
           
 
Constructor Summary
WebClient()
          Creates a new WebClient.
 
Method Summary
 AnnotationMetaServiceWebClient getAnnotationMetaService()
          Returns the lazy-loaded AnnotationMetaService.
 AttributeServiceWebClient getAttributeService()
          Returns the lazy-loaded AttributeService.
 int getConnectTimeout(String service)
          Returns the default connect timeout (2 seconds).
 CoreferenceServiceWebClient getCoreferenceService()
          Returns the lazy-loaded CoreferenceService.
 DocumentServiceWebClient getDocumentService()
          Returns the lazy-loaded DocumentService.
 EntityServiceWebClient getEntityService()
          Returns the lazy-loaded EntityService.
 EventServiceWebClient getEventService()
          Returns the lazy-loaded EventService.
 String getHost(String service)
          Returns the default host (localhost).
 IndexServiceWebClient getIndexService()
          Returns the lazy-loaded IndexService.
 int getPort(String service)
          Returns the default port number (8300).
 int getReceiveTimeout(String service)
          Returns the receive timeout (1 minute).
 SpatialServiceWebClient getSpatialService()
          Returns the lazy-loaded SpatialService.
 TemporalServiceWebClient getTemporalService()
          Returns the lazy-loaded TemporalService.
 String getURL(String service)
          Returns the default URL (using the default host and port and the given service).
static void print(Document document)
          Prints the Document contents and annotations to stdout.
 void setSessionID(String service, String sessionID)
          Helper method to set the sessionID for the given service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCUMENT_SERVICE

public static final String DOCUMENT_SERVICE
See Also:
Constant Field Values

ENTITY_SERVICE

public static final String ENTITY_SERVICE
See Also:
Constant Field Values

EVENT_SERVICE

public static final String EVENT_SERVICE
See Also:
Constant Field Values

SPATIAL_SERVICE

public static final String SPATIAL_SERVICE
See Also:
Constant Field Values

TEMPORAL_SERVICE

public static final String TEMPORAL_SERVICE
See Also:
Constant Field Values

ATTRIBUTE_SERVICE

public static final String ATTRIBUTE_SERVICE
See Also:
Constant Field Values

COREFERENCE_SERVICE

public static final String COREFERENCE_SERVICE
See Also:
Constant Field Values

INDEX_SERVICE

public static final String INDEX_SERVICE
See Also:
Constant Field Values

ANNOTATION_META_SERVICE

public static final String ANNOTATION_META_SERVICE
See Also:
Constant Field Values
Constructor Detail

WebClient

public WebClient()
Creates a new WebClient.

Method Detail

getPort

public int getPort(String service)
Returns the default port number (8300). May be overriden to change which port is used for the given service.


getHost

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


getURL

public String getURL(String service)
Returns the default URL (using the default host and port and the given service). May be overriden to change which URL is used for the service.


getConnectTimeout

public int getConnectTimeout(String service)
Returns the default connect timeout (2 seconds). May be overriden to change the connect timeout for the given service.


getReceiveTimeout

public int getReceiveTimeout(String service)
Returns the receive timeout (1 minute). May be overriden to change the receive timeout for the given service.


getDocumentService

public DocumentServiceWebClient getDocumentService()
Returns the lazy-loaded DocumentService.


getEntityService

public EntityServiceWebClient getEntityService()
Returns the lazy-loaded EntityService.


getEventService

public EventServiceWebClient getEventService()
Returns the lazy-loaded EventService.


getSpatialService

public SpatialServiceWebClient getSpatialService()
Returns the lazy-loaded SpatialService.


getTemporalService

public TemporalServiceWebClient getTemporalService()
Returns the lazy-loaded TemporalService.


getAttributeService

public AttributeServiceWebClient getAttributeService()
Returns the lazy-loaded AttributeService.


getCoreferenceService

public CoreferenceServiceWebClient getCoreferenceService()
Returns the lazy-loaded CoreferenceService.


getIndexService

public IndexServiceWebClient getIndexService()
Returns the lazy-loaded IndexService.


getAnnotationMetaService

public AnnotationMetaServiceWebClient getAnnotationMetaService()
Returns the lazy-loaded AnnotationMetaService.


setSessionID

public void setSessionID(String service,
                         String sessionID)
Helper method to set the sessionID for the given service. Particularly useful when iterating over a list of services by their String identifiers.


print

public static void print(Document document)
Prints the Document contents and annotations to stdout.



Copyright © 2009. All Rights Reserved.