Skip to content

Commit

Permalink
Add throw javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
shinfan committed Apr 8, 2016
1 parent 3bf78a1 commit 5ca8341
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public void close() throws IOException {
* underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
* signs (`%`). It must be between 3 and 255 characters in length, and it
* must not start with `"goog"`.
* @throws ApiException if the remote call fails
*/
public final Topic createTopic(String name) {
Topic request = Topic.newBuilder().setName(name).build();
Expand All @@ -228,6 +229,7 @@ public final Topic createTopic(String name) {
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
private Topic createTopic(Topic request) {
return createTopicCallable().call(request);
Expand All @@ -239,6 +241,7 @@ private Topic createTopic(Topic request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<Topic, Topic> createTopicCallable() {
return createTopicCallable;
Expand All @@ -257,6 +260,7 @@ public final ApiCallable<Topic, Topic> createTopicCallable() {
*
* @param topic The messages in the request will be published on this topic.
* @param messages The messages to publish.
* @throws ApiException if the remote call fails
*/
public final PublishResponse publish(String topic, List<PubsubMessage> messages) {
PublishRequest request =
Expand All @@ -275,6 +279,7 @@ public final PublishResponse publish(String topic, List<PubsubMessage> messages)
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
public PublishResponse publish(PublishRequest request) {
return publishCallable().call(request);
Expand All @@ -288,6 +293,7 @@ public PublishResponse publish(PublishRequest request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<PublishRequest, PublishResponse> publishCallable() {
return publishCallable;
Expand All @@ -303,6 +309,7 @@ public final ApiCallable<PublishRequest, PublishResponse> publishCallable() {
* <!-- end manual edit -->
*
* @param topic The name of the topic to get.
* @throws ApiException if the remote call fails
*/
public final Topic getTopic(String topic) {
GetTopicRequest request = GetTopicRequest.newBuilder().setTopic(topic).build();
Expand All @@ -318,6 +325,7 @@ public final Topic getTopic(String topic) {
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
private Topic getTopic(GetTopicRequest request) {
return getTopicCallable().call(request);
Expand All @@ -329,6 +337,7 @@ private Topic getTopic(GetTopicRequest request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<GetTopicRequest, Topic> getTopicCallable() {
return getTopicCallable;
Expand All @@ -344,6 +353,7 @@ public final ApiCallable<GetTopicRequest, Topic> getTopicCallable() {
* <!-- end manual edit -->
*
* @param project The name of the cloud project that topics belong to.
* @throws ApiException if the remote call fails
*/
public final Iterable<Topic> listTopics(String project) {
ListTopicsRequest request = ListTopicsRequest.newBuilder().setProject(project).build();
Expand All @@ -358,6 +368,7 @@ public final Iterable<Topic> listTopics(String project) {
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
public final Iterable<Topic> listTopics(ListTopicsRequest request) {
return listTopicsIterableCallable().call(request);
Expand All @@ -369,6 +380,7 @@ public final Iterable<Topic> listTopics(ListTopicsRequest request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<ListTopicsRequest, Iterable<Topic>> listTopicsIterableCallable() {
return listTopicsIterableCallable;
Expand All @@ -380,6 +392,7 @@ public final ApiCallable<ListTopicsRequest, Iterable<Topic>> listTopicsIterableC
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<ListTopicsRequest, ListTopicsResponse> listTopicsCallable() {
return listTopicsCallable;
Expand All @@ -395,6 +408,7 @@ public final ApiCallable<ListTopicsRequest, ListTopicsResponse> listTopicsCallab
* <!-- end manual edit -->
*
* @param topic The name of the topic that subscriptions are attached to.
* @throws ApiException if the remote call fails
*/
public final Iterable<String> listTopicSubscriptions(String topic) {
ListTopicSubscriptionsRequest request =
Expand All @@ -410,6 +424,7 @@ public final Iterable<String> listTopicSubscriptions(String topic) {
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
public final Iterable<String> listTopicSubscriptions(ListTopicSubscriptionsRequest request) {
return listTopicSubscriptionsIterableCallable().call(request);
Expand All @@ -421,6 +436,7 @@ public final Iterable<String> listTopicSubscriptions(ListTopicSubscriptionsReque
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<ListTopicSubscriptionsRequest, Iterable<String>>
listTopicSubscriptionsIterableCallable() {
Expand All @@ -433,6 +449,7 @@ public final Iterable<String> listTopicSubscriptions(ListTopicSubscriptionsReque
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<ListTopicSubscriptionsRequest, ListTopicSubscriptionsResponse>
listTopicSubscriptionsCallable() {
Expand All @@ -453,6 +470,7 @@ public final Iterable<String> listTopicSubscriptions(ListTopicSubscriptionsReque
* <!-- end manual edit -->
*
* @param topic Name of the topic to delete.
* @throws ApiException if the remote call fails
*/
public final void deleteTopic(String topic) {
DeleteTopicRequest request = DeleteTopicRequest.newBuilder().setTopic(topic).build();
Expand All @@ -472,6 +490,7 @@ public final void deleteTopic(String topic) {
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
private void deleteTopic(DeleteTopicRequest request) {
deleteTopicCallable().call(request);
Expand All @@ -487,6 +506,7 @@ private void deleteTopic(DeleteTopicRequest request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<DeleteTopicRequest, Empty> deleteTopicCallable() {
return deleteTopicCallable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ public void close() throws IOException {
* system will eventually redeliver the message.
*
* If this parameter is not set, the default value of 10 seconds is used.
* @throws ApiException if the remote call fails
*/
public final Subscription createSubscription(
String name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) {
Expand Down Expand Up @@ -270,6 +271,7 @@ public final Subscription createSubscription(
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
public Subscription createSubscription(Subscription request) {
return createSubscriptionCallable().call(request);
Expand All @@ -286,6 +288,7 @@ public Subscription createSubscription(Subscription request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<Subscription, Subscription> createSubscriptionCallable() {
return createSubscriptionCallable;
Expand All @@ -304,6 +307,7 @@ public final ApiCallable<Subscription, Subscription> createSubscriptionCallable(
* <!-- end manual edit -->
*
* @param subscription The name of the subscription to get.
* @throws ApiException if the remote call fails
*/
public final Subscription getSubscription(String subscription) {
GetSubscriptionRequest request =
Expand All @@ -323,6 +327,7 @@ public final Subscription getSubscription(String subscription) {
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
private Subscription getSubscription(GetSubscriptionRequest request) {
return getSubscriptionCallable().call(request);
Expand All @@ -337,6 +342,7 @@ private Subscription getSubscription(GetSubscriptionRequest request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<GetSubscriptionRequest, Subscription> getSubscriptionCallable() {
return getSubscriptionCallable;
Expand All @@ -355,6 +361,7 @@ public final ApiCallable<GetSubscriptionRequest, Subscription> getSubscriptionCa
* <!-- end manual edit -->
*
* @param project The name of the cloud project that subscriptions belong to.
* @throws ApiException if the remote call fails
*/
public final Iterable<Subscription> listSubscriptions(String project) {
ListSubscriptionsRequest request =
Expand All @@ -373,6 +380,7 @@ public final Iterable<Subscription> listSubscriptions(String project) {
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
public final Iterable<Subscription> listSubscriptions(ListSubscriptionsRequest request) {
return listSubscriptionsIterableCallable().call(request);
Expand All @@ -387,6 +395,7 @@ public final Iterable<Subscription> listSubscriptions(ListSubscriptionsRequest r
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<ListSubscriptionsRequest, Iterable<Subscription>>
listSubscriptionsIterableCallable() {
Expand All @@ -402,6 +411,7 @@ public final Iterable<Subscription> listSubscriptions(ListSubscriptionsRequest r
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<ListSubscriptionsRequest, ListSubscriptionsResponse>
listSubscriptionsCallable() {
Expand All @@ -422,6 +432,7 @@ public final Iterable<Subscription> listSubscriptions(ListSubscriptionsRequest r
* <!-- end manual edit -->
*
* @param subscription The subscription to delete.
* @throws ApiException if the remote call fails
*/
public final void deleteSubscription(String subscription) {
DeleteSubscriptionRequest request =
Expand All @@ -442,6 +453,7 @@ public final void deleteSubscription(String subscription) {
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
private void deleteSubscription(DeleteSubscriptionRequest request) {
deleteSubscriptionCallable().call(request);
Expand All @@ -457,6 +469,7 @@ private void deleteSubscription(DeleteSubscriptionRequest request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<DeleteSubscriptionRequest, Empty> deleteSubscriptionCallable() {
return deleteSubscriptionCallable;
Expand All @@ -477,10 +490,11 @@ public final ApiCallable<DeleteSubscriptionRequest, Empty> deleteSubscriptionCal
* @param subscription The name of the subscription.
* @param ackIds List of acknowledgment IDs.
* @param ackDeadlineSeconds The new ack deadline with respect to the time this request was sent to
* the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new
* the Pub/Sub system. Must be &gt;= 0. For example, if the value is 10, the new
* ack deadline will expire 10 seconds after the `ModifyAckDeadline` call
* was made. Specifying zero may immediately make the message available for
* another pull request.
* @throws ApiException if the remote call fails
*/
public final void modifyAckDeadline(
String subscription, List<String> ackIds, int ackDeadlineSeconds) {
Expand All @@ -505,6 +519,7 @@ public final void modifyAckDeadline(
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
public void modifyAckDeadline(ModifyAckDeadlineRequest request) {
modifyAckDeadlineCallable().call(request);
Expand All @@ -519,6 +534,7 @@ public void modifyAckDeadline(ModifyAckDeadlineRequest request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<ModifyAckDeadlineRequest, Empty> modifyAckDeadlineCallable() {
return modifyAckDeadlineCallable;
Expand All @@ -542,6 +558,7 @@ public final ApiCallable<ModifyAckDeadlineRequest, Empty> modifyAckDeadlineCalla
* @param subscription The subscription whose message is being acknowledged.
* @param ackIds The acknowledgment ID for the messages being acknowledged that was returned
* by the Pub/Sub system in the `Pull` response. Must not be empty.
* @throws ApiException if the remote call fails
*/
public final void acknowledge(String subscription, List<String> ackIds) {
AcknowledgeRequest request =
Expand All @@ -564,6 +581,7 @@ public final void acknowledge(String subscription, List<String> ackIds) {
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
public void acknowledge(AcknowledgeRequest request) {
acknowledgeCallable().call(request);
Expand All @@ -581,6 +599,7 @@ public void acknowledge(AcknowledgeRequest request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<AcknowledgeRequest, Empty> acknowledgeCallable() {
return acknowledgeCallable;
Expand All @@ -605,6 +624,7 @@ public final ApiCallable<AcknowledgeRequest, Empty> acknowledgeCallable() {
* than returning no messages.
* @param maxMessages The maximum number of messages returned for this request. The Pub/Sub
* system may return fewer than the number specified.
* @throws ApiException if the remote call fails
*/
public final PullResponse pull(String subscription, boolean returnImmediately, int maxMessages) {
PullRequest request =
Expand All @@ -628,6 +648,7 @@ public final PullResponse pull(String subscription, boolean returnImmediately, i
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
public PullResponse pull(PullRequest request) {
return pullCallable().call(request);
Expand All @@ -642,6 +663,7 @@ public PullResponse pull(PullRequest request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<PullRequest, PullResponse> pullCallable() {
return pullCallable;
Expand All @@ -668,6 +690,7 @@ public final ApiCallable<PullRequest, PullResponse> pullCallable() {
* stop pushing messages from the given subscription and allow
* messages to be pulled and acknowledged - effectively pausing
* the subscription if `Pull` is not called.
* @throws ApiException if the remote call fails
*/
public final void modifyPushConfig(String subscription, PushConfig pushConfig) {
ModifyPushConfigRequest request =
Expand All @@ -692,6 +715,7 @@ public final void modifyPushConfig(String subscription, PushConfig pushConfig) {
* <!-- end manual edit -->
*
* @param request The request object containing all of the parameters for the API call.
* @throws ApiException if the remote call fails
*/
public void modifyPushConfig(ModifyPushConfigRequest request) {
modifyPushConfigCallable().call(request);
Expand All @@ -708,6 +732,7 @@ public void modifyPushConfig(ModifyPushConfigRequest request) {
*
* <!-- manual edit -->
* <!-- end manual edit -->
* @throws ApiException if the remote call fails
*/
public final ApiCallable<ModifyPushConfigRequest, Empty> modifyPushConfigCallable() {
return modifyPushConfigCallable;
Expand Down
Loading

0 comments on commit 5ca8341

Please sign in to comment.