Class ManagedOwnershipBackend

java.lang.Object
org.j7m.middleware.application.distributed.ManagedOwnershipBackend

public final class ManagedOwnershipBackend extends Object
Opaque trusted lease-and-sink source. A claim pins one session; an existing context never follows a new partition owner. Every protected mutation uses native FENCED in the exact resource that owns its lease. This adapter adds no native protocol and supplies no arbitrary-effect callback.
  • Method Details

    • group

      public static ManagedOwnershipBackend group(org.j7m.middleware.distributed.ResourceEndpoint endpoint)
      Borrows a fixed authoritative resource group. Native leader changes within that same group remain supported; migrating partitions must instead use the explicitly pinned partition form. The host must not pass an endpoint that silently switches resource groups.
      Parameters:
      endpoint - authorized non-migrating group endpoint
      Returns:
      opaque borrowed backend, without starting workers or acquiring a lease
      Throws:
      NullPointerException - for null endpoint
      IllegalArgumentException - for the known local moving-partition facade
    • partition

      public static ManagedOwnershipBackend partition(String partitionId, String authenticatedScope, org.j7m.middleware.distributed.PartitionAdminClient topology, Map<String, ManagedOwnershipBackend.PartitionGroup> groups)
      Resolves topology only before each new claim, then pins all mutations to that ownership epoch. A frozen/moved group revokes the existing claim rather than replaying its body against a new owner. Both native lease and FENCED commands use the same pinned inner resource and scope.
      Parameters:
      partitionId - stable partition identity
      authenticatedScope - exact native authenticated scope, never taken from application metadata
      topology - borrowed authoritative topology read client
      groups - at most64 fixed, authorized matching resource/partition pairs
      Returns:
      opaque source supporting new claims after authoritative handoff
      Throws:
      IllegalArgumentException - for invalid identities or inventory
      NullPointerException - for null collaborators
    • toString

      public String toString()
      Omits source and authorization data from incidental diagnostics.
      Overrides:
      toString in class Object
      Returns:
      fixed safe label