This package includes the following files:
-
StageAgent - OAA agent that responds to stage() and unstage() requests.
- DataStore - java class to manage a hash table of files as they are checked in and out.
- AdvantaServer - light weight web server to serve up previously staged files
- test.bat - test driver script to compile & run the applications
- Client.java - Sample client to exercise the agent's capabilites.
Motivation
I initially wrote this agent to avoid pumping large amounts of data
through the facilitator. In OAAv1.x it was tricky to properly encode
the data as valid prolog, and in the current OAAv2.X, the icl functions
have a tendancy to slow things down a bit. Also, I wanted to hide
data by side-stepping the facilitator. I did not want anyone to attach
an OAA Monitor to my facilitator, and see my content (security).
Defaults
I do have a resource file (StageAgent.ini) that I normally use to setup the
runtime properties . I will add this if people ask but for now it is
easy to see what settings can be configured.
- stageDir - some scratch directory
- httpHost and httpPort - machine & port the AdvantaServer will be running on
- userName - This is really just a token. You do not have to use the userName
if you would prefer not to.
Ideally, you should run the Client script on a machine other than the one that the
StageAgent is running on. The usefulness of the StageAgent is to expose files
on remote systems. Pretend you are running a StageAgent on five different Unix
machines. You could submit the request to
stage(someToken,'/etc/passwd',Ref).
You would recieve a list of five urls that you could use to fetch with an http
client. The default is to serve up a staged file only once (security). If you
wish to make a file fetchable 3 times then you may send the request:
stage(someToken,'/etc/passwd',[Ref1,Ref2,Ref3])
Your client can then fetch the references as needed.
The unstage feature will allow you to perform a "handshake" with another agent.
Assume host1 has a spellCheckAgent that uses a URL as input data. Assume host2
has some raw data that it would like sto have spell checked. You could perform
this task by running a StageAgent on each host. Then you could process the following:
solve stage(speller,'/tmp/rawfile',R) R = http://host2:4444/get?ref=0
solve spellcheck(R,X) X = http://host1:4444/get?ref=0
solve unstage(speller,X,Y) Y = new local file
Future
As I mentioned in a previous message, I plan on adding SSL support to the
Agent. I plan to implement the secureStage() & secureUnstage() solvables.
I will try to post a follow-up once I work that out. Also, I am not sure if
my implemetation is truly cross-platform I noticed that my unstaged file
was missing the proper CR/LF characters. This was the first time I ran it
on a Windows machine.
Contributions Page