Skip to content

Commit fec0e12

Browse files
committed
Add docs to PubSub spi layer (googleapis#1066)
1 parent 933c985 commit fec0e12

File tree

1 file changed

+95
-1
lines changed
  • gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/spi

1 file changed

+95
-1
lines changed

gcloud-java-pubsub/src/main/java/com/google/cloud/pubsub/spi/PubSubRpc.java

+95-1
Original file line numberDiff line numberDiff line change
@@ -79,32 +79,126 @@ interface PullFuture extends Future<PullResponse> {
7979
void addCallback(final PullCallback callback);
8080
}
8181

82-
// in all cases root cause of ExecutionException is PubSubException
82+
/**
83+
* Sends a request to create a topic. This method returns a {@code Future} object to consume the
84+
* result. {@link Future#get()} returns the created topic.
85+
*
86+
* @param topic the topic to create
87+
*/
8388
Future<Topic> create(Topic topic);
8489

90+
/**
91+
* Sends a request to publish messages. This method returns a {@code Future} object to consume the
92+
* result. {@link Future#get()} returns a response object containing the publish result.
93+
*
94+
* @param request the request object containing all of the parameters for the API call
95+
*/
8596
Future<PublishResponse> publish(PublishRequest request);
8697

98+
/**
99+
* Sends a request to get a topic. This method returns a {@code Future} object to consume the
100+
* result. {@link Future#get()} returns the requested topic or {@code null} if not found.
101+
*
102+
* @param request the request object containing all of the parameters for the API call
103+
*/
87104
Future<Topic> get(GetTopicRequest request);
88105

106+
/**
107+
* Sends a request to list the topics in a project. This method returns a {@code Future} object to
108+
* consume the result. {@link Future#get()} returns a response object containing the listing
109+
* result.
110+
*
111+
* @param request the request object containing all of the parameters for the API call
112+
*/
89113
Future<ListTopicsResponse> list(ListTopicsRequest request);
90114

115+
/**
116+
* Sends a request to list the subscriptions for a topic. This method returns a {@code Future}
117+
* object to consume the result. {@link Future#get()} returns a response object containing the
118+
* listing result.
119+
*
120+
* @param request the request object containing all of the parameters for the API call
121+
*/
91122
Future<ListTopicSubscriptionsResponse> list(ListTopicSubscriptionsRequest request);
92123

124+
/**
125+
* Sends a request to delete a topic. This method returns a {@code Future} object to consume the
126+
* result. {@link Future#get()} returns {@link Empty#getDefaultInstance()} or {@code null} if the
127+
* topic was not found.
128+
*
129+
* @param request the request object containing all of the parameters for the API call
130+
*/
93131
Future<Empty> delete(DeleteTopicRequest request);
94132

133+
/**
134+
* Sends a request to create a subscription. This method returns a {@code Future} object to
135+
* consume the result. {@link Future#get()} returns the created subscription.
136+
*
137+
* @param subscription the subscription to create
138+
*/
95139
Future<Subscription> create(Subscription subscription);
96140

141+
/**
142+
* Sends a request to get a subscription. This method returns a {@code Future} object to consume
143+
* the result. {@link Future#get()} returns the requested subscription or {@code null} if not
144+
* found.
145+
*
146+
* @param request the request object containing all of the parameters for the API call
147+
*/
97148
Future<Subscription> get(GetSubscriptionRequest request);
98149

150+
/**
151+
* Sends a request to list the subscriptions in a project. This method returns a {@code Future}
152+
* object to consume the result. {@link Future#get()} returns a response object containing the
153+
* listing result.
154+
*
155+
* @param request the request object containing all of the parameters for the API call
156+
*/
99157
Future<ListSubscriptionsResponse> list(ListSubscriptionsRequest request);
100158

159+
/**
160+
* Sends a request to delete a subscription. This method returns a {@code Future} object to
161+
* consume the result. {@link Future#get()} returns {@link Empty#getDefaultInstance()} or
162+
* {@code null} if the subscription was not found.
163+
*
164+
* @param request the request object containing all of the parameters for the API call
165+
*/
101166
Future<Empty> delete(DeleteSubscriptionRequest request);
102167

168+
/**
169+
* Sends a request to modify the acknowledge deadline of a subscription. This method returns a
170+
* {@code Future} object to consume the result. {@link Future#get()} returns
171+
* {@link Empty#getDefaultInstance()} if the request was issued correctly.
172+
*
173+
* @param request the request object containing all of the parameters for the API call
174+
*/
103175
Future<Empty> modify(ModifyAckDeadlineRequest request);
104176

177+
/**
178+
* Sends a request to acknowledge messages for a subscription. This method returns a
179+
* {@code Future} object to consume the result. {@link Future#get()} returns
180+
* {@link Empty#getDefaultInstance()} if the request was issued correctly.
181+
*
182+
* @param request the request object containing all of the parameters for the API call
183+
*/
105184
Future<Empty> acknowledge(AcknowledgeRequest request);
106185

186+
/**
187+
* Sends a request to pull messages from a subscription. This method returns a {@link PullFuture}
188+
* object to consume the result. {@link PullFuture#get()} returns a response object containing the
189+
* pulled messages. {@link PullFuture#addCallback(PullCallback)} can be used to register a
190+
* callback for the request's completion.
191+
*
192+
* @param request the request object containing all of the parameters for the API call
193+
*/
107194
PullFuture pull(PullRequest request);
108195

196+
/**
197+
* Sends a request to modify the push configuration of a subscription. This method returns a
198+
* {@code Future} object to consume the result. {@link Future#get()} returns
199+
* {@link Empty#getDefaultInstance()} if the request was issued correctly.
200+
*
201+
* @param request the request object containing all of the parameters for the API call
202+
*/
109203
Future<Empty> modify(ModifyPushConfigRequest request);
110204
}

0 commit comments

Comments
 (0)