|
iPAM Developer Documentation
|
|
- Developing a new Input Agent |
iPAM input agents can be synchronous or asynchronous. Synchronous input agents respond to requests for product. Asynchronous input agents generally manage a Java Thread of their own which detects new input data from an external source. iPAM input agents are also refered to as Provider Interface Modules, PIMs.
The simplest way to develop a new synchronous input agent is to subclass fromorg.mitre.pam.PIMShell1
and to implement thedoFetch()
method. The following skeleton illustrates this:
A PIM Skeleton
package myOwnPackage; import org.mitre.pam.interfaces.Product; import org.mitre.pam.getter.PIMShell1; public class MyPIM extends PIMShell1 { public MyPIM () { } public Product doFetch() { } }
The doFetch() method is responsible for making a connection to the input source, making required queries, reading the result, and creating an iPAM Product. Additional code must also be added in the constructor to declare PIM attributes. See the source code in
pamStandard
for the classorg.mitre.pam.getter.PIMShell
1 or the classorg.mitre.pam.getter.GetURL
for more examples.
For an example of an asynchronous input agent see Asynchronous Agents. Asynchronous input agents do not have to implement thedoFetch()
method because the PIMShell1 base class has a default implementation that returns a null product. However, if it does make sense to "poll" an asynchronous agent then thedoFetch()
method may be overridden. The classorg.mitre.pam.getter.GetAsyncMail
is an asynchronous agent that accepts mail asynchronously but waits until pooled to provide the product.
Revised: 1 June 1999