Class NuggetAdminConfiguration.Builder

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

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

    • enabled

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

      public NuggetAdminConfiguration.Builder nuggetName(String value)
      Sets the human-readable nugget name.
      Parameters:
      value - nugget name
      Returns:
      this builder
    • unsafeDeveloperMode

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

      public NuggetAdminConfiguration.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 NuggetAdminConfiguration.Builder monotonicTimeSource(LongSupplier value)
      Sets the monotonic time source for throttle calculations.
      Parameters:
      value - monotonic nanosecond source
      Returns:
      this builder
    • secureRandom

      public NuggetAdminConfiguration.Builder secureRandom(SecureRandom value)
      Sets the secure random source for salts and explicit development PINs.
      Parameters:
      value - secure random source
      Returns:
      this builder
    • iterations

      public NuggetAdminConfiguration.Builder iterations(int value)
      Sets the PBKDF2 iteration count.
      Parameters:
      value - iteration count, from 210000 through 1000000
      Returns:
      this builder
    • maxPinBytes

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

      public NuggetAdminConfiguration.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
    • providerExecutionPolicy

      public NuggetAdminConfiguration.Builder providerExecutionPolicy(int concurrency, Duration timeout)
      Sets bounded execution limits for read-only introspection providers.
      Parameters:
      concurrency - maximum concurrent provider calls
      timeout - per-provider timeout
      Returns:
      this builder
    • providerExecutionPolicy

      public NuggetAdminConfiguration.Builder providerExecutionPolicy(int concurrency, int queueCapacity, Duration timeout, Duration shutdownWait)
      Sets bounded execution limits for read-only introspection providers.
      Parameters:
      concurrency - maximum concurrent provider calls
      queueCapacity - maximum queued provider calls
      timeout - per-provider timeout
      shutdownWait - maximum executor shutdown wait
      Returns:
      this builder
    • localDiscovery

      public NuggetAdminConfiguration.Builder localDiscovery(Path directory, boolean value)
      Enables or disables local J7M-owned discovery publication.
      Parameters:
      directory - protected local discovery directory
      value - enabled flag
      Returns:
      this builder
    • discoveryTiming

      public NuggetAdminConfiguration.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 NuggetAdminConfiguration.Builder maxDiscoveryRecords(int value)
      Sets the maximum local discovery records scanned per operation.
      Parameters:
      value - maximum record count
      Returns:
      this builder
    • discoveryTarget

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

      public NuggetAdminConfiguration.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 NuggetAdminConfiguration.Builder pinFromEnvironment(String variableName)
      Adds a configured environment variable PIN source.
      Parameters:
      variableName - environment variable name
      Returns:
      this builder
    • pinFromEnvironment

      public NuggetAdminConfiguration.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 NuggetAdminConfiguration.Builder pinFromProtectedFile(Path path)
      Adds a protected PIN file source.
      Parameters:
      path - configured file path
      Returns:
      this builder
    • pinFromDirectProcessArgument

      public NuggetAdminConfiguration.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 NuggetAdminConfiguration.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 NuggetAdminConfiguration.Builder pinFromProtectedVerifierFile(Path path)
      Adds a protected verifier file source.
      Parameters:
      path - verifier record path
      Returns:
      this builder
    • generatedDevelopmentPin

      public NuggetAdminConfiguration.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 NuggetAdminConfiguration.Builder introspectionProvider(org.j7m.middleware.operations.api.NuggetIntrospection.Provider value)
      Adds a trusted typed read-only introspection provider.
      Parameters:
      value - provider to execute through bounded runtime controls
      Returns:
      this builder
    • applicationDeployer

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

      The runtime stores only the public API contract. Supplying null disables lifecycle mutation support and causes requests to return a truthful unavailable result.

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

      public NuggetAdminConfiguration.Builder readOnly(boolean value)
      Enables or disables read-only administration mode.

      Read-only mode leaves admission and inspection available but rejects lifecycle mutations before the deployer is invoked.

      Parameters:
      value - read-only flag
      Returns:
      this builder
    • startApplicationEnabled

      public NuggetAdminConfiguration.Builder startApplicationEnabled(boolean value)
      Enables or disables application start operations.

      Stop, drain, and unload are controlled by the general read-only gate and authorization policy. This flag exists so production embedders can disable repository-coordinate activation while preserving other lifecycle controls.

      Parameters:
      value - start-enabled flag
      Returns:
      this builder
    • killEnabled

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

      The default is disabled. Enabling this flag is not sufficient by itself: the caller must also supply a termination capability and each request must pass admission, authorization, exact self-target validation, confirmation, and deadline checks.

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

      public NuggetAdminConfiguration.Builder controlExecutionPolicy(int concurrency, int queueCapacity, Duration timeout, Duration shutdownWait)
      Sets bounded execution limits for nugget-level control operations.
      Parameters:
      concurrency - maximum concurrent control calls, currently only 1
      queueCapacity - maximum queued control calls
      timeout - positive control-operation deadline, at most 30 seconds
      shutdownWait - positive maximum control-executor shutdown wait, at most 10 seconds
      Returns:
      this builder
    • confirmationPolicy

      public NuggetAdminConfiguration.Builder confirmationPolicy(Duration ttl, int maxRetained)
      Sets bounded confirmation retention for nugget controls.
      Parameters:
      ttl - positive confirmation time-to-live, at most five minutes
      maxRetained - maximum retained live challenges
      Returns:
      this builder
    • runtimeCloseAction

      public NuggetAdminConfiguration.Builder runtimeCloseAction(Runnable value)
      Sets the runtime close capability used for graceful nugget shutdown.

      The builder-owned runtime assembly path installs the authoritative MiddlewareRuntime.close() action here. The action is executed asynchronously after the public result boundary and must not be the admin service's own AutoCloseable.close() method.

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

      public NuggetAdminConfiguration.Builder terminationCapability(Runnable value)
      Sets the injected self-termination capability for forced nugget termination tests or controlled embedders.

      The implementation never installs a platform termination primitive by default. Supplying this callback does not enable kill unless killEnabled(boolean) is also set to true; production code must not use this hook to implement arbitrary process-id selection or shell execution.

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

      public NuggetAdminConfiguration.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 are sensitive
      Returns:
      this builder
    • build

      public NuggetAdminConfiguration build()
      Builds an immutable configuration.
      Returns:
      configuration