Available Classes and Methods in the Framework
The Scan Agent Framework provides the following classes and methods that can be used to build a scan plugin:
| Class | Description | Settings/Methods |
|---|---|---|
| ExecutionContext | Stores all the information needed for a scan to run and publish results to Code Insight server. This class should be initialized only by calling the ExecutionContext.getInstance(...) method. | Methods: <ExecutionContext getInstance(Properties props, PrintStream logger)Initializes ExecutionContext for the current scan. Parameters: <br/>props: Properties required to scan and publish results logger: Output stream where all the useful logging will be sent; if logger is null, all logging is redirected to console output. For more information about parameters for this class, see Property Settings. |
| ScanExecutor | Executes the scan and the publish results request made by client plugins. Note: This class requires a valid ExecutionContext instance to be able to operate. | Methods: ScanExecutor(ExecutionContext executionContext) A constructor. String testConnection() Validates the user authorization token and the connection to the Code Insight server. Valid returned strings: - Success - Server Not Found - Invalid Auth Token Found - User not authorized to access the project String scanCodebase(List<String> paths) Updates the embedded scanner if updates are found, scans the paths provided as input, and publishes the results to the Code Insight server as provided for ExecutionContext. Parameters: paths: list of absolute paths to be scanned Return: SUCCESS or FAILURE as a string. See the logger output stream for more details. |