Class Message
- All Implemented Interfaces:
Serializable
,Cloneable
An Amazon SQS message.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttributesEntry
(String key, String value) addMessageAttributesEntry
(String key, MessageAttributeValue value) Removes all the entries added into Attributes.Removes all the entries added into MessageAttributes.clone()
boolean
SenderId
,SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.getBody()
The message's contents (not URL-encoded).An MD5 digest of the non-URL-encoded message body string.An MD5 digest of the non-URL-encoded message attribute string.Each message attribute consists of a Name, Type, and Value.A unique identifier for the message.An identifier associated with the act of receiving the message.int
hashCode()
void
setAttributes
(Map<String, String> attributes) SenderId
,SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.void
The message's contents (not URL-encoded).void
setMD5OfBody
(String mD5OfBody) An MD5 digest of the non-URL-encoded message body string.void
setMD5OfMessageAttributes
(String mD5OfMessageAttributes) An MD5 digest of the non-URL-encoded message attribute string.void
setMessageAttributes
(Map<String, MessageAttributeValue> messageAttributes) Each message attribute consists of a Name, Type, and Value.void
setMessageId
(String messageId) A unique identifier for the message.void
setReceiptHandle
(String receiptHandle) An identifier associated with the act of receiving the message.toString()
Returns a string representation of this object; useful for testing and debugging.withAttributes
(Map<String, String> attributes) SenderId
,SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.The message's contents (not URL-encoded).withMD5OfBody
(String mD5OfBody) An MD5 digest of the non-URL-encoded message body string.withMD5OfMessageAttributes
(String mD5OfMessageAttributes) An MD5 digest of the non-URL-encoded message attribute string.withMessageAttributes
(Map<String, MessageAttributeValue> messageAttributes) Each message attribute consists of a Name, Type, and Value.withMessageId
(String messageId) A unique identifier for the message.withReceiptHandle
(String receiptHandle) An identifier associated with the act of receiving the message.
-
Constructor Details
-
Message
public Message()
-
-
Method Details
-
setMessageId
A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
- Parameters:
messageId
- A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
-
getMessageId
A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
- Returns:
- A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
-
withMessageId
A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
- Parameters:
messageId
- A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setReceiptHandle
An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
- Parameters:
receiptHandle
- An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
-
getReceiptHandle
An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
- Returns:
- An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
-
withReceiptHandle
An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.
- Parameters:
receiptHandle
- An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setMD5OfBody
An MD5 digest of the non-URL-encoded message body string.
- Parameters:
mD5OfBody
- An MD5 digest of the non-URL-encoded message body string.
-
getMD5OfBody
An MD5 digest of the non-URL-encoded message body string.
- Returns:
- An MD5 digest of the non-URL-encoded message body string.
-
withMD5OfBody
An MD5 digest of the non-URL-encoded message body string.
- Parameters:
mD5OfBody
- An MD5 digest of the non-URL-encoded message body string.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setBody
The message's contents (not URL-encoded).
- Parameters:
body
- The message's contents (not URL-encoded).
-
getBody
The message's contents (not URL-encoded).
- Returns:
- The message's contents (not URL-encoded).
-
withBody
The message's contents (not URL-encoded).
- Parameters:
body
- The message's contents (not URL-encoded).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getAttributes
SenderId
,SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.SentTimestamp
andApproximateFirstReceiveTimestamp
are each returned as an integer representing the epoch time in milliseconds.- Returns:
- SenderId,
SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.SentTimestamp
andApproximateFirstReceiveTimestamp
are each returned as an integer representing the epoch time
-
setAttributes
SenderId
,SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.SentTimestamp
andApproximateFirstReceiveTimestamp
are each returned as an integer representing the epoch time in milliseconds.- Parameters:
attributes
- SenderId,SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.SentTimestamp
andApproximateFirstReceiveTimestamp
are each returned as an integer representing the epoch time
-
withAttributes
SenderId
,SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.SentTimestamp
andApproximateFirstReceiveTimestamp
are each returned as an integer representing the epoch time in milliseconds.- Parameters:
attributes
- SenderId,SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.SentTimestamp
andApproximateFirstReceiveTimestamp
are each returned as an integer representing the epoch time- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
addAttributesEntry
-
clearAttributesEntries
Removes all the entries added into Attributes. <p> Returns a reference to this object so that method calls can be chained together. -
setMD5OfMessageAttributes
An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.
- Parameters:
mD5OfMessageAttributes
- An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.
-
getMD5OfMessageAttributes
An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.
- Returns:
- An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs /rfc1321.html.
-
withMD5OfMessageAttributes
An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.
- Parameters:
mD5OfMessageAttributes
- An MD5 digest of the non-URL-encoded message attribute string. This can be used to verify that Amazon SQS received the message correctly. Amazon SQS first URL decodes the message before creating the MD5 digest. For information about MD5, go to http://www.faqs.org/rfcs/rfc1321.html.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
getMessageAttributes
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
- Returns:
- Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
-
setMessageAttributes
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
- Parameters:
messageAttributes
- Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
-
withMessageAttributes
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
- Parameters:
messageAttributes
- Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
addMessageAttributesEntry
-
clearMessageAttributesEntries
Removes all the entries added into MessageAttributes. <p> Returns a reference to this object so that method calls can be chained together. -
toString
Returns a string representation of this object; useful for testing and debugging. -
equals
-
hashCode
public int hashCode() -
clone
-