|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.uima.collection.impl.cpm.container.deployer.VinciTAP
public class VinciTAP
Vinci Proxy to remote Cas Processor vinci service. This component is used for both local( managed) and remote ( unmanaged) Cas Processors. Its main purpose is to invoke remote APIs on Cas Processors running as vinci services. It serializes data contained in the Cas into XCAS and sends it to the service. It desiralizes data from XCAS returned from the service back into the Cas.
Constructor Summary | |
---|---|
VinciTAP()
|
Method Summary | |
---|---|
static CasData |
addKeysToDataCas(CasData dataCas,
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. |
CasData[] |
analyze(CasData[] aCasList,
ProcessTrace aPT,
java.lang.String aResourceName)
Main routine that sends requests to remote vinci services. |
CasData |
analyze(CasData aCas,
ProcessTrace aPT,
java.lang.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(java.lang.String aServiceName)
Connects to external service using service name as a way to locate it. |
void |
connect(java.lang.String aHost,
int aPort)
Connects the proxy to Cas Processor running as a vinci service on a given host and port number. |
ProcessingResourceMetaData |
getAnalysisEngineMetaData()
Returns Cas Processor metadata as it is returned from the remote Cas Processor running as vinci service. |
java.lang.String |
getServiceHost()
Returns host where the service is running |
int |
getServicePort()
Returns port of the service this proxy is connected to |
java.lang.String |
getVNSHost()
Returns VNS Host |
java.lang.String |
getVNSPort()
Returns VNS Port |
boolean |
isConnected()
Returns status of the vinci connection |
AFrame |
sendAndReceive(AFrame aFrame)
Send a given Vinci Frame to the remote vinci service and return result |
void |
setContentTag(java.lang.String aContentTag)
Defines subject of analysis |
void |
setKeys2Drop(java.lang.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(UimaTimer aTimer)
Defines a custom timer to use for stats |
void |
setVNSHost(java.lang.String aVNSHost)
Sets the VNS host this proxy will use to locate service |
void |
setVNSPort(java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VinciTAP()
Method Detail |
---|
public void setContentTag(java.lang.String aContentTag)
aContentTag
- -
subject of analysispublic void setTimer(UimaTimer aTimer)
aTimer
- -
custom timerpublic void setKeys2Drop(java.lang.String[] aKeys2Drop)
aKeys2Drop
- -
array of types excluded from the requestpublic void connect(java.lang.String aHost, int aPort) throws java.net.ConnectException
aHost
- -
name of the host where the service is runningaPort
- -
port number where the service listens for requests
java.net.ConnectException
public void setTimeout(int aTimeout)
aTimeout
- -
number of millis to waitpublic void connect(java.lang.String aServiceName) throws ServiceConnectionException
aServiceName
- -
name of the service
ServiceConnectionException
public AFrame sendAndReceive(AFrame aFrame) throws ServiceException, ServiceConnectionException
AFrame
- -
Vinci Frame containing request
ServiceException
ServiceConnectionException
public static CasData addKeysToDataCas(CasData dataCas, AFrame aFrame) throws java.lang.Exception
dataCas
- -
instance of CasData where the keys will be appendedaFrame
- -
source of keys (data)
java.lang.Exception
public CasData analyze(CasData aCas, ProcessTrace aPT, java.lang.String aResourceName) throws ServiceException, ServiceConnectionException
aCas
- -
Cas to analayzeaPT
- -
performance trace object for stats and totalsaResourceName
- -
name of the Cas Processor
ServiceException
- -
ServiceConnectionException
public CasData[] analyze(CasData[] aCasList, ProcessTrace aPT, java.lang.String aResourceName) throws 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 Processor
ServiceException
ServiceConnectionException
public ProcessingResourceMetaData getAnalysisEngineMetaData() throws ResourceServiceException
ResourceServiceException
public void batchProcessComplete() throws ResourceServiceException
ResourceServiceException
public void collectionProcessComplete() throws ResourceServiceException
ResourceServiceException
public 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 service
public boolean isConnected()
public void setVNSPort(java.lang.String aVNSPort)
aVNSPort
- -
vns port to usepublic void setVNSHost(java.lang.String aVNSHost)
host
- -
name of the VNS hostpublic int getServicePort()
public java.lang.String getServiceHost()
public java.lang.String getVNSPort()
public java.lang.String getVNSHost()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |