com.prosysopc.ua
Class UaAddress
java.lang.Object
com.prosysopc.ua.UaAddress
public class UaAddress
- extends Object
OPC UA Connection address
UaAddress
public UaAddress(UaApplication.Protocol protocol,
String host,
int port)
throws URISyntaxException
- Throws:
URISyntaxException
UaAddress
public UaAddress(UaApplication.Protocol protocol,
String host,
int port,
String serverName)
throws URISyntaxException
- Throws:
URISyntaxException
UaAddress
public UaAddress(String uri)
throws URISyntaxException
- Create new UaAddress using the connection URI. Will parse the address from the provided string.
If the string is missing the scheme (protocol) part, it will default to 'opc.tcp'. If the port
number is missing, it will default to 4840 for 'opc.tcp' and 4843 for 'https'. 'http' protocol
is not accepted, since the UA Java Stack does not support the SOAP protocol.
- Parameters:
uri - The connection URI to be parsed.
- Throws:
IllegalArgumentException - if the 'http' protocol is defined
URISyntaxException - if the URI is not a valid URI
UaAddress
public UaAddress(URI uri)
throws Exception
- Throws:
Exception
UaAddress
public UaAddress(URL uri)
throws Exception
- Throws:
Exception
getDefaultProtocol
public static UaApplication.Protocol getDefaultProtocol()
setDefaultProtocol
public static void setDefaultProtocol(UaApplication.Protocol defaultProtocol)
validate
public static void validate(String uri)
throws URISyntaxException
- Validates that the URL is a valid OPC UA connection URI. Creates a new UaAddress with the URI
string, which parses the URI and initializes the address object.
- Parameters:
uri - the connection URI to validate
- Throws:
URISyntaxException - if the URI is not a valid URI
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
equalsAddress
public boolean equalsAddress(String uri)
getAddress
public String getAddress()
getHost
public String getHost()
- Returns:
- The IP address or hostname of the computer
getPort
public int getPort()
getProtocol
public UaApplication.Protocol getProtocol()
- Returns:
- The communication protocol
getServerName
public String getServerName()
- Returns:
- The server name part of the server URI
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2018. All rights reserved.