/* * Copyright 2010-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; /** *
* Specifies MQTT Version 5.0 headers information. For more information, see * MQTT from Amazon Web Services IoT Core Developer Guide. *
*/ public class MqttHeaders implements Serializable { /** *
* 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. *
*
* Constraints:
* Length: 0 - 1024
*/
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. *
*
* Constraints:
* Length: 0 - 1024
*/
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. *
*
* Constraints:
* Length: 0 - 1024
*/
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. *
*
* Constraints:
* Length: 0 - 1024
*/
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. *
*
* Constraints:
* Length: 0 - 1024
*/
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. *
*
* Constraints:
* Length: 0 - 1024
*
* @return
* 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. *
*/ public String getPayloadFormatIndicator() { return 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. *
*
* Constraints:
* Length: 0 - 1024
*
* @param 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. *
*/ 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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0 - 1024
*
* @param 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 A reference to this updated object so that method calls can be * chained together. */ public MqttHeaders withPayloadFormatIndicator(String payloadFormatIndicator) { this.payloadFormatIndicator = 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. *
*
* Constraints:
* Length: 0 - 1024
*
* @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 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. *
*
* Constraints:
* Length: 0 - 1024
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0 - 1024
*
* @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 A reference to this updated object so that method calls can be * chained together. */ public MqttHeaders withContentType(String contentType) { this.contentType = 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. *
*
* Constraints:
* Length: 0 - 1024
*
* @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 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. *
*
* Constraints:
* Length: 0 - 1024
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0 - 1024
*
* @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 A reference to this updated object so that method calls can be * chained together. */ public MqttHeaders withResponseTopic(String responseTopic) { this.responseTopic = 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. *
*
* Constraints:
* Length: 0 - 1024
*
* @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 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. *
*
* Constraints:
* Length: 0 - 1024
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0 - 1024
*
* @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 A reference to this updated object so that method calls can be * chained together. */ public MqttHeaders withCorrelationData(String correlationData) { this.correlationData = 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. *
*
* Constraints:
* Length: 0 - 1024
*
* @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 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. *
*
* Constraints:
* Length: 0 - 1024
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 0 - 1024
*
* @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 A reference to this updated object so that method calls can be * chained together. */ public MqttHeaders withMessageExpiry(String messageExpiry) { this.messageExpiry = 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param userProperties
* An array of key-value pairs that you define in the MQTT5 * header. *
* @return A reference to this updated object so that method calls can be * chained together. */ public MqttHeaders withUserProperties(UserProperty... userProperties) { if (getUserProperties() == null) { this.userProperties = new java.util.ArrayList* An array of key-value pairs that you define in the MQTT5 header. *
** Returns a reference to this object so that method calls can be chained * together. * * @param userProperties
* An array of key-value pairs that you define in the MQTT5 * header. *
* @return A reference to this updated object so that method calls can be * chained together. */ public MqttHeaders withUserProperties(java.util.Collection