AXIAM PHP SDK

NetworkReconciler
in package

FinalYes

The `network` namespace of a §27.6 manifest (CONTRACT.md §27.6.2, contract 1.62): what `plan` reads, and how `apply` writes the three kinds — the tenant's policy, its segments and their reply profiles — through the generated {@see NetworkApi}.

Rules this class keeps, each one the contract's:

  • Reads are GETs, walked to exhaustion (get_policy, list_segments, list_profiles), and every stated member is judged on the value as read: a profile's session_timeout_secs is the effective, clamped one. No hidden or stored value is compared and none is kept.
  • An Update is a full, version-conditional replacement built from the read — the stated members replace the read's, the unstated ones are carried from it, a member stated as none (PHP null in the entity's fields) is left out of the body — sent with the version plan read, exactly. A segment's kind, site_key and name are never in it.
  • A profile carries its segment's version, and when this same apply wrote the segment that is the write's response's, not the one plan read (NetworkApplyState).
  • Nothing is retried, re-read or adjusted. A 409 (a ConflictError with its reason_code) or a 403 is the action's failure, and apply stops there.

Table of Contents

Constants

POLICY_KEY  : mixed = 'network'
The one manifest-local key (and name) of the singleton policy.
UNRECOGNISED_KEY  : mixed = 'unrecognised_values'
The row key holding the raw strings of open-enum members the SDK has no name for (C163-10).

Methods

__construct()  : mixed
applyPolicy()  : string
Creates or replaces the tenant's policy, returning the tenant id (a policy has no id of its own). `replace_policy` sends the version `plan` read — `0` for a tenant that has never written one, which is the first write.
applyProfile()  : string
Creates or replaces one segment's reply profile, returning its id (the segment's).
applySegment()  : string
Creates or replaces one segment, returning its id and recording the write's `version`.
readPolicy()  : array<string, array<string, mixed>>
The tenant's policy, as `get_policy` reads it (it always exists: the default until the tenant first writes one).
readProfiles()  : array<string, array<string, mixed>>
Every reply profile of the tenant, walked to exhaustion and matched to its segment by `segment_id`. Each row also carries `id` (the segment's, which is the profile's address).
readSegments()  : array<string, array<string, mixed>>
Every segment of the tenant, walked to exhaustion.
segmentKey()  : string
The identity of a segment: site + kind + name, `kind` in its WIRE spelling.

Constants

POLICY_KEY

The one manifest-local key (and name) of the singleton policy.

public mixed POLICY_KEY = 'network'

UNRECOGNISED_KEY

The row key holding the raw strings of open-enum members the SDK has no name for (C163-10).

public mixed UNRECOGNISED_KEY = 'unrecognised_values'

Methods

applyPolicy()

Creates or replaces the tenant's policy, returning the tenant id (a policy has no id of its own). `replace_policy` sends the version `plan` read — `0` for a tenant that has never written one, which is the first write.

public applyPolicy(array<string, mixed> $fields, NetworkApplyState $state) : string
Parameters
$fields : array<string, mixed>

The stated members (the whole declaration on a first write).

$state : NetworkApplyState
Return values
string

applyProfile()

Creates or replaces one segment's reply profile, returning its id (the segment's).

public applyProfile(PlannedChange $change, ManifestEntity $entity, string $segmentKey, string $segmentId, NetworkApplyState $state) : string

The profile is written against its segment's newest known version (NetworkApplyState), and a replacement also carries the profile's own version as plan read it.

Parameters
$change : PlannedChange
$entity : ManifestEntity
$segmentKey : string

The segment's key (self::segmentKey()).

$segmentId : string

The segment's server id: read, or just returned by its write.

$state : NetworkApplyState
Return values
string

readPolicy()

The tenant's policy, as `get_policy` reads it (it always exists: the default until the tenant first writes one).

public readPolicy() : array<string, array<string, mixed>>
Return values
array<string, array<string, mixed>> —

self::POLICY_KEY => wire object

readProfiles()

Every reply profile of the tenant, walked to exhaustion and matched to its segment by `segment_id`. Each row also carries `id` (the segment's, which is the profile's address).

public readProfiles(array<string, array<string, mixed>> $segments) : array<string, array<string, mixed>>
Parameters
$segments : array<string, array<string, mixed>>

self::readSegments()'s result.

Return values
array<string, array<string, mixed>> —

segment key => wire object

readSegments()

Every segment of the tenant, walked to exhaustion.

public readSegments() : array<string, array<string, mixed>>
Return values
array<string, array<string, mixed>> —

segment key => wire object

segmentKey()

The identity of a segment: site + kind + name, `kind` in its WIRE spelling.

public static segmentKey(string $site, string $kind, string $name) : string

Encoded as JSON so that no value of the three can be confused with a delimiter: the server judges the values, and this key must not decide that two different triples are one.

Parameters
$site : string
$kind : string
$name : string
Return values
string
On this page

Search results