public class CommandLineClient extends Object
Constructor and Description |
---|
CommandLineClient(File clientConfigFile,
File readerConfig,
File[] listenerConfigFiles)
Initialize the client using groovy config files for the client, reader, and one or more listeners.
|
CommandLineClient(String[] args) |
Modifier and Type | Method and Description |
---|---|
String |
defaultClientConfig()
The default client config file.
|
String |
defaultCollectionReaderConfig()
The default collection reader config file.
|
String[] |
defaultListenerConfig()
The default listener config files.
|
static List<org.apache.uima.aae.client.UimaAsBaseCallbackListener> |
getListeners(File... configs)
Parse the groovy config files, and return the listener objects that are defined in them.
|
static LeoCollectionReaderInterface |
getReader(File config)
Parse the groovy config file, and return the reader object.
|
static void |
main(String[] args)
Main method for java execution.
|
static void |
printUsage()
Print the command line usage statement to the console and exit.
|
void |
runClient()
Actual run method that configures and runs the client.
|
protected Client |
setClientProperties(Client leoClient)
Set the client properties, such as brokerURL, from a pre-loaded groovy config file.
|
public CommandLineClient(String[] args)
public CommandLineClient(File clientConfigFile, File readerConfig, File[] listenerConfigFiles)
clientConfigFile
- client groovy config file.readerConfig
- reader groovy config file.listenerConfigFiles
- array of groovy config files for one or more listeners.public String defaultClientConfig()
public String defaultCollectionReaderConfig()
public String[] defaultListenerConfig()
public static List<org.apache.uima.aae.client.UimaAsBaseCallbackListener> getListeners(File... configs) throws MalformedURLException
configs
- the groovy config files to slurpMalformedURLException
- if the configuration file url that was set is invalid.public static LeoCollectionReaderInterface getReader(File config) throws MalformedURLException
config
- the groovy config file to slurpMalformedURLException
- if the configuration file url that was set is invalid.protected Client setClientProperties(Client leoClient) throws MalformedURLException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
leoClient
- Client object to configure.MalformedURLException
- if the configuration file url that was set is invalid.InvocationTargetException
- if the groovy config refers to objects not in the classpath.IllegalAccessException
- if there is a rights issue accessing settings from the groovy config.NoSuchMethodException
public void runClient()
public static void main(String[] args) throws org.kohsuke.args4j.CmdLineException
args
- list of String arguments for the program.org.kohsuke.args4j.CmdLineException
- if there is an error parsing the command line arguments.public static void printUsage()
Copyright © 2018 Department of Veterans Affairs. All Rights Reserved.