com.amazonaws.services.sqs.model
Class Message

java.lang.Object
  extended by com.amazonaws.services.sqs.model.Message
All Implemented Interfaces:
java.io.Serializable

public class Message
extends java.lang.Object
implements java.io.Serializable

An Amazon SQS message.

See Also:
Serialized Form

Constructor Summary
Message()
          Default constructor for a new Message object.
 
Method Summary
 Message addAttributesEntry(java.lang.String key, java.lang.String value)
          SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp.
 Message addMessageAttributesEntry(java.lang.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.
 boolean equals(java.lang.Object obj)
           
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp.
 java.lang.String getBody()
          The message's contents (not URL-encoded).
 java.lang.String getMD5OfBody()
          An MD5 digest of the non-URL-encoded message body string.
 java.lang.String getMD5OfMessageAttributes()
          An MD5 digest of the non-URL-encoded message attribute string.
 java.util.Map<java.lang.String,MessageAttributeValue> getMessageAttributes()
          Each message attribute consists of a Name, Type, and Value.
 java.lang.String getMessageId()
          A unique identifier for the message.
 java.lang.String getReceiptHandle()
          An identifier associated with the act of receiving the message.
 int hashCode()
           
 void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
          SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp.
 void setBody(java.lang.String body)
          The message's contents (not URL-encoded).
 void setMD5OfBody(java.lang.String mD5OfBody)
          An MD5 digest of the non-URL-encoded message body string.
 void setMD5OfMessageAttributes(java.lang.String mD5OfMessageAttributes)
          An MD5 digest of the non-URL-encoded message attribute string.
 void setMessageAttributes(java.util.Map<java.lang.String,MessageAttributeValue> messageAttributes)
          Each message attribute consists of a Name, Type, and Value.
 void setMessageId(java.lang.String messageId)
          A unique identifier for the message.
 void setReceiptHandle(java.lang.String receiptHandle)
          An identifier associated with the act of receiving the message.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 Message withAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
          SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp.
 Message withBody(java.lang.String body)
          The message's contents (not URL-encoded).
 Message withMD5OfBody(java.lang.String mD5OfBody)
          An MD5 digest of the non-URL-encoded message body string.
 Message withMD5OfMessageAttributes(java.lang.String mD5OfMessageAttributes)
          An MD5 digest of the non-URL-encoded message attribute string.
 Message withMessageAttributes(java.util.Map<java.lang.String,MessageAttributeValue> messageAttributes)
          Each message attribute consists of a Name, Type, and Value.
 Message withMessageId(java.lang.String messageId)
          A unique identifier for the message.
 Message withReceiptHandle(java.lang.String receiptHandle)
          An identifier associated with the act of receiving the message.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message()
Default constructor for a new Message object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.

Method Detail

getMessageId

public java.lang.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.

setMessageId

public void setMessageId(java.lang.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.

withMessageId

public Message withMessageId(java.lang.String messageId)
A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.

Returns a reference to this object so that method calls can be chained together.

Parameters:
messageId - A unique identifier for the message. Message IDs are considered unique across all AWS accounts for an extended period of time.
Returns:
A reference to this updated object so that method calls can be chained together.

getReceiptHandle

public java.lang.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.

setReceiptHandle

public void setReceiptHandle(java.lang.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.

withReceiptHandle

public Message withReceiptHandle(java.lang.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.

Returns a reference to this object so that method calls can be chained together.

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:
A reference to this updated object so that method calls can be chained together.

getMD5OfBody

public java.lang.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.

setMD5OfBody

public void setMD5OfBody(java.lang.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.

withMD5OfBody

public Message withMD5OfBody(java.lang.String mD5OfBody)
An MD5 digest of the non-URL-encoded message body string.

Returns a reference to this object so that method calls can be chained together.

Parameters:
mD5OfBody - An MD5 digest of the non-URL-encoded message body string.
Returns:
A reference to this updated object so that method calls can be chained together.

getBody

public java.lang.String getBody()
The message's contents (not URL-encoded).

Returns:
The message's contents (not URL-encoded).

setBody

public void setBody(java.lang.String body)
The message's contents (not URL-encoded).

Parameters:
body - The message's contents (not URL-encoded).

withBody

public Message withBody(java.lang.String body)
The message's contents (not URL-encoded).

Returns a reference to this object so that method calls can be chained together.

Parameters:
body - The message's contents (not URL-encoded).
Returns:
A reference to this updated object so that method calls can be chained together.

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp. SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an integer representing the epoch time in milliseconds.

Returns:
SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp. SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an integer representing the epoch time in milliseconds.

setAttributes

public void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp. SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an integer representing the epoch time in milliseconds.

Parameters:
attributes - SenderId, SentTimestamp, ApproximateReceiveCount, and/or ApproximateFirstReceiveTimestamp. SentTimestamp and ApproximateFirstReceiveTimestamp are each returned as an integer representing the epoch time in milliseconds.

withAttributes

public Message withAttributes(java.util.Map<java.lang.String,java.lang.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.

Parameters:
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 updated object so that method calls can be chained together.

addAttributesEntry

public Message addAttributesEntry(java.lang.String key,
                                  java.lang.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.

Parameters:
key - The key of the entry to be added into Attributes.
value - The corresponding value of the entry to be added into Attributes.

clearAttributesEntries

public Message clearAttributesEntries()
Removes all the entries added into Attributes.

Returns a reference to this object so that method calls can be chained together.


getMD5OfMessageAttributes

public java.lang.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.

setMD5OfMessageAttributes

public void setMD5OfMessageAttributes(java.lang.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.

withMD5OfMessageAttributes

public Message withMD5OfMessageAttributes(java.lang.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.

Returns a reference to this object so that method calls can be chained together.

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:
A reference to this updated object so that method calls can be chained together.

getMessageAttributes

public java.util.Map<java.lang.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(java.util.Map<java.lang.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(java.util.Map<java.lang.String,MessageAttributeValue> messageAttributes)
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.

Returns a reference to this object so that method calls can be chained together.

Parameters:
messageAttributes - Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.
Returns:
A reference to this updated object so that method calls can be chained together.

addMessageAttributesEntry

public Message addMessageAttributesEntry(java.lang.String key,
                                         MessageAttributeValue value)
Each message attribute consists of a Name, Type, and Value. For more information, see Message Attribute Items.

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.

Parameters:
key - The key of the entry to be added into MessageAttributes.
value - The corresponding value of the entry to be added into MessageAttributes.

clearMessageAttributesEntries

public Message clearMessageAttributesEntries()
Removes all the entries added into MessageAttributes.

Returns a reference to this object so that method calls can be chained together.


toString

public java.lang.String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.