Class ManagedOwnershipContext

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

public final class ManagedOwnershipContext extends Object
Actual per-claim capability supplied only through an ownership provider in its owned CALL. It never rebinds to a new owner. Every effect is a native FENCED mutation in the lease resource; arbitrary SQL, files, Java callbacks and external RPC are outside this protection. Its protected data namespace includes the trusted tenant and shard, so application keys cannot escape it.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the current acquired/renewed token only inside the owning USER work.
    long
    Returns the native lease's acquisition/renewal epoch.
    long
    Returns the pinned partition epoch, or zero for an explicitly fixed non-migrating group.
    org.j7m.middleware.distributed.ReplicatedResources.Value
    read(String key)
    Reads a fresh quorum snapshot from this context's protected namespace.
    boolean
    Reports local revocation, not a remote proof of current ownership.
    Omits tenant, keys, owner, values and token details from incidental diagnostics.
    long
    write(String effectId, String key, String value)
    Writes String data through the same resource's atomic native FENCED operation.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • revoked

      public boolean revoked()
      Reports local revocation, not a remote proof of current ownership. Native effects always validate their fence and epoch independently. Checking this flag never renews a lease.
      Returns:
      true after loss, cancellation, budget expiry or cleanup
    • fence

      public long fence()
      Returns the current acquired/renewed token only inside the owning USER work.
      Returns:
      snapshot fence; not authorization for arbitrary external effects
      Throws:
      org.j7m.middleware.api.MiddlewareException - outside the owning invocation or after revocation
    • leadershipEpoch

      public long leadershipEpoch()
      Returns the native lease's acquisition/renewal epoch.
      Returns:
      historical native lease epoch
      Throws:
      org.j7m.middleware.api.MiddlewareException - outside the owning invocation or after revocation
    • partitionEpoch

      public long partitionEpoch()
      Returns the pinned partition epoch, or zero for an explicitly fixed non-migrating group.
      Returns:
      immutable claim session epoch; it never follows handoff
      Throws:
      org.j7m.middleware.api.MiddlewareException - outside the owning invocation or after revocation
    • write

      public long write(String effectId, String key, String value)
      Writes String data through the same resource's atomic native FENCED operation. Keys are restricted to this authenticated tenant/shard namespace. Reusing an effect identity with different arguments fails; a lost response is UNKNOWN and never authorizes body replay.
      Parameters:
      effectId - stable identity within this claim,1..512 characters without NUL
      key - application key,1..512 characters without NUL
      value - non-null String, at most4096 UTF16 units; code units round-trip without normalization
      Returns:
      committed native version, not fresh ownership authority
      Throws:
      org.j7m.middleware.api.MiddlewareException - on revocation, native rejection, permission, uncertain I/O or host effect-capacity exhaustion
      IllegalArgumentException - for invalid data bounds or effect-identity conflict
    • read

      public org.j7m.middleware.distributed.ReplicatedResources.Value read(String key)
      Reads a fresh quorum snapshot from this context's protected namespace. This is not an atomic transaction with a separate effect and does not replace the fence check on every write.
      Parameters:
      key - application key,1..512 characters without NUL
      Returns:
      decoded String/native version, or null when absent
      Throws:
      org.j7m.middleware.api.MiddlewareException - after revocation, permission denial, invalid frame or uncertain I/O
      IllegalArgumentException - for invalid key
    • toString

      public String toString()
      Omits tenant, keys, owner, values and token details from incidental diagnostics.
      Overrides:
      toString in class Object
      Returns:
      fixed safe label