public interface OpcConnection
OpcConnection
is a connection to some kind of OPC server.
It is agnostic of the underlying technology (i.e. OPC Classic vs OPC UA) and instead relies on basic abstractions for read, write, browse, and subscribe.
Modifier and Type | Interface and Description |
---|---|
static class |
OpcConnection.State |
Modifier and Type | Method and Description |
---|---|
java.util.List<OPCBrowseElement> |
browse(ServerNodeId node) |
default java.util.List<java.lang.String> |
getAliases()
Returns the "aliases", or alternative names, for a server.
|
java.time.LocalDateTime |
getConnectionTimestamp()
The timestamp when this connection made the transition to
OpcConnection.State.CONNECTED , or null if not
currently connected. |
java.lang.Throwable |
getFault()
If the
OpcConnection.State is OpcConnection.State.FAULTED then return a Throwable containing the reason, otherwise,
return null . |
java.lang.String |
getName()
The name of this OPC connection.
|
OpcConnection.State |
getState() |
java.lang.String |
getType()
The type of this OPC connection.
|
boolean |
isEnabled()
Returns
true if this OpcConnection is enabled. |
java.util.List<QualifiedValue> |
read(java.util.List<ServerNodeId> nodes) |
void |
shutdown() |
void |
startup(OpcSubscriptionModel model) |
java.util.List<QualityCode> |
write(java.util.List<OPCWriteRequest> writes) |
java.lang.String getName()
java.lang.String getType()
boolean isEnabled()
true
if this OpcConnection
is enabled.true
if this OpcConnection
is enabled.void startup(OpcSubscriptionModel model)
void shutdown()
java.util.List<QualifiedValue> read(java.util.List<ServerNodeId> nodes)
java.util.List<QualityCode> write(java.util.List<OPCWriteRequest> writes)
java.util.List<OPCBrowseElement> browse(ServerNodeId node) throws java.lang.Exception
java.lang.Exception
OpcConnection.State getState()
OpcConnection.State
of the connection.@Nullable java.time.LocalDateTime getConnectionTimestamp()
OpcConnection.State.CONNECTED
, or null
if not
currently connected.@Nullable java.lang.Throwable getFault()
OpcConnection.State
is OpcConnection.State.FAULTED
then return a Throwable
containing the reason, otherwise,
return null
.Throwable
containing the reason for a connection fault, or null
if not faulted.default java.util.List<java.lang.String> getAliases()
This exists primarily to help backwards compatibility, where OPC servers were referred to by their "progids" rather than names.