public class UaAddress extends Object
| Constructor and Description |
|---|
UaAddress(String uri)
Deprecated.
use
parse(String) instead. |
UaAddress(UaApplication.Protocol protocol,
String host,
int port)
Deprecated.
use
UaAddress#fromComponents(Protocol, String, int) instead. |
UaAddress(UaApplication.Protocol protocol,
String host,
int port,
String serverName)
Deprecated.
use
UaAddress#fromComponents(Protocol, String, int, String) instead. |
UaAddress(URI uri)
Deprecated.
use
parse(URI) instead. |
UaAddress(URL uri)
Deprecated.
use
parse(URL) instead. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
boolean |
equalsAddress(String uri) |
static String |
formatUri(UaApplication.Protocol protocol,
String host,
int port,
String serverName)
Compose a valid OPCUA connection address from the parts.
|
static UaAddress |
fromComponents(UaApplication.Protocol protocol,
String host,
int port)
Creates UaAddress with the given components.
|
static UaAddress |
fromComponents(UaApplication.Protocol protocol,
String host,
int port,
String serverName)
Creates a new UaAddress with the given components.
|
String |
getAddress() |
static UaApplication.Protocol |
getDefaultProtocol() |
String |
getHost() |
int |
getPort() |
UaApplication.Protocol |
getProtocol() |
String |
getServerName() |
int |
hashCode() |
static UaAddress |
parse(String address)
Create a new UaAddress from a string representation.
|
static UaAddress |
parse(URI uri)
Create a new UaAddress from an URI.
|
static UaAddress |
parse(URL url)
Create a new UaAddress from an URI.
|
static void |
setDefaultProtocol(UaApplication.Protocol defaultProtocol) |
String |
toString() |
static void |
validate(String address)
Validates that a string value is a valid OPC UA connection URI.
|
static UaAddress |
wildcardOpcTcp(int port)
Returns a wildcard address for the given port using opc.tcp protocol.
|
static UaAddress |
wildcardOpcTcpIPv4(int port)
Convenience factory method for creating an address opc.tcp://0.0.0.0:port where the port is the
given port.
|
static UaAddress |
wildcardOpcTcpIPv6(int port)
Convenience factory method for creating an address opc.tcp://[::]:port where the port is the
given port.
|
@Deprecated public UaAddress(UaApplication.Protocol protocol, String host, int port) throws URISyntaxException
UaAddress#fromComponents(Protocol, String, int) instead.URISyntaxException@Deprecated public UaAddress(UaApplication.Protocol protocol, String host, int port, String serverName) throws URISyntaxException
UaAddress#fromComponents(Protocol, String, int, String) instead.URISyntaxException@Deprecated public UaAddress(String uri) throws URISyntaxException
parse(String) instead.uri - The connection URI to be parsed.IllegalArgumentException - if the 'http' protocol is definedURISyntaxException - if the URI is not a valid URI@Deprecated public UaAddress(URI uri) throws Exception
parse(URI) instead.Exception@Deprecated public UaAddress(URL uri) throws Exception
parse(URL) instead.Exceptionpublic static String formatUri(UaApplication.Protocol protocol, String host, int port, String serverName)
<protocol>://<host>:<port>/<serverName>, where the last slash ('/') is removed, if
serverName is null or empty.protocol - The OPC UA transport protocol.host - Host name or IP address of the computer.port - The TCP port number to connect to.serverName - An optional server name identifier.<protocol>://<host>:<port>/<serverName>public static UaAddress fromComponents(UaApplication.Protocol protocol, String host, int port)
#formatUri(Protocol, String, int, String) where ServerName (the last String) is null.public static UaAddress fromComponents(UaApplication.Protocol protocol, String host, int port, String serverName)
#formatUri(Protocol, String, int, String)public static UaApplication.Protocol getDefaultProtocol()
public static UaAddress parse(String address)
address - The connection address. The address is expected to be in the format defined by
#formatUri(Protocol, String, int, String) format
<protocol>://<host>:<port>/<serverName>, where the last slash may be omitted, if
serverName is empty.
If <protocol>:// is missing, 'opc.tcp://' is used. If port number is missing,
4840 will be used for 'opc.tcp' and 4843 for 'opc.https'. 'http' is not accepted as a
protocol, since it is a deprecated protocol and not supported.IllegalArgumentException - if address is not a valid OPC UA connection address.public static UaAddress parse(URI uri)
parse(uri.toString()). See
parse(String) for details.IllegalArgumentException - if address is not a valid OPC UA connection address.public static UaAddress parse(URL url)
parse(uri.toString()). See
parse(String) for details.IllegalArgumentException - if address is not a valid OPC UA connection address.public static void setDefaultProtocol(UaApplication.Protocol defaultProtocol)
public static void validate(String address) throws URISyntaxException
parse(String), but raises URISyntaxException for invalid addresses.address - the connection address to validateURISyntaxException - if the address is not a valid UaAddresspublic static UaAddress wildcardOpcTcp(int port)
wildcardOpcTcpIPv6(int), otherwise returns
wildcardOpcTcpIPv4(int).public static UaAddress wildcardOpcTcpIPv4(int port)
public static UaAddress wildcardOpcTcpIPv6(int port)
wildcardOpcTcpIPv4(int), this method will also bound on IPv6
address this machine has.public boolean equalsAddress(String uri)
public String getAddress()
public String getHost()
public int getPort()
public UaApplication.Protocol getProtocol()
public String getServerName()
Copyright © 2026. All rights reserved.