Skip to content

Commit 8b61d7e

Browse files
PLUGINAPI-117 Introduce analysis data storage to API.
1 parent 0d0c4e2 commit 8b61d7e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
## 11.3
3+
* Introduce `org.sonar.api.batch.sensor.SensorContext.addAnalysisData`.
4+
25
## 11.2
36
* Standard Severity BLOCKER is now mapped to Software Quality Impact Severity BLOCKER
47
* Standard Severity INFO is now mapped to Software Quality Impact Severity INFO

plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020
package org.sonar.api.batch.sensor;
2121

22+
import java.io.InputStream;
2223
import java.io.Serializable;
2324
import org.sonar.api.Beta;
2425
import org.sonar.api.SonarRuntime;
@@ -280,4 +281,19 @@ public interface SensorContext {
280281
* @since 10.9
281282
*/
282283
void addTelemetryProperty(String key, String value);
284+
285+
/**
286+
* Internal service to send data for reporting.
287+
*
288+
* @param key The key must follow this convention: <plugin_key>.<entry_key>.
289+
* where the plugin_key is your plugin key. Example: jvm.file_graph
290+
* @param mimeType A valid MIME type, usage of custom type and additional parameters is encouraged.
291+
* @param data The binary data to be added. The InputStream will be consumed once then closed during the method execution.
292+
*
293+
* @throws IllegalArgumentException if key, mimeType, or data parameter is null or invalid
294+
* @throws IllegalStateException if the method is called by a plugin not developed by SonarSource SA
295+
* @since 11.3
296+
*/
297+
@Beta
298+
void addAnalysisData(String key, String mimeType, InputStream data);
283299
}

0 commit comments

Comments
 (0)