Skip to main content

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:

ClassDescriptionSettings/Methods
ExecutionContextStores 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: <span class="CodeHighlight">ExecutionContext getInstance(Properties props, PrintStream logger)</span> Initializes ExecutionContext for the current scan. Parameters: 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.
ScanExecutorExecutes the scan and the publish results request made by client plugins. 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.