public class Client extends LeoProperties
Modifier and Type | Class and Description |
---|---|
static class |
Client.LeoEngine
Extends the Base engine in order to expose the listeners in a getter.
|
Modifier and Type | Field and Description |
---|---|
protected LeoCollectionReaderInterface |
collectionReader
Collection reader used for reading documents in and sending them to the service.
|
protected boolean |
isUAListenerAdded
Flag to let us know if a UAB Listener has been added.
|
protected static org.apache.log4j.Logger |
LOG
Logger object.
|
protected Map<String,Object> |
mAppCtx
Application execution map used primarily by the client.
|
protected Client.LeoEngine |
mUAEngine
UIMA Asynchronous Engine object used to deploy the server and later to
init and run the client side of the service also.
|
protected String |
performanceReport
Holds performance report data from the engine after processing is complete.
|
BROKERURL_DEFAULT, ENDPOINT_DEFAULT, mAggregateDescriptorFile, mBrokerURL, mCasPoolSize, mCCTimeout, mDeleteOnExit, mDeploymentDescriptorFile, mDescriptorDirectory, mEndpoint, mFSHeapSize, mInitTimeout, mJamJmxPort, mJamQueryIntervalInSeconds, mJamResetStatisticsAfterQuery, mJamServerBaseUrl, mPropertiesFile, mServiceName, mTimeout, PROPERTIES_DEFAULT
Constructor and Description |
---|
Client(String propertiesFile,
LeoCollectionReaderInterface collectionReader,
org.apache.uima.aae.client.UimaAsBaseCallbackListener... uaListeners)
Constructor with properties file input for client execution context, a collection reader for input, and option listeners.
|
Client(String propertiesFile,
org.apache.uima.aae.client.UimaAsBaseCallbackListener... uaListeners)
Constructor with properties file input for client execution context.
|
Client(org.apache.uima.aae.client.UimaAsBaseCallbackListener... uaListeners)
Default Constructor, will try to load properties from file located at
conf/leo.properties.
|
Modifier and Type | Method and Description |
---|---|
void |
addUABListener(org.apache.uima.aae.client.UimaAsBaseCallbackListener uaListener)
Set a reference to the UABCallbackListener object for handling service events.
|
protected void |
finalize() |
LeoCollectionReaderInterface |
getLeoCollectionReader()
Get the collection reader for this client.
|
List |
getListeners()
Get the list of listeners that have been registered with the client.
|
String |
getPerformanceReport()
Get the performance report stored after the last "run" invocation in this client object.
|
org.apache.uima.resource.metadata.TypeSystemDescription |
getServiceTypeSystemDescription()
Calls the service to determine the TypeSystemDescription it is using,
and returns it.
|
static org.apache.uima.resource.metadata.TypeSystemDescription |
getServiceTypeSystemDescription(String brokerURL,
String inputQueueName)
Calls the service to determine the TypeSystemDescription it is using,
and returns it.
|
String |
getServiceTypeSystemDescriptionXml()
Returns the remote service TypeSystemDescription in xml.
|
static String |
getServiceTypeSystemDescriptionXml(String brokerURL,
String inputQueueName)
Returns the remote service TypeSystemDescription in xml.
|
protected void |
init(org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs)
Initialize the client engine and application context.
|
void |
run(org.apache.uima.cas.CAS cas,
org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs)
Run the pipeline on a single CAS object.
|
void |
run(InputStream stream,
org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs)
Run the pipeline on one document at a time using the document text provided.
|
void |
run(LeoCollectionReaderInterface collectionReader,
org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs)
Execute the AS pipeline using the LeoCollectionReaderInterface object.
|
void |
run(String documentText,
org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs)
Run the pipeline on one document at a time using the document text provided.
|
void |
run(org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs)
Run with the collection reader that is already set in the client.
|
void |
setLeoCollectionReader(LeoCollectionReaderInterface reader)
Set the collection reader for this client.
|
void |
validateData()
Validate the required data for client execution.
|
getAggregateDescriptorFile, getBrokerURL, getCasPoolSize, getCCTimeout, getDeploymentDescriptorFile, getDescriptorDirectory, getEndpoint, getFSHeapSize, getInitTimeout, getInputQueueName, getJamJmxPort, getJamQueryIntervalInSeconds, getJamServerBaseUrl, getServiceName, getTimeout, isDeleteOnExit, isJamResetStatisticsAfterQuery, loadDefaults, loadProperties, loadprops, loadprops, setAggregateDescriptorFile, setBrokerURL, setCasPoolSize, setCCTimeout, setDeleteOnExit, setDeploymentDescriptorFile, setDescriptorDirectory, setEndpoint, setFSHeapSize, setInitTimeout, setInputQueueName, setJamJmxPort, setJamQueryIntervalInSeconds, setJamResetStatisticsAfterQuery, setJamServerBaseUrl, setServiceName, setTimeout
protected Client.LeoEngine mUAEngine
protected Map<String,Object> mAppCtx
protected String performanceReport
protected boolean isUAListenerAdded
protected static final org.apache.log4j.Logger LOG
protected LeoCollectionReaderInterface collectionReader
public Client(org.apache.uima.aae.client.UimaAsBaseCallbackListener... uaListeners)
uaListeners
- Listeners that will catch Service callback eventspublic Client(String propertiesFile, org.apache.uima.aae.client.UimaAsBaseCallbackListener... uaListeners) throws Exception
propertiesFile
- the full path to the properties file for client properties.uaListeners
- Listeners that will catch Service callback eventsException
- if there is an error loading properties.public Client(String propertiesFile, LeoCollectionReaderInterface collectionReader, org.apache.uima.aae.client.UimaAsBaseCallbackListener... uaListeners) throws Exception
propertiesFile
- the full path to the properties file for client properties.collectionReader
- the input collection reader for this client.uaListeners
- Listeners that will catch Service callback eventsException
- if there is an error loading properties.public void setLeoCollectionReader(LeoCollectionReaderInterface reader)
reader
- the collection reader for this client.public LeoCollectionReaderInterface getLeoCollectionReader()
public void addUABListener(org.apache.uima.aae.client.UimaAsBaseCallbackListener uaListener)
uaListener
- adds a callback gov.va.vinci.leo.listener for this client.public void validateData() throws Exception
Exception
- if any data required for the client is missing.protected void init(org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs) throws Exception
uabs
- Listeners that will catch Service callback eventsException
- if any data required for the client is missing.public void run(org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs) throws Exception
uabs
- List of Listeners that will catch callback events from the serviceException
- if any error occurs during processingpublic void run(LeoCollectionReaderInterface collectionReader, org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs) throws Exception
collectionReader
- LeoCollectionReaderInterface that will produce CASes for the pipelineuabs
- List of Listeners that will catch callback events from the serviceException
- if any error occurs during processingpublic void run(InputStream stream, org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs) throws Exception
stream
- the input stream to read the document from.uabs
- List of Listeners that will catch callback events from the serviceException
- if any error occurs during processingpublic void run(String documentText, org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs) throws Exception
documentText
- the document text to process.uabs
- List of Listeners that will catch callback events from the serviceException
- if any error occurs during processingpublic void run(org.apache.uima.cas.CAS cas, org.apache.uima.aae.client.UimaAsBaseCallbackListener... uabs) throws Exception
cas
- an individual cass to process through the client.uabs
- List of Listeners that will catch callback events from the serviceException
- if any error occurs during processingpublic List getListeners()
public String getPerformanceReport()
public static org.apache.uima.resource.metadata.TypeSystemDescription getServiceTypeSystemDescription(String brokerURL, String inputQueueName) throws Exception
brokerURL
- URL of the broker where the service resides.inputQueueName
- Name of the endpoint, or input queue for the service to query.Exception
- if there is an exception getting the type system from the engine.public org.apache.uima.resource.metadata.TypeSystemDescription getServiceTypeSystemDescription() throws Exception
Exception
- if there is an exception getting the type system from the engine.public static String getServiceTypeSystemDescriptionXml(String brokerURL, String inputQueueName) throws Exception
brokerURL
- URL of the broker where the service resides.inputQueueName
- Name of the endpoint, or input queue for the service to query.Exception
- if there is an exception getting the type system from the engine.public String getServiceTypeSystemDescriptionXml() throws Exception
Exception
- if there is an exception getting the type system from the engine.protected void finalize() throws Throwable
finalize
in class Object
Throwable
- if any exception is thrown by the engine during the stop() call.Object.finalize()
Copyright © 2018 Department of Veterans Affairs. All Rights Reserved.