Class Message
- java.lang.Object
-
- com.amazonaws.services.sqs.model.Message
-
- All Implemented Interfaces:
Serializable,Cloneable
public class Message extends Object implements Serializable, Cloneable
An Amazon SQS message.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Message()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessageaddAttributesEntry(String key, String value)MessageaddMessageAttributesEntry(String key, MessageAttributeValue value)MessageclearAttributesEntries()Removes all the entries added into Attributes.MessageclearMessageAttributesEntries()Removes all the entries added into MessageAttributes.Messageclone()booleanequals(Object obj)Map<String,String>getAttributes()SenderId,SentTimestamp,ApproximateReceiveCount, and/orApproximateFirstReceiveTimestamp.StringgetBody()The message's contents (not URL-encoded).StringgetMD5OfBody()An MD5 digest of the non-URL-encoded message body string.StringgetMD5OfMessageAttributes()An MD5 digest of the non-URL-encoded message attribute string.Map<String,MessageAttributeValue>getMessageAttributes()Each message attribute consists of a Name, Type, and Value.StringgetMessageId()A unique identifier for the message.StringgetReceiptHandle()An identifier associated with the act of receiving the message.inthashCode()voidsetAttributes(Map<String,String> attributes)SenderId,SentTimestamp,ApproximateReceiveCount, and/orApproximateFirstReceiveTimestamp.voidsetBody(String body)The message's contents (not URL-encoded).voidsetMD5OfBody(String mD5OfBody)An MD5 digest of the non-URL-encoded message body string.voidsetMD5OfMessageAttributes(String mD5OfMessageAttributes)An MD5 digest of the non-URL-encoded message attribute string.voidsetMessageAttributes(Map<String,MessageAttributeValue> messageAttributes)Each message attribute consists of a Name, Type, and Value.voidsetMessageId(String messageId)A unique identifier for the message.voidsetReceiptHandle(String receiptHandle)An identifier associated with the act of receiving the message.StringtoString()Returns a string representation of this object; useful for testing and debugging.MessagewithAttributes(Map<String,String> attributes)SenderId,SentTimestamp,ApproximateReceiveCount, and/orApproximateFirstReceiveTimestamp.MessagewithBody(String body)The message's contents (not URL-encoded).MessagewithMD5OfBody(String mD5OfBody)An MD5 digest of the non-URL-encoded message body string.MessagewithMD5OfMessageAttributes(String mD5OfMessageAttributes)An MD5 digest of the non-URL-encoded message attribute string.MessagewithMessageAttributes(Map<String,MessageAttributeValue> messageAttributes)Each message attribute consists of a Name, Type, and Value.MessagewithMessageId(String messageId)A unique identifier for the message.MessagewithReceiptHandle(String receiptHandle)An identifier associated with the act of receiving the message.
-
-
-
Method Detail
-
setMessageId
public void setMessageId(String messageId)
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
public String 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
public Message withMessageId(String messageId)
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
public void setReceiptHandle(String 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.
- 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
public String 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
public Message withReceiptHandle(String 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.
- 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
public void setMD5OfBody(String mD5OfBody)
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
public 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
public Message withMD5OfBody(String mD5OfBody)
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
public void setBody(String body)
The message's contents (not URL-encoded).
- Parameters:
body- The message's contents (not URL-encoded).
-
getBody
public String getBody()
The message's contents (not URL-encoded).
- Returns:
- The message's contents (not URL-encoded).
-
withBody
public Message withBody(String body)
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
public Map<String,String> getAttributes()
SenderId,SentTimestamp,ApproximateReceiveCount, and/orApproximateFirstReceiveTimestamp.SentTimestampandApproximateFirstReceiveTimestampare each returned as an integer representing the epoch time in milliseconds.- Returns:
- SenderId,
SentTimestamp,ApproximateReceiveCount, and/orApproximateFirstReceiveTimestamp.SentTimestampandApproximateFirstReceiveTimestampare each returned as an integer representing the epoch time
-
setAttributes
public void setAttributes(Map<String,String> attributes)
SenderId,SentTimestamp,ApproximateReceiveCount, and/orApproximateFirstReceiveTimestamp.SentTimestampandApproximateFirstReceiveTimestampare each returned as an integer representing the epoch time in milliseconds.- Parameters:
attributes- SenderId,SentTimestamp,ApproximateReceiveCount, and/orApproximateFirstReceiveTimestamp.SentTimestampandApproximateFirstReceiveTimestampare each returned as an integer representing the epoch time
-
withAttributes
public Message withAttributes(Map<String,String> attributes)
SenderId,SentTimestamp,ApproximateReceiveCount, and/orApproximateFirstReceiveTimestamp.SentTimestampandApproximateFirstReceiveTimestampare each returned as an integer representing the epoch time in milliseconds.- Parameters:
attributes- SenderId,SentTimestamp,ApproximateReceiveCount, and/orApproximateFirstReceiveTimestamp.SentTimestampandApproximateFirstReceiveTimestampare each returned as an integer representing the epoch time- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
clearAttributesEntries
public Message clearAttributesEntries()
Removes all the entries added into Attributes. <p> Returns a reference to this object so that method calls can be chained together.
-
setMD5OfMessageAttributes
public void setMD5OfMessageAttributes(String 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.
- 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
public String 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
public Message withMD5OfMessageAttributes(String 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.
- 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
public Map<String,MessageAttributeValue> 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
public void setMessageAttributes(Map<String,MessageAttributeValue> messageAttributes)
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
public Message withMessageAttributes(Map<String,MessageAttributeValue> messageAttributes)
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
public Message addMessageAttributesEntry(String key, MessageAttributeValue value)
-
clearMessageAttributesEntries
public Message clearMessageAttributesEntries()
Removes all the entries added into MessageAttributes. <p> Returns a reference to this object so that method calls can be chained together.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-