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.

Synchronous Input Agents

The simplest way to develop a new synchronous input agent is to subclass from org.mitre.pam.PIMShell1 and to implement the doFetch() 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 class org.mitre.pam.getter.PIMShell1 or the class org.mitre.pam.getter.GetURL for more examples.

Asynchronous Input Agent

For an example of an asynchronous input agent see Asynchronous Agents. Asynchronous input agents do not have to implement the doFetch() 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 the doFetch() method may be overridden. The class org.mitre.pam.getter.GetAsyncMail is an asynchronous agent that accepts mail asynchronously but waits until pooled to provide the product.

 

  Revised: 1 June 1999