Class SonarLintCache

java.lang.Object
org.sonar.plugins.java.api.caching.SonarLintCache
All Implemented Interfaces:
org.sonar.api.batch.sensor.cache.ReadCache, org.sonar.api.batch.sensor.cache.WriteCache

@SonarLintSide @Beta public class SonarLintCache extends Object implements org.sonar.api.batch.sensor.cache.ReadCache, org.sonar.api.batch.sensor.cache.WriteCache
Component used in SonarLint to transfer data in memory between plugins. At the time of writing, this is used only by the DBD plugin, to consume IRs produced by DBD custom rules in SonarLint context. This component is just an intermediate solution until a dedicated mechanism to communicate between plugins with sufficient capabilities is available.

By default, this component has SINGLE_ANALYSIS lifetime, meaning that it does not need to be manually cleared after analysis.

  • Constructor Details

    • SonarLintCache

      public SonarLintCache()
  • Method Details

    • read

      public InputStream read(String s)
      Specified by:
      read in interface org.sonar.api.batch.sensor.cache.ReadCache
    • contains

      public boolean contains(String s)
      Specified by:
      contains in interface org.sonar.api.batch.sensor.cache.ReadCache
    • write

      public void write(String s, InputStream inputStream)
      Specified by:
      write in interface org.sonar.api.batch.sensor.cache.WriteCache
    • write

      public void write(String s, byte[] bytes)
      Specified by:
      write in interface org.sonar.api.batch.sensor.cache.WriteCache
    • copyFromPrevious

      public void copyFromPrevious(String s)
      Specified by:
      copyFromPrevious in interface org.sonar.api.batch.sensor.cache.WriteCache