Files
UA-.NETStandard/docs/EndpointRegistry.md
Marc 965237768d Co-locate registry generation tooling and refine guides
Move registry generators, model import and provenance manifests into the consuming Endpoint Registry package. Update generation roots, headers and links while preserving model hashes and generated behavior. Place developer instructions beside the scripts and keep runtime guides focused on current contracts.
2026-10-12 06:42:45 +02:00

6.6 KiB

Native Endpoint, Message and Schema registries

The OPC 30455 Endpoint Registry combines Endpoint Groups and reusable Message Groups. Messages are metadata-only Objects, not payload files. The separate optional OPC 30451 Schema Registry owns exact schema documents and their explicit logical defaults. Neither hosting a catalog nor reading an Endpoint connects a broker or configures PubSub.

Modules and hosting

Endpoint Registry and Schema Registry use the xRegistry packages for native values, record mapping, document contracts, CAS state stores, metadata commits, pinned snapshots and projection support. Schema Registry is independent of Endpoint Registry. Registry packages target net48, net8.0, net9.0 and net10.0.

Register EndpointRegistryNodeManagerFactory explicitly to host Endpoint/Message catalogs. Use EndpointRegistryServerOptions.Generic for a generic or Message-only catalog, and Media for a distinct media-only root. Loading dependency models does not host Schema Registry. To host schemas, register SchemaRegistryNodeManagerFactory or call services.AddSchemaRegistryServer(...) separately. Supplied stores remain application-owned.

FileRegistryStateStore supports single-writer staged atomic publication and restart. Use separate directories for independent catalogs; it is not shared-folder or clustered HA. Validation failures and stale epochs publish nothing. If durable publication succeeds but address-space activation fails, the mutation reports UncertainNotAllNodesAvailable; retry/recovery must inspect the committed generation rather than assume a failed no-op.

Native clients

The reusable clients depend on model/client modules, not server implementations. Applications own the connected authenticated Session and its certificate policy.

EndpointRegistryClient endpoints =
    await EndpointRegistryClient.DiscoverAsync(session, telemetry);
RegistryReadResultDataType read =
    await endpoints.ReadDocumentAsync(new RegistryReadRequestDataType
    {
        TargetXid = "/messagegroups/factory/messages/temperature",
        DocumentKind = "metadata",
        View = 1,
        MaxItems = 100
    });

Check the returned native StatusCode and Issues before consuming its Document. An OPC UA service failure throws; a successful Call can still return a bad native result. Use generated records and PresentFields for writes, with the observed target epoch as ExpectedEpoch. Canonicalize sets canonical unused fields without guessing presence. Unknown fields and explicit null remain distinct from absence. Exact numbers do not round through Double. A native array must have non-null Items; use RegistryNullValueDataType for explicit JSON null, not a null native array.

RegistrySnapshotClient opens a Session-bound lease, traverses native Structures, arrays, Strings and ByteStrings, and closes asynchronously. It uses advertised encoding bounds, preserves Unicode scalars and rejects incorrect leaf types. Snapshots pin committed content, not an entitlement: revoked access is rechecked before exposing further parts.

Schema admission and access

RegisterSchema supplies namespace URI, schema subject name, format, exact VersionId and entity URI. A logical default also requires an explicit ResourceUri; neither source identity nor logical URI is inferred by reversing an identifier. BeginSchemaUpload provides a bounded Session-owned FileType handle; Close validates and publishes staged bytes. Schema no-ops retain original bytes, including whitespace and numeric source forms. Closing an inherited FileType writer without a non-empty Write also retains its bytes and revisions, including when opened with EraseExisting. Read and Write modes cannot be combined.

Typed schema reads, exact-Version FileType downloads, GetSchema and Opaque fingerprint lookup share the same store. Visibility is evaluated before legacy lookup ambiguity. Distinct visible candidates fail explicitly instead of selecting the first match. The first-party JSON Schema and Avro providers preserve supported declarations.

Shared root metadata, model and capabilities are also native documents. Metadata and its epoch come from one committed generation; hidden Versions are excluded. Oversized documents use pinned subtree/leaf snapshot reads rather than a mandatory JSON fallback.

Federation and Part 14

Opc.Ua.EndpointRegistry.Federation offers explicit UA and authorized HTTPS preloads. Configured trust, observed application/root/type/ownership and collection-qualified identity determine acceptance, not client-authored trust flags. Group snapshots retain native records and actual browsed UA targets. Raw metadata must agree with its independent observed epoch. Pure Message resolution reads verified cached evidence and never initiates network access.

Opc.Ua.EndpointRegistry.Federation.Server binds freshly verified Group observations into the referencing catalog. Durable URI-qualified pins, complete source metadata and separate local identity share its ordinary CAS generation. Restored pins do not authorize a transport target. Read-only OriginRegistry, ExternalReference and GroupUrl appear only after configured verification; source loss and retirement invalidate them. The referencing Server maps remote targets into its own ServerArray without persisting session-local indexes.

Opc.Ua.EndpointRegistry.PubSub binds to the existing PubSub configuration/address-space view. It invalidates References before retirement and republishes associations after activation. It surfaces read-only provider-owned entries without automatic transport configuration. Remote observations require authenticated publisher identity and explicit authorization; retained expiry/replay handling does not invent native targets.

Scope and conformance

The conformance manifest maps implemented facets and their shared prerequisites to observable runtime evidence. It is not OPC Foundation certification. Each deployment advertises only its enabled facets and supplies the required source identity, authorization and trust policies. The inherited Schema creation surface, durable drafts, explicit default/lineage/provenance and compatibility verification share the same publication generation as native/raw registration. Automatic schema materialization, an inbound xRegistry HTTP server and the Schema Server/Full facets remain outside the approved scope. Imported models and passing tests alone are not conformance claims.

See the standalone registry samples for encrypted TCP, durable restart, direct/DI clients and the opt-in existing PubSub client entry point.