Interface OpcConnection
- All Superinterfaces:
Lifecycle
An
OpcConnection is a connection to some kind of OPC server.
It is agnostic of the underlying technology (e.g. OPC Classic vs OPC UA) and instead relies on basic abstractions for read, write, browse, and subscribe.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbrowse(ServerNodeId node) default @Nullable OPCBrowseElementdescribe(ServerNodeId node) Return metadata for the exact OPC node identified bynode, ornullwhen the connection cannot prove exact-node details.Returns the "aliases", or alternative names, for a server.The timestamp when this connection made the transition toOpcConnection.State.CONNECTED, orOptional.empty()if not currently connected.getFault()If theOpcConnection.StateisOpcConnection.State.FAULTEDthen return aThrowablecontaining the reason, otherwise,Optional.empty().getState()read(List<ServerNodeId> nodes) write(List<OPCWriteRequest> writes)
-
Method Details
-
read
-
write
-
browse
- Throws:
Exception
-
describe
Return metadata for the exact OPC node identified bynode, ornullwhen the connection cannot prove exact-node details.- Throws:
Exception
-
getState
OpcConnection.State getState()- Returns:
- the current
OpcConnection.Stateof the connection.
-
getConnectionTimestamp
Optional<LocalDateTime> getConnectionTimestamp()The timestamp when this connection made the transition toOpcConnection.State.CONNECTED, orOptional.empty()if not currently connected. -
getFault
If theOpcConnection.StateisOpcConnection.State.FAULTEDthen return aThrowablecontaining the reason, otherwise,Optional.empty().- Returns:
- a
Throwablecontaining the reason for a connection fault, orOptional.empty()if not faulted.
-
getAliases
-