Interface RepositoryReplicationService

All Superinterfaces:
AutoCloseable

public interface RepositoryReplicationService extends AutoCloseable
J7M-native repository replication service.

The service replicates immutable J7M application artifacts, repository index metadata, promotion state, rollback metadata, and audit-chain records between J7M repositories. Implementations own local repository and durable replication-event state and may block on local file I/O, verification, digest calculation, durable-log append, and recovery. Implementations are expected to be thread-safe for administrative callers unless a narrower ownership model is documented.

Replication is digest-addressed and verification-preserving. It must not weaken strict or regulated repository policy, promote unverified artifacts, silently overwrite conflicts, expose artifact payload bytes, or introduce external object-storage/cloud semantics. Overload, conflict, verification failure, malformed replication events, and recovery failure must map to stable middleware error codes and redacted safe evidence.

  • Method Details

    • advertiseDigest

      RepositoryArtifactDigest advertiseDigest(ApplicationCoordinate coordinate)
      Advertises the digest for one local artifact.

      The digest is calculated or read from verified repository metadata. The result is safe metadata and never contains artifact bytes.

      Parameters:
      coordinate - exact artifact coordinate
      Returns:
      digest descriptor
    • replicate

      Replicates artifacts and selected repository metadata.

      The plan controls artifact, index, promotion, rollback, and audit-chain work. Implementations enforce configured transfer and backpressure limits and reject conflicts instead of overwriting local state.

      Parameters:
      plan - replication plan
      Returns:
      replication result
    • replicatePromotion

      Replicates one promotion state.

      The target artifact must already be present and verified under the effective target policy before promotion state is accepted.

      Parameters:
      record - promotion or demotion record
      Returns:
      replication result
    • replicateRollback

      Replicates rollback metadata after verifying the target artifact exists.

      Rollback records are metadata only; the service does not perform a distributed transaction with runtime activation.

      Parameters:
      record - rollback record
      Returns:
      replication result
    • reconcile

      Compares local and peer repository state.

      The reconciliation plan is a deterministic safe summary of missing, corrupted, or conflicting artifact/index/audit state.

      Returns:
      reconciliation plan
    • repair

      Repairs selected local state from the peer.

      Repair must re-verify bytes, signatures, SBOM, provenance, and index metadata before repaired artifacts are eligible for promotion.

      Parameters:
      plan - repair plan
      Returns:
      repair result
    • status

      Returns current safe status.
      Returns:
      immutable redacted replication status and metrics snapshot
    • close

      void close()
      Closes owned resources.

      Close should be idempotent. After close, operations should reject with a stable unavailable/closed error and must not leak repository secrets or artifact payloads in exception details.

      Specified by:
      close in interface AutoCloseable