|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.AmazonWebServiceRequest
com.amazonaws.services.sns.model.PublishRequest
public class PublishRequest
Container for the parameters to the Publish operation
.
The Publish action sends a message to all of a topic's subscribed endpoints. When a messageId is returned, the message has been saved and Amazon SNS will attempt to deliver it to the topic's subscribers shortly. The format of the outgoing message to each subscribed endpoint depends on the notification protocol selected.
AmazonSNS.publish(PublishRequest)
Constructor Summary | |
---|---|
PublishRequest()
Default constructor for a new PublishRequest object. |
|
PublishRequest(String topicArn,
String message)
Constructs a new PublishRequest object. |
|
PublishRequest(String topicArn,
String message,
String subject)
Constructs a new PublishRequest object. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
String |
getMessage()
The message you want to send to the topic. |
String |
getMessageStructure()
Optional parameter. |
String |
getSubject()
Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints. |
String |
getTopicArn()
The topic you want to publish to. |
int |
hashCode()
|
void |
setMessage(String message)
The message you want to send to the topic. |
void |
setMessageStructure(String messageStructure)
Optional parameter. |
void |
setSubject(String subject)
Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints. |
void |
setTopicArn(String topicArn)
The topic you want to publish to. |
String |
toString()
Returns a string representation of this object; useful for testing and debugging. |
PublishRequest |
withMessage(String message)
The message you want to send to the topic. |
PublishRequest |
withMessageStructure(String messageStructure)
Optional parameter. |
PublishRequest |
withSubject(String subject)
Optional parameter to be used as the "Subject" line of when the message is delivered to e-mail endpoints. |
PublishRequest |
withTopicArn(String topicArn)
The topic you want to publish to. |
Methods inherited from class com.amazonaws.AmazonWebServiceRequest |
---|
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, setDelegationToken, setRequestCredentials |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PublishRequest()
public PublishRequest(String topicArn, String message)
topicArn
- The topic you want to publish to.message
- The message you want to send to the topic.
Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).
public PublishRequest(String topicArn, String message, String subject)
topicArn
- The topic you want to publish to.message
- The message you want to send to the topic.
Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).
subject
- Optional parameter to be used as the "Subject" line of
when the message is delivered to e-mail endpoints. This field will
also be included, if present, in the standard JSON messages delivered
to other endpoints. Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.
Method Detail |
---|
public String getTopicArn()
public void setTopicArn(String topicArn)
topicArn
- The topic you want to publish to.public PublishRequest withTopicArn(String topicArn)
Returns a reference to this object so that method calls can be chained together.
topicArn
- The topic you want to publish to.
public String getMessage()
Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).
Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).
public void setMessage(String message)
Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).
message
- The message you want to send to the topic. Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).
public PublishRequest withMessage(String message)
Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).
Returns a reference to this object so that method calls can be chained together.
message
- The message you want to send to the topic. Constraints: Messages must be UTF-8 encoded strings at most 8 KB in size (8192 bytes, not 8192 characters).
public String getSubject()
Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.
Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.
public void setSubject(String subject)
Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.
subject
- Optional parameter to be used as the "Subject" line of when the
message is delivered to e-mail endpoints. This field will also be
included, if present, in the standard JSON messages delivered to other
endpoints. Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.
public PublishRequest withSubject(String subject)
Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.
Returns a reference to this object so that method calls can be chained together.
subject
- Optional parameter to be used as the "Subject" line of when the
message is delivered to e-mail endpoints. This field will also be
included, if present, in the standard JSON messages delivered to other
endpoints. Constraints: Subjects must be ASCII text that begins with a letter, number or punctuation mark; must not include line breaks or control characters; and must be less than 100 characters long.
public String getMessageStructure()
Constraints: Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values. The values will be parsed (unescaped) before they are used in outgoing messages. Typically, outbound notifications are JSON encoded (meaning, the characters will be reescaped for sending). JSON strings are UTF-8. Values have a minimum length of 0 (the empty string, "", is allowed). Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes). Non-string values will cause the key to be ignored. Keys that do not correspond to supported transport protocols will be ignored. Duplicate keys are not allowed. Failure to parse or validate any key or value in the message will cause the Publish call to return an error (no partial delivery).
Constraints: Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values. The values will be parsed (unescaped) before they are used in outgoing messages. Typically, outbound notifications are JSON encoded (meaning, the characters will be reescaped for sending). JSON strings are UTF-8. Values have a minimum length of 0 (the empty string, "", is allowed). Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes). Non-string values will cause the key to be ignored. Keys that do not correspond to supported transport protocols will be ignored. Duplicate keys are not allowed. Failure to parse or validate any key or value in the message will cause the Publish call to return an error (no partial delivery).
public void setMessageStructure(String messageStructure)
Constraints: Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values. The values will be parsed (unescaped) before they are used in outgoing messages. Typically, outbound notifications are JSON encoded (meaning, the characters will be reescaped for sending). JSON strings are UTF-8. Values have a minimum length of 0 (the empty string, "", is allowed). Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes). Non-string values will cause the key to be ignored. Keys that do not correspond to supported transport protocols will be ignored. Duplicate keys are not allowed. Failure to parse or validate any key or value in the message will cause the Publish call to return an error (no partial delivery).
messageStructure
- Optional parameter. It will have one valid value: "json". If this
option, Message is present and set to "json", the value of Message
must: be a syntactically valid JSON object. It must contain at least a
top level JSON key of "default" with a value that is a string. For any
other top level key that matches one of our transport protocols (e.g.
"http"), then the corresponding value (if it is a string) will be used
for the message published for that protocol Constraints: Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values. The values will be parsed (unescaped) before they are used in outgoing messages. Typically, outbound notifications are JSON encoded (meaning, the characters will be reescaped for sending). JSON strings are UTF-8. Values have a minimum length of 0 (the empty string, "", is allowed). Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes). Non-string values will cause the key to be ignored. Keys that do not correspond to supported transport protocols will be ignored. Duplicate keys are not allowed. Failure to parse or validate any key or value in the message will cause the Publish call to return an error (no partial delivery).
public PublishRequest withMessageStructure(String messageStructure)
Constraints: Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values. The values will be parsed (unescaped) before they are used in outgoing messages. Typically, outbound notifications are JSON encoded (meaning, the characters will be reescaped for sending). JSON strings are UTF-8. Values have a minimum length of 0 (the empty string, "", is allowed). Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes). Non-string values will cause the key to be ignored. Keys that do not correspond to supported transport protocols will be ignored. Duplicate keys are not allowed. Failure to parse or validate any key or value in the message will cause the Publish call to return an error (no partial delivery).
Returns a reference to this object so that method calls can be chained together.
messageStructure
- Optional parameter. It will have one valid value: "json". If this
option, Message is present and set to "json", the value of Message
must: be a syntactically valid JSON object. It must contain at least a
top level JSON key of "default" with a value that is a string. For any
other top level key that matches one of our transport protocols (e.g.
"http"), then the corresponding value (if it is a string) will be used
for the message published for that protocol Constraints: Keys in the JSON object that correspond to supported transport protocols must have simple JSON string values. The values will be parsed (unescaped) before they are used in outgoing messages. Typically, outbound notifications are JSON encoded (meaning, the characters will be reescaped for sending). JSON strings are UTF-8. Values have a minimum length of 0 (the empty string, "", is allowed). Values have a maximum length bounded by the overall message size (so, including multiple protocols may limit message sizes). Non-string values will cause the key to be ignored. Keys that do not correspond to supported transport protocols will be ignored. Duplicate keys are not allowed. Failure to parse or validate any key or value in the message will cause the Publish call to return an error (no partial delivery).
public String toString()
toString
in class Object
Object.toString()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |