How to run an agent from a servlet

Hi all.I am new to java on domino.

I need to trigger an agent form an servlet.

These agent is runs on a schedule bases.

These servlet is not on domino server.

I haven’t coded anything for java on domino.

So how do I trigger an agent.

Thanks for your help in advance.

Subject: How to run an agent from a servlet

Hmm, if the agent runs on a schedules basis, there’s no need to trigger it, is it?

Anyway, your servelet could either call the agent by issuing a simple HTTP get request to

://host.domain.tld/folder/database.nsf/MyAgent?OpenAgent

or through DIIOP using native Notes Java classes. But again, if the agent is set to run on schedule anyway …

Subject: RE: How to run an agent from a servlet

Hi, Harkpabst Meliantrop.Thanks for you help.

How do I use HTTP get request.

Some examples of it will be very helpful.

And also what is DIIOP and how to use it.

Thanks for your help in advance.

Subject: RE: How to run an agent from a servlet

One more time: Is the agent a scheduled agent? If so, there’s no need to trigger it, it will just fire off at the times it is configured to.

If you want to call it manually anyway, there’s nothing special about scheduled agents. Just make sure to use the correct agent name (including the braces).

I don’t know what your servlet does, and if it expects any data back from the agent. Basically, your servlet just has to make an http request using the ?OpenAgent URL command. You could either redirect to that agent (if that is what you want and the agent returns some html or redirects to another page). You could use the Apache HttpClient to issue a request and do something with the agent’s HTTP response. It all depends on what you have to do.

DIIOP stands for the Domino implementation of the IIOP protocol. Your Java code can get remote access to the sever via IIOP, if the server is configured accordingly and the IIOP ports configured in the server document are not blocked by any firewall.

You must copy over and add to your project’s classpath the ncso.jar file, that comes with every Notes and Domino installation (in your development environment and runtime system), and import the lotus.domino.* package. Then you have access to the Domino Object Model for Java in your servlet code.

I don’t have any code samples, as I don’t usually use that stuff. Look up Designer help, this forum and other internet resources for the keywords given.