|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ezic.direct.BatchAgent
public class BatchAgent
This class contains a stand-alone java application, that can be run from the command line. There is no need to do any java programming in order to use the BatchAgent. Communication between your own application and the java BatchAgent consist of putting batch files ready for processing into a directory, and waiting for the BatchAgent to process them and write out the result files to the same directory. In order to avoid race conditions and accidental processing of batch files, a number of steps must be followed before processing starts. Those steps are described below in the runAgent method.
In order to start using the BatchAgent, do the following:
drop_dir = /some/directory/path (required, change to indicate a directory on yoru system) account_id = 110006559149 (required, your account number) poll_interval = 5 (optional, how often to scan for batch files in seconds) server = secure.ezic.com (optional, defaults to secure.ezic.com) https = true (optional, set to false to turn encryption off) verbose = false (optional, set to true to turn on debug output) dynip_sec_code = <code> (only for dynamic IP clients, see access security screen)
java -classpath direct-java-3.x.x.jar com.ezic.direct.BatchAgent batchagent.props
Constructor Summary | |
---|---|
BatchAgent(java.lang.String account,
int pollfreq,
java.lang.String dropdir,
java.lang.String server,
boolean https,
boolean verbosemode)
Create a BatchAgent |
Method Summary | |
---|---|
static void |
main(java.lang.String[] argv)
A config file is needed as argument, containing the following keys: |
void |
runAgent()
Runs the agent indefinitely, sleeping poll_interval seconds between each round. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BatchAgent(java.lang.String account, int pollfreq, java.lang.String dropdir, java.lang.String server, boolean https, boolean verbosemode)
account
- the account_id to use at the serverpollfreq
- interval in seconds between scans of the drop directorydropdir
- pathname to the directory where batches will be putserver
- server host name, "secure.ezic.com"https
- set to false to force encryption offverbosemode
- true for verbose mode where informational messages are printedMethod Detail |
---|
public void runAgent()
Errors that happen (transient file errors and network errors) are ignored.
This is the sequence of events which you have to follow to make the agent process a batch with the server. All filename references are relative to the basename of the original csv file to be uploaded - that is, if the filename is myfile.in.csv, the basename is myfile
the agent recognizes this and uploads the csv file to the server, puts any immediate rejects into the file ending with .out.rej, removes the .in.ready file and touches the file .out.ready to signal that the .out.rej file is readable.
NOTE! The server will not begin processing yet at this point.
the agent recognizes this combination of files as the signal to start processing at the server. the .in.ready and .out.rej files are deleted by the agent at this point, and each time the agent polls the server, it writes a .out.stat file containing the status of the batch.
when the agent finds that the server has finished processing the batch, the result is downloaded and put in the .out.csv file and the .out.ready file is created by the agent.
when done, remove the .out.stat file, the .out.csv file and the .out.ready file (in that order!)
public static void main(java.lang.String[] argv) throws java.lang.Exception, java.lang.NumberFormatException
java.lang.Exception
java.lang.NumberFormatException
|
Version 3.1.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |