Class UpdateCheckResponse

java.lang.Object
org.axonframework.updates.api.UpdateCheckResponse

public class UpdateCheckResponse extends Object
Represents the response from the UpdateChecker API, containing information about version upgrades and vulnerabilities found in the artifacts used by the application.
Since:
4.12.0
Author:
Mitchell Herrijgers
  • Constructor Details

    • UpdateCheckResponse

      public UpdateCheckResponse(int checkInterval, List<ArtifactAvailableUpgrade> upgrades, List<DetectedVulnerability> vulnerabilities)
      Constructs an UpdateCheckResponse with the given checkInterval, upgrades, and vulnerabilities.
      Parameters:
      checkInterval - The interval in seconds at which the usage data should be checked.
      upgrades - A list of found version upgrades, each containing details about the artifact and its latest version.
      vulnerabilities - A list of found vulnerabilities, each containing details about the artifact, its severity, fix version, and a URL for more information.
  • Method Details

    • checkInterval

      public int checkInterval()
      Returns the check interval of this update check response.
      Returns:
      The check interval of this update check response.
    • upgrades

      public List<ArtifactAvailableUpgrade> upgrades()
      Returns the collection of upgrades of this update check response.
      Returns:
      The collection of upgrades of this update check response.
    • vulnerabilities

      public List<DetectedVulnerability> vulnerabilities()
      Returns the collection of vulnerabilities of this update check response.
      Returns:
      The collection of vulnerabilities of this update check response.
    • fromRequest

      public static UpdateCheckResponse fromRequest(String body)
      Parses the response body from the anonymous usage reporter into a UsageResponse object. The body is expected to be in a specific format where each line contains a key-value pair. The expected keys are:
      • cd - Check interval in seconds
      • vul - Vulnerability information in the format: groupId:artifactId:fixVersion:severity:moreInformationUrl
      • upd - Update information in the format: groupId:artifactId:latestVersion

      An example of the expected format:

       cd=86400
       vul=org.axonframework:axon-serialization:1.0.0:HIGH:"https://example.com/vulnerability"
       upd=org.axonframework:axon-messaging:5.0.1
       
      Parameters:
      body - The response body as a string.
      Returns:
      A UsageResponse object containing the parsed data.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object