Class FireweaveProvider

java.lang.Object
ai.fireweave.openfeature.FireweaveProvider
All Implemented Interfaces:
dev.openfeature.sdk.FeatureProvider, AutoCloseable

public final class FireweaveProvider extends Object implements dev.openfeature.sdk.FeatureProvider, AutoCloseable
OpenFeature FeatureProvider backed by a FireweaveRuntime.

Semantics

  • All five resolvers supported. Long-clamp limitation: the Java OF integer resolver is 32-bit Integer; integral flag values outside Integer range resolve as TYPE_MISMATCH + default rather than silently truncating. Cross-language integer reliability is documented to 2^53−1 (Capabilities.INT_SAFE_MAX_ABS); fixture eval-int-beyond-safe-integer is skipped-with-documented-limitation for Java.
  • targetingKey maps to the backend identity (PostHog distinct_id).
  • Resolvers never throw on the normal path: failures return the default with reason=ERROR, the mapped OF error code, and fireweave.errorKind flag metadata.
  • initialize(dev.openfeature.sdk.EvaluationContext) / shutdown() drive the runtime lifecycle; a Configuration failure raises OF FatalError (PROVIDER_FATAL).
  • All methods are synchronous — no evaluation path here is genuinely async, so no CompletionStage surface is exposed (decision brief).

Thread-safety

Stateless facade over the thread-safe runtime; safe for concurrent resolution.
  • Constructor Details

    • FireweaveProvider

      public FireweaveProvider(ai.fireweave.sdk.FireweaveRuntime runtime)
    • FireweaveProvider

      public FireweaveProvider(ai.fireweave.sdk.FireweaveRuntime runtime, FireweaveProvider.InitMode initMode)
  • Method Details

    • runtime

      public ai.fireweave.sdk.FireweaveRuntime runtime()
    • getMetadata

      public dev.openfeature.sdk.Metadata getMetadata()
      Specified by:
      getMetadata in interface dev.openfeature.sdk.FeatureProvider
    • initialize

      public void initialize(dev.openfeature.sdk.EvaluationContext evaluationContext)
      Specified by:
      initialize in interface dev.openfeature.sdk.FeatureProvider
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface dev.openfeature.sdk.FeatureProvider
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getBooleanEvaluation

      public dev.openfeature.sdk.ProviderEvaluation<Boolean> getBooleanEvaluation(String key, Boolean defaultValue, dev.openfeature.sdk.EvaluationContext ctx)
      Specified by:
      getBooleanEvaluation in interface dev.openfeature.sdk.FeatureProvider
    • getStringEvaluation

      public dev.openfeature.sdk.ProviderEvaluation<String> getStringEvaluation(String key, String defaultValue, dev.openfeature.sdk.EvaluationContext ctx)
      Specified by:
      getStringEvaluation in interface dev.openfeature.sdk.FeatureProvider
    • getIntegerEvaluation

      public dev.openfeature.sdk.ProviderEvaluation<Integer> getIntegerEvaluation(String key, Integer defaultValue, dev.openfeature.sdk.EvaluationContext ctx)
      Specified by:
      getIntegerEvaluation in interface dev.openfeature.sdk.FeatureProvider
    • getDoubleEvaluation

      public dev.openfeature.sdk.ProviderEvaluation<Double> getDoubleEvaluation(String key, Double defaultValue, dev.openfeature.sdk.EvaluationContext ctx)
      Specified by:
      getDoubleEvaluation in interface dev.openfeature.sdk.FeatureProvider
    • getObjectEvaluation

      public dev.openfeature.sdk.ProviderEvaluation<dev.openfeature.sdk.Value> getObjectEvaluation(String key, dev.openfeature.sdk.Value defaultValue, dev.openfeature.sdk.EvaluationContext ctx)
      Specified by:
      getObjectEvaluation in interface dev.openfeature.sdk.FeatureProvider