Class NuggetAdminRuntimeConfiguration.Builder

java.lang.Object
org.j7m.middleware.runtime.NuggetAdminRuntimeConfiguration.Builder
Enclosing class:
NuggetAdminRuntimeConfiguration

public static final class NuggetAdminRuntimeConfiguration.Builder extends Object
Mutable builder for NuggetAdminRuntimeConfiguration.
  • Method Details

    • enabled

      public NuggetAdminRuntimeConfiguration.Builder enabled(boolean value)
      Sets whether nugget administration is enabled.
      Parameters:
      value - enabled flag
      Returns:
      this builder
    • nuggetName

      Sets the human-readable nugget name.
      Parameters:
      value - nugget name
      Returns:
      this builder
    • unsafeDeveloperMode

      public NuggetAdminRuntimeConfiguration.Builder unsafeDeveloperMode(boolean value)
      Enables or disables explicit unsafe developer mode.
      Parameters:
      value - unsafe developer flag
      Returns:
      this builder
    • security

      public NuggetAdminRuntimeConfiguration.Builder security(org.j7m.middleware.security.api.SecurityConfiguration value)
      Sets the existing runtime security configuration.
      Parameters:
      value - security configuration
      Returns:
      this builder
    • clock

      Sets the wall clock for deterministic tests and audit timestamps.
      Parameters:
      value - wall clock
      Returns:
      this builder
    • monotonicTimeSource

      public NuggetAdminRuntimeConfiguration.Builder monotonicTimeSource(LongSupplier value)
      Sets the monotonic time source for throttle calculations.
      Parameters:
      value - monotonic nanosecond source
      Returns:
      this builder
    • secureRandom

      Sets the secure random source for salts and explicit development PINs.
      Parameters:
      value - secure random source
      Returns:
      this builder
    • iterations

      public NuggetAdminRuntimeConfiguration.Builder iterations(int value)
      Sets the PBKDF2 iteration count.
      Parameters:
      value - iteration count within the Phase 7.1 verifier policy
      Returns:
      this builder
    • maxPinBytes

      public NuggetAdminRuntimeConfiguration.Builder maxPinBytes(int value)
      Sets the maximum accepted UTF-8 encoded PIN length.
      Parameters:
      value - maximum byte length
      Returns:
      this builder
    • throttlePolicy

      public NuggetAdminRuntimeConfiguration.Builder throttlePolicy(int maxBuckets, Duration window, Duration maxDelay)
      Sets throttle policy limits.
      Parameters:
      maxBuckets - maximum retained throttle buckets
      window - failure window
      maxDelay - maximum retry delay
      Returns:
      this builder
    • pinFromProgrammaticProvider

      public NuggetAdminRuntimeConfiguration.Builder pinFromProgrammaticProvider(String description, org.j7m.middleware.operations.api.NuggetPinSecretProvider provider)
      Adds a protected programmatic PIN source.
      Parameters:
      description - safe source description
      provider - protected provider
      Returns:
      this builder
    • pinFromEnvironment

      public NuggetAdminRuntimeConfiguration.Builder pinFromEnvironment(String variableName)
      Adds a configured environment variable PIN source.
      Parameters:
      variableName - environment variable name
      Returns:
      this builder
    • pinFromEnvironment

      public NuggetAdminRuntimeConfiguration.Builder pinFromEnvironment(String variableName, Function<String,String> lookup)
      Adds a configured environment variable PIN source with injectable lookup.
      Parameters:
      variableName - environment variable name
      lookup - environment lookup
      Returns:
      this builder
    • pinFromProtectedFile

      public NuggetAdminRuntimeConfiguration.Builder pinFromProtectedFile(Path path)
      Adds a protected PIN file source.
      Parameters:
      path - configured file path
      Returns:
      this builder
    • pinFromDirectProcessArgument

      public NuggetAdminRuntimeConfiguration.Builder pinFromDirectProcessArgument(char[] pin)
      Adds a lower-safety direct process argument PIN source.
      Parameters:
      pin - PIN characters copied into the configuration source
      Returns:
      this builder
    • pinFromInteractiveBootstrap

      public NuggetAdminRuntimeConfiguration.Builder pinFromInteractiveBootstrap(org.j7m.middleware.operations.api.NuggetPinSecretProvider provider)
      Adds an explicit interactive bootstrap source supplied by the embedding runtime.
      Parameters:
      provider - terminal-safe prompt provider
      Returns:
      this builder
    • pinFromProtectedVerifierFile

      public NuggetAdminRuntimeConfiguration.Builder pinFromProtectedVerifierFile(Path path)
      Adds a protected verifier file source.
      Parameters:
      path - verifier record path
      Returns:
      this builder
    • generatedDevelopmentPin

      public NuggetAdminRuntimeConfiguration.Builder generatedDevelopmentPin(Consumer<char[]> receiver)
      Requests an explicit generated development PIN in unsafe developer mode.
      Parameters:
      receiver - local developer channel receiving a copied PIN
      Returns:
      this builder
    • introspectionProvider

      public NuggetAdminRuntimeConfiguration.Builder introspectionProvider(org.j7m.middleware.operations.api.NuggetIntrospection.Provider value)
      Adds one trusted bounded provider for read-only introspection.

      The provider is invoked by the nugget admin runtime through an internally bounded executor with provider deadlines. Returned values are still projected, authorized, redacted, filtered, sorted, and paged by the runtime before public DTO construction.

      Parameters:
      value - typed read-only provider
      Returns:
      this builder
    • applicationDeployer

      public NuggetAdminRuntimeConfiguration.Builder applicationDeployer(org.j7m.middleware.deployer.api.ApplicationDeployer value)
      Sets the public deployer authority used by nugget application lifecycle operations.

      The runtime depends only on ApplicationDeployer; it does not depend on the application-platform implementation module. A missing deployer returns truthful unavailable lifecycle results.

      Parameters:
      value - deployer authority, or null
      Returns:
      this builder
    • readOnly

      public NuggetAdminRuntimeConfiguration.Builder readOnly(boolean value)
      Enables or disables read-only administration mode.
      Parameters:
      value - read-only flag
      Returns:
      this builder
    • startApplicationEnabled

      public NuggetAdminRuntimeConfiguration.Builder startApplicationEnabled(boolean value)
      Enables or disables repository-coordinate start operations.
      Parameters:
      value - start-enabled flag
      Returns:
      this builder
    • killEnabled

      public NuggetAdminRuntimeConfiguration.Builder killEnabled(boolean value)
      Enables or disables explicitly gated nugget self-termination.

      The default is disabled. Enabling this flag does not install a termination primitive and does not bypass PIN admission, authorization, exact target validation, confirmation, deadlines, or audit.

      Parameters:
      value - kill-enabled flag
      Returns:
      this builder
    • controlExecutionPolicy

      public NuggetAdminRuntimeConfiguration.Builder controlExecutionPolicy(int concurrency, int queueCapacity, Duration timeout, Duration shutdownWait)
      Sets bounded execution policy for nugget-level control operations.
      Parameters:
      concurrency - maximum concurrent control calls, currently only 1
      queueCapacity - maximum queued control calls, currently 0 through 4
      timeout - positive control deadline, at most 30 seconds
      shutdownWait - positive control-executor shutdown wait, at most 10 seconds
      Returns:
      this builder
      Throws:
      IllegalArgumentException - when a value is outside policy
    • confirmationPolicy

      public NuggetAdminRuntimeConfiguration.Builder confirmationPolicy(Duration ttl, int maxRetained)
      Sets bounded confirmation challenge retention for nugget controls.
      Parameters:
      ttl - positive confirmation time-to-live, at most five minutes
      maxRetained - maximum retained live confirmation challenges
      Returns:
      this builder
      Throws:
      IllegalArgumentException - when a value is outside policy
    • runtimeCloseAction

      public NuggetAdminRuntimeConfiguration.Builder runtimeCloseAction(Runnable value)
      Sets the authoritative runtime close action used for graceful nugget shutdown.

      Embedders normally receive this automatically from MiddlewareRuntimeBuilder. The callback must invoke the owning runtime close path and must not call nugget-admin close directly.

      Parameters:
      value - runtime close action, or null
      Returns:
      this builder
    • terminationCapability

      public NuggetAdminRuntimeConfiguration.Builder terminationCapability(Runnable value)
      Sets an injected self-termination capability for explicitly enabled forced nugget termination.

      No default capability is installed. Tests may supply a fake callback. Production embedders must not use this method for arbitrary process control, process-id selection, shell execution, or direct unbounded JVM termination.

      Parameters:
      value - injected self-termination callback, or null
      Returns:
      this builder
    • providerExecutionPolicy

      public NuggetAdminRuntimeConfiguration.Builder providerExecutionPolicy(int concurrency, Duration timeout)
      Sets bounded provider execution policy for read-only introspection.
      Parameters:
      concurrency - maximum concurrent provider calls, currently 1 or 2
      timeout - positive per-provider deadline, at most 30 seconds
      Returns:
      this builder
      Throws:
      IllegalArgumentException - when a value is outside the runtime policy
    • providerExecutionPolicy

      public NuggetAdminRuntimeConfiguration.Builder providerExecutionPolicy(int concurrency, int queueCapacity, Duration timeout, Duration shutdownWait)
      Sets bounded provider execution policy for read-only introspection.
      Parameters:
      concurrency - maximum concurrent provider calls, currently 1 or 2
      queueCapacity - maximum queued provider calls, currently 0 through 8
      timeout - positive per-provider deadline, at most 30 seconds
      shutdownWait - positive maximum shutdown wait, at most 10 seconds
      Returns:
      this builder
      Throws:
      IllegalArgumentException - when a value is outside the runtime policy
    • storageRoot

      public NuggetAdminRuntimeConfiguration.Builder storageRoot(String role, Path path, boolean sensitive)
      Adds a configured storage root for disk introspection.
      Parameters:
      role - storage role
      path - root path
      sensitive - whether path components require redaction
      Returns:
      this builder
    • localDiscovery

      public NuggetAdminRuntimeConfiguration.Builder localDiscovery(Path directory, boolean enabled)
      Enables or disables protected local nugget discovery publication.

      The directory is validated by the runtime before publication. It is not exposed through public discovery records.

      Parameters:
      directory - local J7M-owned discovery directory
      enabled - enabled flag
      Returns:
      this builder
    • discoveryTiming

      public NuggetAdminRuntimeConfiguration.Builder discoveryTiming(Duration ttl, Duration heartbeat)
      Sets local discovery lease and heartbeat timing.
      Parameters:
      ttl - record time-to-live
      heartbeat - heartbeat refresh interval
      Returns:
      this builder
    • maxDiscoveryRecords

      public NuggetAdminRuntimeConfiguration.Builder maxDiscoveryRecords(int value)
      Sets the maximum local discovery records scanned per discovery call.
      Parameters:
      value - record limit
      Returns:
      this builder
    • discoveryTarget

      public NuggetAdminRuntimeConfiguration.Builder discoveryTarget(org.j7m.middleware.operations.api.NuggetDiscovery.ConfiguredTarget target)
      Adds an explicit configured discovery target.
      Parameters:
      target - configured target
      Returns:
      this builder
    • build

      Builds an immutable runtime configuration.
      Returns:
      runtime configuration