public class Message extends Object implements Serializable, Cloneable
An Amazon SQS message.
Constructor and Description |
---|
Message()
Default constructor for a new Message object.
|
Modifier and Type | Method and Description |
---|---|
Message |
addAttributesEntry(String key,
String value)
SenderId , SentTimestamp ,
ApproximateReceiveCount , and/or
ApproximateFirstReceiveTimestamp . |
Message |
addMessageAttributesEntry(String key,
MessageAttributeValue value)
Each message attribute consists of a Name, Type, and 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/or
ApproximateFirstReceiveTimestamp . |
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/or
ApproximateFirstReceiveTimestamp . |
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/or
ApproximateFirstReceiveTimestamp . |
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.
|
public Message()
public String getMessageId()
public void setMessageId(String messageId)
messageId
- A unique identifier for the message. Message IDs are considered unique
across all AWS accounts for an extended period of time.public Message withMessageId(String messageId)
Returns a reference to this object so that method calls can be chained together.
messageId
- A unique identifier for the message. Message IDs are considered unique
across all AWS accounts for an extended period of time.public String getReceiptHandle()
public void setReceiptHandle(String receiptHandle)
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.public Message withReceiptHandle(String receiptHandle)
Returns a reference to this object so that method calls can be chained together.
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.public String getMD5OfBody()
public void setMD5OfBody(String mD5OfBody)
mD5OfBody
- An MD5 digest of the non-URL-encoded message body string.public Message withMD5OfBody(String mD5OfBody)
Returns a reference to this object so that method calls can be chained together.
mD5OfBody
- An MD5 digest of the non-URL-encoded message body string.public String getBody()
public void setBody(String body)
body
- The message's contents (not URL-encoded).public Message withBody(String body)
Returns a reference to this object so that method calls can be chained together.
body
- The message's contents (not URL-encoded).public Map<String,String> getAttributes()
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.public void setAttributes(Map<String,String> attributes)
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.attributes
- SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.public Message withAttributes(Map<String,String> attributes)
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.
Returns a reference to this object so that method calls can be chained together.
attributes
- SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.public Message addAttributesEntry(String key, String value)
SenderId
, SentTimestamp
,
ApproximateReceiveCount
, and/or
ApproximateFirstReceiveTimestamp
.
SentTimestamp
and
ApproximateFirstReceiveTimestamp
are each returned as an
integer representing the epoch time in
milliseconds.
The method adds a new key-value pair into Attributes parameter, and returns a reference to this object so that method calls can be chained together.
key
- The key of the entry to be added into Attributes.value
- The corresponding value of the entry to be added into Attributes.public Message clearAttributesEntries()
Returns a reference to this object so that method calls can be chained together.
public String getMD5OfMessageAttributes()
public void setMD5OfMessageAttributes(String mD5OfMessageAttributes)
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.public Message withMD5OfMessageAttributes(String mD5OfMessageAttributes)
Returns a reference to this object so that method calls can be chained together.
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.public Map<String,MessageAttributeValue> getMessageAttributes()
public void setMessageAttributes(Map<String,MessageAttributeValue> messageAttributes)
messageAttributes
- Each message attribute consists of a Name, Type, and Value. For more
information, see Message
Attribute Items.public Message withMessageAttributes(Map<String,MessageAttributeValue> messageAttributes)
Returns a reference to this object so that method calls can be chained together.
messageAttributes
- Each message attribute consists of a Name, Type, and Value. For more
information, see Message
Attribute Items.public Message addMessageAttributesEntry(String key, MessageAttributeValue value)
The method adds a new key-value pair into MessageAttributes parameter, and returns a reference to this object so that method calls can be chained together.
key
- The key of the entry to be added into MessageAttributes.value
- The corresponding value of the entry to be added into MessageAttributes.public Message clearMessageAttributesEntries()
Returns a reference to this object so that method calls can be chained together.
public String toString()
toString
in class Object
Object.toString()
Copyright © 2015. All rights reserved.