Class V2ClientStreamOptions.V2ClientStreamOptionsBuilder<T>

java.lang.Object
software.amazon.awssdk.iot.V2ClientStreamOptions.V2ClientStreamOptionsBuilder<T>
Type Parameters:
T - Type that the stream deserializes MQTT messages into
Enclosing class:
V2ClientStreamOptions<T>

public static class V2ClientStreamOptions.V2ClientStreamOptionsBuilder<T> extends Object
Builder type for V2ClientStreamOptions instances
  • Method Details

    • withStreamEventHandler

      public V2ClientStreamOptions.V2ClientStreamOptionsBuilder<T> withStreamEventHandler(Consumer<T> streamEventHandler)
      Sets the callback the stream should invoke on a successfully deserialized message
      Parameters:
      streamEventHandler - the callback the stream should invoke on a successfully deserialized message
      Returns:
      this builder object
    • withDeserializationFailureHandler

      public V2ClientStreamOptions.V2ClientStreamOptionsBuilder<T> withDeserializationFailureHandler(Consumer<V2DeserializationFailureEvent> deserializationFailureHandler)
      Sets the callback the stream should invoke when a message fails to deserialize
      Parameters:
      deserializationFailureHandler - the callback the stream should invoke when a message fails to deserialize
      Returns:
      this builder object
    • withSubscriptionEventHandler

      public V2ClientStreamOptions.V2ClientStreamOptionsBuilder<T> withSubscriptionEventHandler(Consumer<software.amazon.awssdk.crt.iot.SubscriptionStatusEvent> subscriptionEventHandler)
      Sets the callback the stream should invoke when something changes about the underlying subscription
      Parameters:
      subscriptionEventHandler - the callback the stream should invoke when something changes about the underlying subscription
      Returns:
      this builder object
    • build

      public V2ClientStreamOptions<T> build()
      Creates a new V2ClientStreamOptions instance from the existing configuration.
      Returns:
      a new V2ClientStreamOptions instance