Class EngineVersion

java.lang.Object
com.wualabs.qtsurfer.engine.EngineVersion

public final class EngineVersion extends Object
The qtsurfer-engine version of the jar this class ships in.

Read at class-init from this artifact's own META-INF/maven/com.wualabs/qtsurfer-engine-common/pom.properties — the file the Maven JAR plugin writes into every artifact by default. Deliberately not a build-time constant, a system property or a MANIFEST.MF attribute:

  • A constant can drift from the jar that is actually loaded (stale overlay, hand-patched image, transitive bump); reading the jar's own metadata cannot.
  • Package.getImplementationVersion() returns null here — the engine build does not enable addDefaultImplementationEntries, so MANIFEST.MF carries no Implementation-Version.

Survives shading: the deployable fat jars of the consuming services filter only META-INF/*.SF|DSA|RSA signature files, leaving META-INF/maven/** intact.

Audience

Both platform and user strategies. It sits in com.wualabs.qtsurfer.engine itself, which the backend's strategy sandbox allows wholesale, so a strategy can simply:

import com.wualabs.qtsurfer.engine.EngineVersion;
String engine = EngineVersion.get();   // e.g. "0.99.53"
if (EngineVersion.getPatch() >= 53) {  // 0 / 99 / 53
  // ...
}

Why it exists (2026-07-25): engine 0.99.51 deleted StateStoreSupport, which silently broke every stored strategy written against the older listener contract. Making the running engine version legible — from a health endpoint, from a strategy, and eventually recorded alongside each stored strategy's source — is what turns that class of break from mysterious into diagnosable.

Resolution never throws: an unresolvable version yields UNKNOWN — and UNKNOWN_COMPONENT from the numeric accessors — so a caller such as a health endpoint degrades to reporting "unknown" rather than failing.

  • Field Details

    • UNKNOWN

      public static final String UNKNOWN
      Reported when the version metadata cannot be read.
      See Also:
    • UNKNOWN_COMPONENT

      public static final int UNKNOWN_COMPONENT
      Reported by getMajor(), getMinor() and getPatch() when get() is not a parseable major.minor.patch version — including when it is UNKNOWN. Negative on purpose: a version gate such as getPatch() >= 53 then fails closed rather than matching by accident.
      See Also:
  • Method Details

    • get

      public static String get()
      The engine version (e.g. "0.99.53"), or UNKNOWN if it cannot be determined. Resolved once at class-init; callers may invoke this freely.
    • getMajor

      public static int getMajor()
      The major component of get() (the 0 of "0.99.53"), or UNKNOWN_COMPONENT.
    • getMinor

      public static int getMinor()
      The minor component of get() (the 99 of "0.99.53"), or UNKNOWN_COMPONENT.
    • getPatch

      public static int getPatch()
      The patch component of get() (the 53 of "0.99.53"), or UNKNOWN_COMPONENT. Any build qualifier (-SNAPSHOT, …) is ignored.