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 Message
addAttributesEntry(String key, String value)
Message
addMessageAttributesEntry(String key, MessageAttributeValue value)
Message
clearAttributesEntries()
Removes all the entries added into Attributes.Message
clearMessageAttributesEntries()
Removes all the entries added into MessageAttributes.Message
clone()
boolean
equals(Object obj)
Map<String,String>
getAttributes()
SenderId
,SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.String
getBody()
The message's contents (not URL-encoded).String
getMD5OfBody()
An MD5 digest of the non-URL-encoded message body string.String
getMD5OfMessageAttributes()
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.String
getMessageId()
A unique identifier for the message.String
getReceiptHandle()
An identifier associated with the act of receiving the message.int
hashCode()
void
setAttributes(Map<String,String> attributes)
SenderId
,SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.void
setBody(String body)
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.String
toString()
Returns a string representation of this object; useful for testing and debugging.Message
withAttributes(Map<String,String> attributes)
SenderId
,SentTimestamp
,ApproximateReceiveCount
, and/orApproximateFirstReceiveTimestamp
.Message
withBody(String body)
The message's contents (not URL-encoded).Message
withMD5OfBody(String mD5OfBody)
An MD5 digest of the non-URL-encoded message body string.Message
withMD5OfMessageAttributes(String mD5OfMessageAttributes)
An MD5 digest of the non-URL-encoded message attribute string.Message
withMessageAttributes(Map<String,MessageAttributeValue> messageAttributes)
Each message attribute consists of a Name, Type, and Value.Message
withMessageId(String messageId)
A unique identifier for the message.Message
withReceiptHandle(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
.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
public void setAttributes(Map<String,String> attributes)
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
public Message withAttributes(Map<String,String> attributes)
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.
-
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:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-