com.amazonaws.services.sqs.model
Class SendMessageRequest

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

public class SendMessageRequest
extends AmazonWebServiceRequest
implements java.io.Serializable

Container for the parameters to the SendMessage operation.

Delivers a message to the specified queue. With Amazon SQS, you now have the ability to send large payload messages that are up to 256KB (262,144 bytes) in size. To send large payloads, you must use an AWS SDK that supports SigV4 signing. To verify whether SigV4 is supported for an AWS SDK, check the SDK release notes.

IMPORTANT: The following list shows the characters (in Unicode) allowed in your message, according to the W3C XML specification. For more information, go to http://www.w3.org/TR/REC-xml/#charsets If you send any characters not included in the list, your request will be rejected. #x9 | #xA | #xD | [#x20 to #xD7FF] | [#xE000 to #xFFFD] | [#x10000 to #x10FFFF]

See Also:
AmazonSQS.sendMessage(SendMessageRequest), Serialized Form

Constructor Summary
SendMessageRequest()
          Default constructor for a new SendMessageRequest object.
SendMessageRequest(java.lang.String queueUrl, java.lang.String messageBody)
          Constructs a new SendMessageRequest object.
 
Method Summary
 SendMessageRequest addMessageAttributesEntry(java.lang.String key, MessageAttributeValue value)
          Each message attribute consists of a Name, Type, and Value.
 SendMessageRequest clearMessageAttributesEntries()
          Removes all the entries added into MessageAttributes.
 boolean equals(java.lang.Object obj)
           
 java.lang.Integer getDelaySeconds()
          The number of seconds (0 to 900 - 15 minutes) to delay a specific message.
 java.util.Map<java.lang.String,MessageAttributeValue> getMessageAttributes()
          Each message attribute consists of a Name, Type, and Value.
 java.lang.String getMessageBody()
          The message to send.
 java.lang.String getQueueUrl()
          The URL of the Amazon SQS queue to take action on.
 int hashCode()
           
 void setDelaySeconds(java.lang.Integer delaySeconds)
          The number of seconds (0 to 900 - 15 minutes) to delay a specific message.
 void setMessageAttributes(java.util.Map<java.lang.String,MessageAttributeValue> messageAttributes)
          Each message attribute consists of a Name, Type, and Value.
 void setMessageBody(java.lang.String messageBody)
          The message to send.
 void setQueueUrl(java.lang.String queueUrl)
          The URL of the Amazon SQS queue to take action on.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 SendMessageRequest withDelaySeconds(java.lang.Integer delaySeconds)
          The number of seconds (0 to 900 - 15 minutes) to delay a specific message.
 SendMessageRequest withMessageAttributes(java.util.Map<java.lang.String,MessageAttributeValue> messageAttributes)
          Each message attribute consists of a Name, Type, and Value.
 SendMessageRequest withMessageBody(java.lang.String messageBody)
          The message to send.
 SendMessageRequest withQueueUrl(java.lang.String queueUrl)
          The URL of the Amazon SQS queue to take action on.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setDelegationToken, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollector
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SendMessageRequest

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


SendMessageRequest

public SendMessageRequest(java.lang.String queueUrl,
                          java.lang.String messageBody)
Constructs a new SendMessageRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
queueUrl - The URL of the Amazon SQS queue to take action on.
messageBody - The message to send. String maximum 256 KB in size. For a list of allowed characters, see the preceding important note.
Method Detail

getQueueUrl

public java.lang.String getQueueUrl()
The URL of the Amazon SQS queue to take action on.

Returns:
The URL of the Amazon SQS queue to take action on.

setQueueUrl

public void setQueueUrl(java.lang.String queueUrl)
The URL of the Amazon SQS queue to take action on.

Parameters:
queueUrl - The URL of the Amazon SQS queue to take action on.

withQueueUrl

public SendMessageRequest withQueueUrl(java.lang.String queueUrl)
The URL of the Amazon SQS queue to take action on.

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

Parameters:
queueUrl - The URL of the Amazon SQS queue to take action on.
Returns:
A reference to this updated object so that method calls can be chained together.

getMessageBody

public java.lang.String getMessageBody()
The message to send. String maximum 256 KB in size. For a list of allowed characters, see the preceding important note.

Returns:
The message to send. String maximum 256 KB in size. For a list of allowed characters, see the preceding important note.

setMessageBody

public void setMessageBody(java.lang.String messageBody)
The message to send. String maximum 256 KB in size. For a list of allowed characters, see the preceding important note.

Parameters:
messageBody - The message to send. String maximum 256 KB in size. For a list of allowed characters, see the preceding important note.

withMessageBody

public SendMessageRequest withMessageBody(java.lang.String messageBody)
The message to send. String maximum 256 KB in size. For a list of allowed characters, see the preceding important note.

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

Parameters:
messageBody - The message to send. String maximum 256 KB in size. For a list of allowed characters, see the preceding important note.
Returns:
A reference to this updated object so that method calls can be chained together.

getDelaySeconds

public java.lang.Integer getDelaySeconds()
The number of seconds (0 to 900 - 15 minutes) to delay a specific message. Messages with a positive DelaySeconds value become available for processing after the delay time is finished. If you don't specify a value, the default value for the queue applies.

Returns:
The number of seconds (0 to 900 - 15 minutes) to delay a specific message. Messages with a positive DelaySeconds value become available for processing after the delay time is finished. If you don't specify a value, the default value for the queue applies.

setDelaySeconds

public void setDelaySeconds(java.lang.Integer delaySeconds)
The number of seconds (0 to 900 - 15 minutes) to delay a specific message. Messages with a positive DelaySeconds value become available for processing after the delay time is finished. If you don't specify a value, the default value for the queue applies.

Parameters:
delaySeconds - The number of seconds (0 to 900 - 15 minutes) to delay a specific message. Messages with a positive DelaySeconds value become available for processing after the delay time is finished. If you don't specify a value, the default value for the queue applies.

withDelaySeconds

public SendMessageRequest withDelaySeconds(java.lang.Integer delaySeconds)
The number of seconds (0 to 900 - 15 minutes) to delay a specific message. Messages with a positive DelaySeconds value become available for processing after the delay time is finished. If you don't specify a value, the default value for the queue applies.

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

Parameters:
delaySeconds - The number of seconds (0 to 900 - 15 minutes) to delay a specific message. Messages with a positive DelaySeconds value become available for processing after the delay time is finished. If you don't specify a value, the default value for the queue applies.
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 SendMessageRequest 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 SendMessageRequest 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 SendMessageRequest 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.