Package org.axonframework.update.api
Record Class UpdateCheckResponse
java.lang.Object
java.lang.Record
org.axonframework.update.api.UpdateCheckResponse
- Record Components:
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.
@Internal
public record UpdateCheckResponse(int checkInterval, @Nonnull List<ArtifactAvailableUpgrade> upgrades, @Nonnull List<DetectedVulnerability> vulnerabilities)
extends Record
Represents the response from the UpdateChecker API, containing information about version upgrades and
vulnerabilities found in the artifacts used by the application.
- Since:
- 5.0.0
- Author:
- Mitchell Herrijgers
-
Constructor Summary
ConstructorsConstructorDescriptionUpdateCheckResponse(int checkInterval, List<ArtifactAvailableUpgrade> upgrades, List<DetectedVulnerability> vulnerabilities) Creates an instance of aUpdateCheckResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecheckIntervalrecord component.final booleanIndicates whether some other object is "equal to" this one.static UpdateCheckResponsefromRequest(String body) Parses the response body from the anonymous usage reporter into aUsageResponseobject.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.upgrades()Returns the value of theupgradesrecord component.Returns the value of thevulnerabilitiesrecord component.
-
Constructor Details
-
UpdateCheckResponse
public UpdateCheckResponse(int checkInterval, @Nonnull List<ArtifactAvailableUpgrade> upgrades, @Nonnull List<DetectedVulnerability> vulnerabilities) Creates an instance of aUpdateCheckResponserecord class.- Parameters:
checkInterval- the value for thecheckIntervalrecord componentupgrades- the value for theupgradesrecord componentvulnerabilities- the value for thevulnerabilitiesrecord component
-
-
Method Details
-
fromRequest
Parses the response body from the anonymous usage reporter into aUsageResponseobject. 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-conversion: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
UsageResponseobject containing the parsed data.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
checkInterval
public int checkInterval()Returns the value of thecheckIntervalrecord component.- Returns:
- the value of the
checkIntervalrecord component
-
upgrades
Returns the value of theupgradesrecord component.- Returns:
- the value of the
upgradesrecord component
-
vulnerabilities
Returns the value of thevulnerabilitiesrecord component.- Returns:
- the value of the
vulnerabilitiesrecord component
-