Class PlccomMqttClientOptions


  • public final class PlccomMqttClientOptions
    extends Object
    Immutable options for a PLCcom MQTT client connection.
    • Method Detail

      • getEndpoint

        public PlccomMqttEndpoint getEndpoint()
        Returns the broker endpoint.
        Returns:
        MQTT endpoint used for socket creation
      • getClientId

        public String getClientId()
        Returns the MQTT client identifier.
        Returns:
        non-empty client identifier
      • isCleanStart

        public boolean isCleanStart()
        Returns whether the client requests a clean MQTT session.
        Returns:
        true when the CONNECT packet should request a clean start
      • getSessionExpiryIntervalSeconds

        public Long getSessionExpiryIntervalSeconds()
        Returns the MQTT 5 session expiry interval.
        Returns:
        session expiry in seconds, or null to omit the property
      • getKeepAliveSeconds

        public int getKeepAliveSeconds()
        Returns the keep-alive interval sent in CONNECT.
        Returns:
        keep-alive interval in seconds
      • getLastWill

        public PlccomMqttLastWill getLastWill()
        Returns the optional MQTT Last Will configuration.
        Returns:
        Last Will configuration, or null when CONNECT should not declare a Will
      • getUsername

        public String getUsername()
        Returns the optional MQTT username.
        Returns:
        username, or null when no username should be sent
      • getPasswordBytes

        public byte[] getPasswordBytes()
        Returns a defensive copy of the optional MQTT password bytes.
        Returns:
        password bytes, or null when no password should be sent
      • getEnhancedAuthenticationMethod

        public String getEnhancedAuthenticationMethod()
        Returns the MQTT 5 enhanced Authentication Method sent in CONNECT.
        Returns:
        authentication method, or null when enhanced authentication is disabled
      • getEnhancedAuthenticationData

        public byte[] getEnhancedAuthenticationData()
        Returns a defensive copy of the initial MQTT 5 enhanced Authentication Data sent in CONNECT.
        Returns:
        initial authentication data, or null when none is sent
      • getEnhancedAuthenticator

        public PlccomMqttClientEnhancedAuthenticator getEnhancedAuthenticator()
        Returns the optional client-side enhanced authentication handler.
        Returns:
        enhanced authenticator, or null when the client will not answer broker AUTH challenges
      • hasEnhancedAuthentication

        public boolean hasEnhancedAuthentication()
        Returns whether MQTT 5 enhanced authentication is configured.
        Returns:
        true when a method, initial data or handler is configured
      • getTopicAliasMaximum

        public int getTopicAliasMaximum()
        Returns the MQTT 5 Topic Alias Maximum advertised by this client.

        A value of 0 means the client does not accept inbound Topic Aliases from the broker and omits the CONNECT property. A positive value allows the broker to use aliases from 1 through this maximum on this connection.

        Returns:
        configured MQTT 5 Topic Alias Maximum in the range 0..65535
      • getTlsOptions

        public PlccomMqttTlsOptions getTlsOptions()
        Returns the TLS options.
        Returns:
        TLS options, never null
      • getLimits

        public PlccomMqttLimits getLimits()
        Returns the configured safety limits.
        Returns:
        packet, topic and queue limits
      • getConnectTimeoutMillis

        public long getConnectTimeoutMillis()
        Returns the socket connect timeout.
        Returns:
        connect timeout in milliseconds
      • getOperationTimeoutMillis

        public long getOperationTimeoutMillis()
        Returns the timeout for blocking MQTT operations.
        Returns:
        operation timeout in milliseconds
      • getSocketReadTimeoutMillis

        public int getSocketReadTimeoutMillis()
        Returns the socket read timeout used by the reader loop.
        Returns:
        read timeout in milliseconds
      • getLocalAddress

        public InetAddress getLocalAddress()
        Returns the optional local address for the outgoing MQTT socket.
        Returns:
        local bind address, or null when the operating system selects the outgoing interface
      • isAutomaticReconnect

        public boolean isAutomaticReconnect()
        Returns whether failed operations may trigger automatic reconnect.
        Returns:
        true when reconnect support is enabled
      • getReconnectInitialDelayMillis

        public long getReconnectInitialDelayMillis()
        Returns the initial reconnect delay.
        Returns:
        initial delay in milliseconds
      • getReconnectMaxDelayMillis

        public long getReconnectMaxDelayMillis()
        Returns the maximum reconnect delay.
        Returns:
        maximum delay in milliseconds
      • getDiagnosticListener

        public PlccomMqttDiagnosticListener getDiagnosticListener()
        Returns the optional diagnostic listener.
        Returns:
        diagnostic listener, or null when diagnostic events should be ignored
      • getDiagnosticLevel

        public PlccomMqttDiagnosticLevel getDiagnosticLevel()
        Returns the minimum diagnostic level delivered to the configured listener.
        Returns:
        configured diagnostic level, never null