Interface OpcConnection
-
public interface OpcConnection
AnOpcConnection
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
OpcConnection.State
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method 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 toOpcConnection.State.CONNECTED
, ornull
if not currently connected.java.lang.Throwable
getFault()
If theOpcConnection.State
isOpcConnection.State.FAULTED
then return aThrowable
containing the reason, otherwise, returnnull
.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()
Returnstrue
if thisOpcConnection
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)
-
-
-
Method Detail
-
getName
java.lang.String getName()
The name of this OPC connection. Must match the name of the OPCServerProfileRecord that created it.
-
getType
java.lang.String getType()
The type of this OPC connection. Must match the type of the OPCServerProfileRecord that created it.
-
isEnabled
boolean isEnabled()
Returnstrue
if thisOpcConnection
is enabled.- Returns:
- boolean
true
if thisOpcConnection
is enabled.
-
startup
void startup(OpcSubscriptionModel model)
-
shutdown
void shutdown()
-
read
java.util.List<QualifiedValue> read(java.util.List<ServerNodeId> nodes)
-
write
java.util.List<QualityCode> write(java.util.List<OPCWriteRequest> writes)
-
browse
java.util.List<OPCBrowseElement> browse(ServerNodeId node) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getState
OpcConnection.State getState()
- Returns:
- the current
OpcConnection.State
of the connection.
-
getConnectionTimestamp
@Nullable java.time.LocalDateTime getConnectionTimestamp()
The timestamp when this connection made the transition toOpcConnection.State.CONNECTED
, ornull
if not currently connected.
-
getFault
@Nullable java.lang.Throwable getFault()
If theOpcConnection.State
isOpcConnection.State.FAULTED
then return aThrowable
containing the reason, otherwise, returnnull
.- Returns:
- a
Throwable
containing the reason for a connection fault, ornull
if not faulted.
-
getAliases
default java.util.List<java.lang.String> getAliases()
Returns the "aliases", or alternative names, for a server.This exists primarily to help backwards compatibility, where OPC servers were referred to by their "progids" rather than names.
-
-