Class IotConfig


public class IotConfig extends AbstractServiceConfig<IotConfig.Builder>
Configuration for IoT Core-specific container settings, including the embedded MQTT broker.

Instances are created via IotConfig.Builder:


 IotConfig config = IotConfig.builder()
     .mqttAutoStart(true)
     .mqttPort(1883)
     .build();
 
  • Method Details

    • builder

      public static IotConfig.Builder builder()
      Returns a new IotConfig.Builder for this configuration.
      Returns:
      a new builder
    • toBuilder

      public IotConfig.Builder toBuilder()
      Returns a new IotConfig.Builder for this configuration, initialized with the current values of this instance.
      Specified by:
      toBuilder in class AbstractServiceConfig<IotConfig.Builder>
      Returns:
      a new builder pre-populated with this configuration's values
    • isMqttEnabled

      public boolean isMqttEnabled()
      Returns whether the embedded MQTT broker is enabled.
      Returns:
      true if the MQTT broker is enabled
    • isMqttAutoStart

      public boolean isMqttAutoStart()
      Returns whether the embedded MQTT broker starts automatically on container startup rather than lazily on the first MQTT connection.
      Returns:
      true if the MQTT broker auto-starts
    • getMqttHost

      public String getMqttHost()
      Returns the bind address for the embedded MQTT broker.
      Returns:
      the MQTT broker host
    • getMqttPort

      public int getMqttPort()
      Returns the port used by the embedded MQTT broker.
      Returns:
      the MQTT broker port
    • applyEnvVarsToContainer

      public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container)
      Description copied from class: AbstractServiceConfig
      Applies this service configuration to the given container by setting the appropriate environment variables.
      Overrides:
      applyEnvVarsToContainer in class AbstractServiceConfig<IotConfig.Builder>
      Parameters:
      container - the container to configure
    • applyExposedPortsToContainer

      public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container)
      Description copied from class: AbstractServiceConfig
      Applies this service configuration to the given container by exposing the appropriate ports.
      Overrides:
      applyExposedPortsToContainer in class AbstractServiceConfig<IotConfig.Builder>
      Parameters:
      container - the container to configure