Package software.amazon.awssdk.iot
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>
Builder type for V2ClientStreamOptions instances
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a new V2ClientStreamOptions instance from the existing configuration.withDeserializationFailureHandler(Consumer<V2DeserializationFailureEvent> deserializationFailureHandler) Sets the callback the stream should invoke when a message fails to deserializewithStreamEventHandler(Consumer<T> streamEventHandler) Sets the callback the stream should invoke on a successfully deserialized messagewithSubscriptionEventHandler(Consumer<software.amazon.awssdk.crt.iot.SubscriptionStatusEvent> subscriptionEventHandler) Sets the callback the stream should invoke when something changes about the underlying subscription
-
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
Creates a new V2ClientStreamOptions instance from the existing configuration.- Returns:
- a new V2ClientStreamOptions instance
-