Multiple call integrations

Multiple call (or multiple page) integration scripts are a bit more complicated. They require multiple calls to a data source to retrieve data.

Like a single call integration, a multiple call integration must also have retrieveData() implemented. In the body of retrieveData(), the integration uses the hasMoreData() and setNextRunParameters() methods provided by VulnerabilityIntegrationBase.

The hasMoreData() method accepts a single Boolean that instructs the VulnerabilityIntegrationController to insert more processes to pull more data. When passing true to hasMoreData(), a call to setNextRunParameters() is made to provide context to the next process.

The setNextRunParameters() method accepts a single object that provides context information to be used by the next call to retrieveData(). This object is used to pass state to subsequent calls to retrieveData(). An example use case is to pass an object that indicates the current page number and page size to a web service.

For multiple call integrations, each retrieveData() call first checks the current process parameters. The _getProcessParameters() method is provided to all VulnerabilityIntegrationBase as a convenience to get the parameters set by the previous process. If there are no parameters, it would indicate that it is the first process.

A screen shot of a sample multiple call integration script follows. Extending on the single call integration example, this script demonstrates making calls to a REST endpoint that has basic pagination support. It shows how you can get a single page of data, recognize that there is more data to retrieve, and then tell the next process which page to retrieve.
Figure 1. Multiple call integration script
Multi-call integration script