ManagedClient API
Every method on ManagedClient, grouped by concern. The OPC UA operations mirror OpcUaClientInterface; the daemon-only methods (connectForceNew, wasSessionReused, getSessionId) are flagged.
PhpOpcua\SessionManager\Client\ManagedClient implements
OpcUaClientInterface plus three daemon-specific methods. This
page lists the full surface; per-method semantics are in the
linked topic pages.
For OPC UA operations (read, write, browse, subscribe, …),
the operational documentation is in opcua-client — same
interface, same semantics, same examples. The cards below are the
signatures; click the links for the prose.
Construction
new ManagedClient(string \$socketPath = '/tmp/opcua-session-manager.sock', float \$timeout = 30.0, ?string \$authToken = null)
Session lifecycle (daemon-specific)
connect(string \$endpointUrl): void
connectForceNew(string \$endpointUrl): void
disconnect(): void
reconnect(): void
isConnected(): bool
getConnectionState(): ConnectionState
wasSessionReused(): bool
getSessionId(): ?string
connectForceNew(), wasSessionReused(), and getSessionId() are
not on OpcUaClientInterface — they exist only on
ManagedClient. See ManagedClient · Opening and
closing.
Configuration (builder-style)
Set before connect(); setters return $this for chaining.
setTimeout(float \$timeout): self
setAutoRetry(int \$maxRetries): self
setBatchSize(int \$batchSize): self
setDefaultBrowseMaxDepth(int \$maxDepth): self
setAutoDetectWriteType(bool \$enabled): self
setReadMetadataCache(bool \$enabled): self
setCache(?CacheInterface \$cache): self
Security (builder-style)
setSecurityPolicy(SecurityPolicy \$policy): self
setSecurityMode(SecurityMode \$mode): self
setClientCertificate(string \$certPath, string \$keyPath, ?string \$caCertPath = null): self
setUserCredentials(string \$username, string \$password): self
setUserCertificate(string \$certPath, string \$keyPath): self
setTrustStorePath(string \$trustStorePath): self
setTrustPolicy(?TrustPolicy \$policy): self
autoAccept(bool \$enabled = true, bool \$force = false): self
Certificate paths must sit under the daemon's --allowed-cert-dirs
when that flag is set — see
Daemon · Security hardening.
Trust store runtime
trustCertificate(string \$certDer): void
untrustCertificate(string \$fingerprint): void
getTrustStore(): ?TrustStoreInterface
getTrustPolicy(): ?TrustPolicy
Logging and events
setLogger(LoggerInterface \$logger): self
getLogger(): LoggerInterface
setEventDispatcher(EventDispatcherInterface \$dispatcher): self
getEventDispatcher(): EventDispatcherInterface
getExtensionObjectRepository(): ExtensionObjectRepository
These are client-side loggers and dispatchers. Events fired by the OPC UA stack land in the daemon's dispatcher, not here. See ManagedClient · Differences from the direct client.
Introspection (v4.2.0+)
First call costs one IPC round-trip; subsequent calls are answered from a per-session cache.
hasMethod(string \$name): bool
hasModule(string \$moduleClass): bool
getRegisteredMethods(): string[]
getLoadedModules(): class-string[]
Reading
read(NodeId|string \$nodeId, int \$attributeId = 13, bool \$refresh = false): DataValue
readMulti(?array \$readItems = null): array|ReadMultiBuilder
Writing
write(NodeId|string \$nodeId, mixed \$value, ?BuiltinType \$type = null): int
writeMulti(?array \$writeItems = null): array|WriteMultiBuilder
Browsing
browse(NodeId|string \$nodeId, BrowseDirection \$direction = BrowseDirection::Forward, ?NodeId \$referenceTypeId = null, bool \$includeSubtypes = true, array \$nodeClasses = [], bool \$useCache = true): ReferenceDescription[]
browseAll(NodeId|string \$nodeId, BrowseDirection \$direction = BrowseDirection::Forward, ?NodeId \$referenceTypeId = null, bool \$includeSubtypes = true, array \$nodeClasses = [], bool \$useCache = true): ReferenceDescription[]
browseRecursive(NodeId|string \$nodeId, BrowseDirection \$direction = BrowseDirection::Forward, ?int \$maxDepth = null, ?NodeId \$referenceTypeId = null, bool \$includeSubtypes = true, array \$nodeClasses = []): BrowseNode[]
browseWithContinuation(NodeId|string \$nodeId, ...): BrowseResultSet
browseNext(string \$continuationPoint): BrowseResultSet
translateBrowsePaths(?array \$browsePaths = null): array|BrowsePathsBuilder
resolveNodeId(string \$path, NodeId|string|null \$startingNodeId = null, bool \$useCache = true): NodeId
Method calls
call(NodeId|string \$objectId, NodeId|string \$methodId, array \$inputArguments = []): CallResult
Subscriptions and monitored items
createSubscription(float \$publishingInterval = 500.0, int \$lifetimeCount = 2400, int \$maxKeepAliveCount = 10, int \$maxNotificationsPerPublish = 0, bool \$publishingEnabled = true, int \$priority = 0): SubscriptionResult
createMonitoredItems(int \$subscriptionId, ?array \$monitoredItems = null): MonitoredItemResult[]|MonitoredItemsBuilder
createEventMonitoredItem(int \$subscriptionId, NodeId|string \$nodeId, array \$selectFields = ['EventId','EventType','SourceName','Time','Message','Severity'], int \$clientHandle = 1): MonitoredItemResult
modifyMonitoredItems(int \$subscriptionId, array \$itemsToModify): MonitoredItemModifyResult[]
deleteMonitoredItems(int \$subscriptionId, array \$monitoredItemIds): int[]
setTriggering(int \$subscriptionId, int \$triggeringItemId, array \$linksToAdd = [], array \$linksToRemove = []): SetTriggeringResult
deleteSubscription(int \$subscriptionId): int
publish(array \$acknowledgements = []): PublishResult
transferSubscriptions(array \$subscriptionIds, bool \$sendInitialValues = false): TransferResult[]
republish(int \$subscriptionId, int \$retransmitSequenceNumber): array
History reads
historyReadRaw(NodeId|string \$nodeId, ?DateTimeImmutable \$startTime = null, ?DateTimeImmutable \$endTime = null, int \$numValuesPerNode = 0, bool \$returnBounds = false): DataValue[]
historyReadProcessed(NodeId|string \$nodeId, DateTimeImmutable \$startTime, DateTimeImmutable \$endTime, float \$processingInterval, NodeId \$aggregateType): DataValue[]
historyReadAtTime(NodeId|string \$nodeId, array \$timestamps): DataValue[]
Node management
addNodes(array \$nodesToAdd): AddNodesResult[]
deleteNodes(array \$nodesToDelete): int[]
addReferences(array \$referencesToAdd): int[]
deleteReferences(array \$referencesToDelete): int[]
NodeManagement is optional in the OPC UA spec — servers may
respond with ServiceUnsupportedException. See opcua-client —
managing nodes.
Discovery and server info
getEndpoints(string \$endpointUrl, bool \$useCache = true): EndpointDescription[]
discoverDataTypes(?int \$namespaceIndex = null, bool \$useCache = true): int
getServerProductName(): ?string
getServerManufacturerName(): ?string
getServerSoftwareVersion(): ?string
getServerBuildNumber(): ?string
getServerBuildDate(): ?DateTimeImmutable
getServerBuildInfo(): BuildInfo
Cache (runtime)
getCache(): ?CacheInterface
invalidateCache(NodeId|string \$nodeId): void
flushCache(): void
invalidateCache() and flushCache() act on the daemon-side
cache via IPC — the only cache that exists in this architecture.
See Daemon · Logging and cache.
Configuration accessors
getTimeout(): float
getAutoRetry(): int
getBatchSize(): ?int
getServerMaxNodesPerRead(): ?int
getServerMaxNodesPerWrite(): ?int
getDefaultBrowseMaxDepth(): int
Each accessor that reaches the daemon costs one IPC round-trip.
The local-only ones (getLogger, getEventDispatcher,
getExtensionObjectRepository, getTrustStore, getTrustPolicy)
do not.