Interface OpcConnection
-
public interface OpcConnectionAnOpcConnectionis 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 classOpcConnection.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.LocalDateTimegetConnectionTimestamp()The timestamp when this connection made the transition toOpcConnection.State.CONNECTED, ornullif not currently connected.java.lang.ThrowablegetFault()If theOpcConnection.StateisOpcConnection.State.FAULTEDthen return aThrowablecontaining the reason, otherwise, returnnull.java.lang.StringgetName()The name of this OPC connection.OpcConnection.StategetState()java.lang.StringgetType()The type of this OPC connection.booleanisEnabled()Returnstrueif thisOpcConnectionis enabled.java.util.List<QualifiedValue>read(java.util.List<ServerNodeId> nodes)voidshutdown()voidstartup(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()
Returnstrueif thisOpcConnectionis enabled.- Returns:
- boolean
trueif thisOpcConnectionis 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.Stateof the connection.
-
getConnectionTimestamp
@Nullable java.time.LocalDateTime getConnectionTimestamp()
The timestamp when this connection made the transition toOpcConnection.State.CONNECTED, ornullif not currently connected.
-
getFault
@Nullable java.lang.Throwable getFault()
If theOpcConnection.StateisOpcConnection.State.FAULTEDthen return aThrowablecontaining the reason, otherwise, returnnull.- Returns:
- a
Throwablecontaining the reason for a connection fault, ornullif 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.
-
-