com.amazonaws.services.sns.model
Class SubscribeRequest

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

public class SubscribeRequest
extends AmazonWebServiceRequest
implements java.io.Serializable

Container for the parameters to the Subscribe operation.

Prepares to subscribe an endpoint by sending the endpoint a confirmation message. To actually create a subscription, the endpoint owner must call the ConfirmSubscription action with the token from the confirmation message. Confirmation tokens are valid for three days.

See Also:
AmazonSNS.subscribe(SubscribeRequest), Serialized Form

Constructor Summary
SubscribeRequest()
          Default constructor for a new SubscribeRequest object.
SubscribeRequest(java.lang.String topicArn, java.lang.String protocol, java.lang.String endpoint)
          Constructs a new SubscribeRequest object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getEndpoint()
          The endpoint that you want to receive notifications.
 java.lang.String getProtocol()
          The protocol you want to use.
 java.lang.String getTopicArn()
          The ARN of the topic you want to subscribe to.
 int hashCode()
           
 void setEndpoint(java.lang.String endpoint)
          The endpoint that you want to receive notifications.
 void setProtocol(java.lang.String protocol)
          The protocol you want to use.
 void setTopicArn(java.lang.String topicArn)
          The ARN of the topic you want to subscribe to.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 SubscribeRequest withEndpoint(java.lang.String endpoint)
          The endpoint that you want to receive notifications.
 SubscribeRequest withProtocol(java.lang.String protocol)
          The protocol you want to use.
 SubscribeRequest withTopicArn(java.lang.String topicArn)
          The ARN of the topic you want to subscribe to.
 
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

SubscribeRequest

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


SubscribeRequest

public SubscribeRequest(java.lang.String topicArn,
                        java.lang.String protocol,
                        java.lang.String endpoint)
Constructs a new SubscribeRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
topicArn - The ARN of the topic you want to subscribe to.
protocol - The protocol you want to use. Supported protocols include:
  • http -- delivery of JSON-encoded message via HTTP POST
  • https -- delivery of JSON-encoded message via HTTPS POST
  • email -- delivery of message via SMTP
  • email-json -- delivery of JSON-encoded message via SMTP
  • sms -- delivery of message via SMS
  • sqs -- delivery of JSON-encoded message to an Amazon SQS queue
  • application -- delivery of JSON-encoded message to an EndpointArn for a mobile app and device.
endpoint - The endpoint that you want to receive notifications. Endpoints vary by protocol:
  • For the http protocol, the endpoint is an URL beginning with "http://"
  • For the https protocol, the endpoint is a URL beginning with "https://"
  • For the email protocol, the endpoint is an email address
  • For the email-json protocol, the endpoint is an email address
  • For the sms protocol, the endpoint is a phone number of an SMS-enabled device
  • For the sqs protocol, the endpoint is the ARN of an Amazon SQS queue
  • For the application protocol, the endpoint is the EndpointArn of a mobile app and device.
Method Detail

getTopicArn

public java.lang.String getTopicArn()
The ARN of the topic you want to subscribe to.

Returns:
The ARN of the topic you want to subscribe to.

setTopicArn

public void setTopicArn(java.lang.String topicArn)
The ARN of the topic you want to subscribe to.

Parameters:
topicArn - The ARN of the topic you want to subscribe to.

withTopicArn

public SubscribeRequest withTopicArn(java.lang.String topicArn)
The ARN of the topic you want to subscribe to.

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

Parameters:
topicArn - The ARN of the topic you want to subscribe to.
Returns:
A reference to this updated object so that method calls can be chained together.

getProtocol

public java.lang.String getProtocol()
The protocol you want to use. Supported protocols include:

Returns:
The protocol you want to use. Supported protocols include:
  • http -- delivery of JSON-encoded message via HTTP POST
  • https -- delivery of JSON-encoded message via HTTPS POST
  • email -- delivery of message via SMTP
  • email-json -- delivery of JSON-encoded message via SMTP
  • sms -- delivery of message via SMS
  • sqs -- delivery of JSON-encoded message to an Amazon SQS queue
  • application -- delivery of JSON-encoded message to an EndpointArn for a mobile app and device.

setProtocol

public void setProtocol(java.lang.String protocol)
The protocol you want to use. Supported protocols include:

Parameters:
protocol - The protocol you want to use. Supported protocols include:
  • http -- delivery of JSON-encoded message via HTTP POST
  • https -- delivery of JSON-encoded message via HTTPS POST
  • email -- delivery of message via SMTP
  • email-json -- delivery of JSON-encoded message via SMTP
  • sms -- delivery of message via SMS
  • sqs -- delivery of JSON-encoded message to an Amazon SQS queue
  • application -- delivery of JSON-encoded message to an EndpointArn for a mobile app and device.

withProtocol

public SubscribeRequest withProtocol(java.lang.String protocol)
The protocol you want to use. Supported protocols include:

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

Parameters:
protocol - The protocol you want to use. Supported protocols include:
  • http -- delivery of JSON-encoded message via HTTP POST
  • https -- delivery of JSON-encoded message via HTTPS POST
  • email -- delivery of message via SMTP
  • email-json -- delivery of JSON-encoded message via SMTP
  • sms -- delivery of message via SMS
  • sqs -- delivery of JSON-encoded message to an Amazon SQS queue
  • application -- delivery of JSON-encoded message to an EndpointArn for a mobile app and device.
Returns:
A reference to this updated object so that method calls can be chained together.

getEndpoint

public java.lang.String getEndpoint()
The endpoint that you want to receive notifications. Endpoints vary by protocol:

Returns:
The endpoint that you want to receive notifications. Endpoints vary by protocol:
  • For the http protocol, the endpoint is an URL beginning with "http://"
  • For the https protocol, the endpoint is a URL beginning with "https://"
  • For the email protocol, the endpoint is an email address
  • For the email-json protocol, the endpoint is an email address
  • For the sms protocol, the endpoint is a phone number of an SMS-enabled device
  • For the sqs protocol, the endpoint is the ARN of an Amazon SQS queue
  • For the application protocol, the endpoint is the EndpointArn of a mobile app and device.

setEndpoint

public void setEndpoint(java.lang.String endpoint)
The endpoint that you want to receive notifications. Endpoints vary by protocol:

Parameters:
endpoint - The endpoint that you want to receive notifications. Endpoints vary by protocol:
  • For the http protocol, the endpoint is an URL beginning with "http://"
  • For the https protocol, the endpoint is a URL beginning with "https://"
  • For the email protocol, the endpoint is an email address
  • For the email-json protocol, the endpoint is an email address
  • For the sms protocol, the endpoint is a phone number of an SMS-enabled device
  • For the sqs protocol, the endpoint is the ARN of an Amazon SQS queue
  • For the application protocol, the endpoint is the EndpointArn of a mobile app and device.

withEndpoint

public SubscribeRequest withEndpoint(java.lang.String endpoint)
The endpoint that you want to receive notifications. Endpoints vary by protocol:

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

Parameters:
endpoint - The endpoint that you want to receive notifications. Endpoints vary by protocol:
  • For the http protocol, the endpoint is an URL beginning with "http://"
  • For the https protocol, the endpoint is a URL beginning with "https://"
  • For the email protocol, the endpoint is an email address
  • For the email-json protocol, the endpoint is an email address
  • For the sms protocol, the endpoint is a phone number of an SMS-enabled device
  • For the sqs protocol, the endpoint is the ARN of an Amazon SQS queue
  • For the application protocol, the endpoint is the EndpointArn of a mobile app and device.
Returns:
A reference to this updated 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.