Package com.plccom.mqtt.client
Class PlccomMqttEndpoint
- java.lang.Object
-
- com.plccom.mqtt.client.PlccomMqttEndpoint
-
public final class PlccomMqttEndpoint extends Object
MQTT endpoint address.The client supports
mqtt://,mqtts://,ws://andwss://endpoints.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetHost()Returns the broker host name.StringgetPath()Returns the optional path component.intgetPort()Returns the broker port.StringgetScheme()Returns the URI scheme.booleanisSecure()Returns whether this endpoint uses TLS.booleanisWebSocket()Returns whether this endpoint uses WebSocket transport.static PlccomMqttEndpointparse(String value)Parses an MQTT endpoint URI.StringtoString()Returns the endpoint as a normalized URI string.
-
-
-
Method Detail
-
parse
public static PlccomMqttEndpoint parse(String value)
Parses an MQTT endpoint URI.- Parameters:
value- endpoint URI, for examplemqtt://localhost:1883- Returns:
- parsed endpoint
- Throws:
NullPointerException- ifvalueisnullIllegalArgumentException- if the URI is malformed, unsupported or contains ignored components such as credentials, query or fragment
-
getScheme
public String getScheme()
Returns the URI scheme.- Returns:
mqtt,mqtts,wsorwss
-
getHost
public String getHost()
Returns the broker host name.- Returns:
- host name or IP address
-
getPort
public int getPort()
Returns the broker port.- Returns:
- resolved port, including default ports when omitted in the URI
-
getPath
public String getPath()
Returns the optional path component.- Returns:
- raw URI path, or an empty string
-
isSecure
public boolean isSecure()
Returns whether this endpoint uses TLS.- Returns:
trueformqtts://andwss://
-
isWebSocket
public boolean isWebSocket()
Returns whether this endpoint uses WebSocket transport.- Returns:
trueforws://andwss://
-
-