/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.iot.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Specifies MQTT Version 5.0 headers information. For more information, see MQTT from Amazon Web Services IoT Core * Developer Guide. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class MqttHeaders implements Serializable, Cloneable, StructuredPojo { /** *
* An Enum
string value that indicates whether the payload is formatted as UTF-8.
*
* Valid values are UNSPECIFIED_BYTES
and UTF8_DATA
.
*
* For more information, see * Payload Format Indicator from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
*/ private String payloadFormatIndicator; /** ** A UTF-8 encoded string that describes the content of the publishing message. *
** For more information, see * Content Type from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
*/ private String contentType; /** ** A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to * describe the topic which the receiver should publish to as part of the request-response flow. The topic must not * contain wildcard characters. *
** For more information, see * Response Topic from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
*/ private String responseTopic; /** ** The base64-encoded binary data used by the sender of the request message to identify which request the response * message is for when it's received. *
** For more information, see * Correlation Data from the MQTT Version 5.0 specification. *
** This binary data must be based64-encoded. *
** Supports substitution * templates. *
*/ private String correlationData; /** *
* A user-defined integer value that will persist a message at the message broker for a specified amount of time to
* ensure that the message will expire if it's no longer relevant to the subscriber. The value of
* messageExpiry
represents the number of seconds before it expires. For more information about the
* limits of messageExpiry
, see Amazon Web Services IoT Core message
* broker and protocol limits and quotas from the Amazon Web Services Reference Guide.
*
* Supports substitution * templates. *
*/ private String messageExpiry; /** ** An array of key-value pairs that you define in the MQTT5 header. *
*/ private java.util.List
* An Enum
string value that indicates whether the payload is formatted as UTF-8.
*
* Valid values are UNSPECIFIED_BYTES
and UTF8_DATA
.
*
* For more information, see * Payload Format Indicator from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
* * @param payloadFormatIndicator * AnEnum
string value that indicates whether the payload is formatted as UTF-8.
*
* Valid values are UNSPECIFIED_BYTES
and UTF8_DATA
.
*
* For more information, see Payload Format * Indicator from the MQTT Version 5.0 specification. *
** Supports * substitution templates. */ public void setPayloadFormatIndicator(String payloadFormatIndicator) { this.payloadFormatIndicator = payloadFormatIndicator; } /** *
* An Enum
string value that indicates whether the payload is formatted as UTF-8.
*
* Valid values are UNSPECIFIED_BYTES
and UTF8_DATA
.
*
* For more information, see * Payload Format Indicator from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
* * @return AnEnum
string value that indicates whether the payload is formatted as UTF-8.
*
* Valid values are UNSPECIFIED_BYTES
and UTF8_DATA
.
*
* For more information, see Payload Format * Indicator from the MQTT Version 5.0 specification. *
** Supports * substitution templates. */ public String getPayloadFormatIndicator() { return this.payloadFormatIndicator; } /** *
* An Enum
string value that indicates whether the payload is formatted as UTF-8.
*
* Valid values are UNSPECIFIED_BYTES
and UTF8_DATA
.
*
* For more information, see * Payload Format Indicator from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
* * @param payloadFormatIndicator * AnEnum
string value that indicates whether the payload is formatted as UTF-8.
*
* Valid values are UNSPECIFIED_BYTES
and UTF8_DATA
.
*
* For more information, see Payload Format * Indicator from the MQTT Version 5.0 specification. *
** Supports * substitution templates. * @return Returns a reference to this object so that method calls can be chained together. */ public MqttHeaders withPayloadFormatIndicator(String payloadFormatIndicator) { setPayloadFormatIndicator(payloadFormatIndicator); return this; } /** *
* A UTF-8 encoded string that describes the content of the publishing message. *
** For more information, see * Content Type from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
* * @param contentType * A UTF-8 encoded string that describes the content of the publishing message. ** For more information, see Content Type from * the MQTT Version 5.0 specification. *
** Supports * substitution templates. */ public void setContentType(String contentType) { this.contentType = contentType; } /** *
* A UTF-8 encoded string that describes the content of the publishing message. *
** For more information, see * Content Type from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
* * @return A UTF-8 encoded string that describes the content of the publishing message. ** For more information, see Content Type from * the MQTT Version 5.0 specification. *
** Supports * substitution templates. */ public String getContentType() { return this.contentType; } /** *
* A UTF-8 encoded string that describes the content of the publishing message. *
** For more information, see * Content Type from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
* * @param contentType * A UTF-8 encoded string that describes the content of the publishing message. ** For more information, see Content Type from * the MQTT Version 5.0 specification. *
** Supports * substitution templates. * @return Returns a reference to this object so that method calls can be chained together. */ public MqttHeaders withContentType(String contentType) { setContentType(contentType); return this; } /** *
* A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to * describe the topic which the receiver should publish to as part of the request-response flow. The topic must not * contain wildcard characters. *
** For more information, see * Response Topic from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
* * @param responseTopic * A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to * describe the topic which the receiver should publish to as part of the request-response flow. The topic * must not contain wildcard characters. ** For more information, see Response Topic * from the MQTT Version 5.0 specification. *
** Supports * substitution templates. */ public void setResponseTopic(String responseTopic) { this.responseTopic = responseTopic; } /** *
* A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to * describe the topic which the receiver should publish to as part of the request-response flow. The topic must not * contain wildcard characters. *
** For more information, see * Response Topic from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
* * @return A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used * to describe the topic which the receiver should publish to as part of the request-response flow. The * topic must not contain wildcard characters. ** For more information, see Response Topic * from the MQTT Version 5.0 specification. *
** Supports * substitution templates. */ public String getResponseTopic() { return this.responseTopic; } /** *
* A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to * describe the topic which the receiver should publish to as part of the request-response flow. The topic must not * contain wildcard characters. *
** For more information, see * Response Topic from the MQTT Version 5.0 specification. *
** Supports substitution * templates. *
* * @param responseTopic * A UTF-8 encoded string that's used as the topic name for a response message. The response topic is used to * describe the topic which the receiver should publish to as part of the request-response flow. The topic * must not contain wildcard characters. ** For more information, see Response Topic * from the MQTT Version 5.0 specification. *
** Supports * substitution templates. * @return Returns a reference to this object so that method calls can be chained together. */ public MqttHeaders withResponseTopic(String responseTopic) { setResponseTopic(responseTopic); return this; } /** *
* The base64-encoded binary data used by the sender of the request message to identify which request the response * message is for when it's received. *
** For more information, see * Correlation Data from the MQTT Version 5.0 specification. *
** This binary data must be based64-encoded. *
** Supports substitution * templates. *
* * @param correlationData * The base64-encoded binary data used by the sender of the request message to identify which request the * response message is for when it's received. ** For more information, see Correlation Data * from the MQTT Version 5.0 specification. *
** This binary data must be based64-encoded. *
** Supports * substitution templates. */ public void setCorrelationData(String correlationData) { this.correlationData = correlationData; } /** *
* The base64-encoded binary data used by the sender of the request message to identify which request the response * message is for when it's received. *
** For more information, see * Correlation Data from the MQTT Version 5.0 specification. *
** This binary data must be based64-encoded. *
** Supports substitution * templates. *
* * @return The base64-encoded binary data used by the sender of the request message to identify which request the * response message is for when it's received. ** For more information, see Correlation Data * from the MQTT Version 5.0 specification. *
** This binary data must be based64-encoded. *
** Supports * substitution templates. */ public String getCorrelationData() { return this.correlationData; } /** *
* The base64-encoded binary data used by the sender of the request message to identify which request the response * message is for when it's received. *
** For more information, see * Correlation Data from the MQTT Version 5.0 specification. *
** This binary data must be based64-encoded. *
** Supports substitution * templates. *
* * @param correlationData * The base64-encoded binary data used by the sender of the request message to identify which request the * response message is for when it's received. ** For more information, see Correlation Data * from the MQTT Version 5.0 specification. *
** This binary data must be based64-encoded. *
** Supports * substitution templates. * @return Returns a reference to this object so that method calls can be chained together. */ public MqttHeaders withCorrelationData(String correlationData) { setCorrelationData(correlationData); return this; } /** *
* A user-defined integer value that will persist a message at the message broker for a specified amount of time to
* ensure that the message will expire if it's no longer relevant to the subscriber. The value of
* messageExpiry
represents the number of seconds before it expires. For more information about the
* limits of messageExpiry
, see Amazon Web Services IoT Core message
* broker and protocol limits and quotas from the Amazon Web Services Reference Guide.
*
* Supports substitution * templates. *
* * @param messageExpiry * A user-defined integer value that will persist a message at the message broker for a specified amount of * time to ensure that the message will expire if it's no longer relevant to the subscriber. The value of *messageExpiry
represents the number of seconds before it expires. For more information about
* the limits of messageExpiry
, see Amazon Web Services IoT Core
* message broker and protocol limits and quotas from the Amazon Web Services Reference Guide.
* * Supports * substitution templates. */ public void setMessageExpiry(String messageExpiry) { this.messageExpiry = messageExpiry; } /** *
* A user-defined integer value that will persist a message at the message broker for a specified amount of time to
* ensure that the message will expire if it's no longer relevant to the subscriber. The value of
* messageExpiry
represents the number of seconds before it expires. For more information about the
* limits of messageExpiry
, see Amazon Web Services IoT Core message
* broker and protocol limits and quotas from the Amazon Web Services Reference Guide.
*
* Supports substitution * templates. *
* * @return A user-defined integer value that will persist a message at the message broker for a specified amount of * time to ensure that the message will expire if it's no longer relevant to the subscriber. The value of *messageExpiry
represents the number of seconds before it expires. For more information about
* the limits of messageExpiry
, see Amazon Web Services IoT Core
* message broker and protocol limits and quotas from the Amazon Web Services Reference Guide.
* * Supports * substitution templates. */ public String getMessageExpiry() { return this.messageExpiry; } /** *
* A user-defined integer value that will persist a message at the message broker for a specified amount of time to
* ensure that the message will expire if it's no longer relevant to the subscriber. The value of
* messageExpiry
represents the number of seconds before it expires. For more information about the
* limits of messageExpiry
, see Amazon Web Services IoT Core message
* broker and protocol limits and quotas from the Amazon Web Services Reference Guide.
*
* Supports substitution * templates. *
* * @param messageExpiry * A user-defined integer value that will persist a message at the message broker for a specified amount of * time to ensure that the message will expire if it's no longer relevant to the subscriber. The value of *messageExpiry
represents the number of seconds before it expires. For more information about
* the limits of messageExpiry
, see Amazon Web Services IoT Core
* message broker and protocol limits and quotas from the Amazon Web Services Reference Guide.
* * Supports * substitution templates. * @return Returns a reference to this object so that method calls can be chained together. */ public MqttHeaders withMessageExpiry(String messageExpiry) { setMessageExpiry(messageExpiry); return this; } /** *
* An array of key-value pairs that you define in the MQTT5 header. *
* * @return An array of key-value pairs that you define in the MQTT5 header. */ public java.util.List* An array of key-value pairs that you define in the MQTT5 header. *
* * @param userProperties * An array of key-value pairs that you define in the MQTT5 header. */ public void setUserProperties(java.util.Collection* An array of key-value pairs that you define in the MQTT5 header. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setUserProperties(java.util.Collection)} or {@link #withUserProperties(java.util.Collection)} if you want * to override the existing values. *
* * @param userProperties * An array of key-value pairs that you define in the MQTT5 header. * @return Returns a reference to this object so that method calls can be chained together. */ public MqttHeaders withUserProperties(UserProperty... userProperties) { if (this.userProperties == null) { setUserProperties(new java.util.ArrayList* An array of key-value pairs that you define in the MQTT5 header. *
* * @param userProperties * An array of key-value pairs that you define in the MQTT5 header. * @return Returns a reference to this object so that method calls can be chained together. */ public MqttHeaders withUserProperties(java.util.Collection