public class VinciTAP extends Object
| Constructor and Description |
|---|
VinciTAP()
Instantiates a new vinci TAP.
|
| Modifier and Type | Method and Description |
|---|---|
static org.apache.uima.cas_data.CasData |
addKeysToDataCas(org.apache.uima.cas_data.CasData dataCas,
org.apache.vinci.transport.document.AFrame aFrame)
Appends keys (types) from XCAS to provided CasData instance doing conversions of ':' in WF keys
to '_colon_' and '-' to '_dash_' to enforce UIMA compliance.
|
org.apache.uima.cas_data.CasData[] |
analyze(org.apache.uima.cas_data.CasData[] aCasList,
org.apache.uima.util.ProcessTrace aPT,
String aResourceName)
Main routine that sends requests to remote vinci services.
|
org.apache.uima.cas_data.CasData |
analyze(org.apache.uima.cas_data.CasData aCas,
org.apache.uima.util.ProcessTrace aPT,
String aResourceName)
Performs Analysis of the CAS by the remote vinci service Cas Processor.
|
void |
batchProcessComplete()
Let the remote service now that end of batch marker has been reached, the notification is
one-way meaning the CPE does not expect anything back from the service.
|
void |
collectionProcessComplete()
Notify the remote service that the CPE reached end of processing.
|
void |
connect(String aServiceName)
Connects to external service using service name as a way to locate it.
|
void |
connect(String aHost,
int aPort)
Connects the proxy to Cas Processor running as a vinci service on a given host and port number.
|
org.apache.uima.resource.metadata.ProcessingResourceMetaData |
getAnalysisEngineMetaData()
Returns Cas Processor metadata as it is returned from the remote Cas Processor running as vinci
service.
|
String |
getServiceHost()
Returns host where the service is running.
|
int |
getServicePort()
Returns port of the service this proxy is connected to.
|
String |
getVNSHost()
Returns VNS Host.
|
String |
getVNSPort()
Returns VNS Port.
|
boolean |
isConnected()
Returns status of the vinci connection.
|
org.apache.vinci.transport.document.AFrame |
sendAndReceive(org.apache.vinci.transport.document.AFrame aFrame)
Send a given Vinci Frame to the remote vinci service and return result.
|
void |
setContentTag(String aContentTag)
Defines subject of analysis.
|
void |
setKeys2Drop(String[] aKeys2Drop)
Defines types as array that will not be sent to the Cas Processor service.
|
void |
setTimeout(int aTimeout)
Define the max time in millis the proxy will wait for response from remote service.
|
void |
setTimer(org.apache.uima.util.UimaTimer aTimer)
Defines a custom timer to use for stats.
|
void |
setVNSHost(String aVNSHost)
Sets the VNS host this proxy will use to locate service.
|
void |
setVNSPort(String aVNSPort)
Sets the VNS port this proxy will use to locate service.
|
boolean |
shutdown(boolean shutdownService,
boolean aDoSendNotification)
Conditionally sends the shutdown request to managed (local) vinci service.
|
public void setContentTag(String aContentTag)
aContentTag - -
subject of analysispublic void setTimer(org.apache.uima.util.UimaTimer aTimer)
aTimer - -
custom timerpublic void setKeys2Drop(String[] aKeys2Drop)
aKeys2Drop - -
array of types excluded from the requestpublic void connect(String aHost, int aPort) throws ConnectException
aHost - -
name of the host where the service is runningaPort - -
port number where the service listens for requestsConnectException - wraps Exception or unable to connectpublic void setTimeout(int aTimeout)
aTimeout - -
number of millis to waitpublic void connect(String aServiceName) throws ServiceConnectionException
aServiceName - -
name of the serviceServiceConnectionException - the service connection exceptionpublic org.apache.vinci.transport.document.AFrame sendAndReceive(org.apache.vinci.transport.document.AFrame aFrame)
throws org.apache.vinci.transport.ServiceException,
ServiceConnectionException
aFrame - -
Vinci Frame containing requestorg.apache.vinci.transport.ServiceException - the service exceptionServiceConnectionException - the service connection exceptionpublic static org.apache.uima.cas_data.CasData addKeysToDataCas(org.apache.uima.cas_data.CasData dataCas,
org.apache.vinci.transport.document.AFrame aFrame)
throws Exception
dataCas - -
instance of CasData where the keys will be appendedaFrame - -
source of keys (data)Exception - passthrupublic org.apache.uima.cas_data.CasData analyze(org.apache.uima.cas_data.CasData aCas,
org.apache.uima.util.ProcessTrace aPT,
String aResourceName)
throws org.apache.vinci.transport.ServiceException,
ServiceConnectionException
aCas - -
Cas to analayzeaPT - -
performance trace object for stats and totalsaResourceName - -
name of the Cas Processororg.apache.vinci.transport.ServiceException - - passthru, wraps ExceptionServiceConnectionException - passthrupublic org.apache.uima.cas_data.CasData[] analyze(org.apache.uima.cas_data.CasData[] aCasList,
org.apache.uima.util.ProcessTrace aPT,
String aResourceName)
throws org.apache.vinci.transport.ServiceException,
ServiceConnectionException
aCasList - -
a list of Cas to send to service for analysisaPT - -
Process Trace object to aggrate time and statsaResourceName - -
name of the Cas Processororg.apache.vinci.transport.ServiceException - - passthru, wraps ExceptionServiceConnectionException - passthrupublic org.apache.uima.resource.metadata.ProcessingResourceMetaData getAnalysisEngineMetaData()
throws org.apache.uima.resource.ResourceServiceException
org.apache.uima.resource.ResourceServiceException - the resource service exceptionpublic void batchProcessComplete()
throws org.apache.uima.resource.ResourceServiceException
org.apache.uima.resource.ResourceServiceException - the resource service exceptionpublic void collectionProcessComplete()
throws org.apache.uima.resource.ResourceServiceException
org.apache.uima.resource.ResourceServiceException - wraps Exceptionpublic boolean shutdown(boolean shutdownService,
boolean aDoSendNotification)
shutdownService - -
flag indicating if a shutdown command should be sent to the serviceaDoSendNotification - -
indicates whether or not to sent CollectionProcessComplete frame to servicepublic boolean isConnected()
public void setVNSPort(String aVNSPort)
aVNSPort - -
vns port to usepublic void setVNSHost(String aVNSHost)
aVNSHost - -
name of the VNS hostpublic int getServicePort()
public String getServiceHost()
public String getVNSPort()
public String getVNSHost()
Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.