17
17
package com .google .cloud .pubsublite ;
18
18
19
19
import com .google .api .core .ApiFuture ;
20
+ import com .google .api .gax .rpc .ApiException ;
20
21
import com .google .cloud .pubsublite .internal .ApiBackgroundResource ;
21
22
import com .google .cloud .pubsublite .proto .Subscription ;
22
23
import com .google .cloud .pubsublite .proto .Topic ;
23
24
import com .google .protobuf .FieldMask ;
24
- import io .grpc .StatusException ;
25
25
import java .util .List ;
26
26
27
27
/** A client for performing Pub/Sub Lite admin operations. */
28
28
public interface AdminClient extends ApiBackgroundResource {
29
- static AdminClient create (AdminClientSettings settings ) throws StatusException {
29
+ static AdminClient create (AdminClientSettings settings ) throws ApiException {
30
30
return settings .instantiate ();
31
31
}
32
32
@@ -37,35 +37,35 @@ static AdminClient create(AdminClientSettings settings) throws StatusException {
37
37
* Create the provided topic if it does not yet exist.
38
38
*
39
39
* @param topic The topic to create.
40
- * @return A future that will have either an error {@link io.grpc.StatusException } or the topic on
41
- * success.
40
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException } or
41
+ * the topic on success.
42
42
*/
43
43
ApiFuture <Topic > createTopic (Topic topic );
44
44
45
45
/**
46
46
* Get the topic with id {@code id} if it exists.
47
47
*
48
48
* @param path The path of the topic to retrieve.
49
- * @return A future that will have either an error {@link io.grpc.StatusException } or the topic on
50
- * success.
49
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException } or
50
+ * the topic on success.
51
51
*/
52
52
ApiFuture <Topic > getTopic (TopicPath path );
53
53
54
54
/**
55
55
* Get the partitioning info for the topic with id {@code id} if it exists.
56
56
*
57
57
* @param path The path of the topic to retrieve.
58
- * @return A future that will have either an error {@link io.grpc.StatusException } or the number
59
- * of topic partitions on success.
58
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException } or
59
+ * the number of topic partitions on success.
60
60
*/
61
61
ApiFuture <Long > getTopicPartitionCount (TopicPath path );
62
62
63
63
/**
64
64
* List all topics for the specified project.
65
65
*
66
66
* @param path The path of the project to list topics for.
67
- * @return A future that will have either an error {@link io.grpc.StatusException } or the list of
68
- * topic paths on success.
67
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException } or
68
+ * the list of topic paths on success.
69
69
*/
70
70
ApiFuture <List <Topic >> listTopics (LocationPath path );
71
71
@@ -74,55 +74,55 @@ static AdminClient create(AdminClientSettings settings) throws StatusException {
74
74
*
75
75
* @param topic The topic to update.
76
76
* @param mask The mask indicating which fields should be updated.
77
- * @return A future that will have either an error {@link io.grpc.StatusException } or the
78
- * resulting topic on success. Updating nonexistent topics will cause the future to have an
79
- * exception with status {@link io.grpc.Status .Code#NOT_FOUND}
77
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException } or
78
+ * the resulting topic on success. Updating nonexistent topics will cause the future to have
79
+ * an exception with status {@link com.google.api.gax.rpc.StatusCode .Code#NOT_FOUND}
80
80
*/
81
81
ApiFuture <Topic > updateTopic (Topic topic , FieldMask mask );
82
82
83
83
/**
84
84
* Delete the topic with id {@code id} if it exists.
85
85
*
86
86
* @param path The path of the topic to retrieve.
87
- * @return A future that will have either an error {@link io.grpc.StatusException } or void on
88
- * success. Deleting nonexistent topics will cause the future to have an exception with status
89
- * {@link io.grpc.Status .Code#NOT_FOUND}
87
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException } or
88
+ * void on success. Deleting nonexistent topics will cause the future to have an exception
89
+ * with status {@link com.google.api.gax.rpc.StatusCode .Code#NOT_FOUND}
90
90
*/
91
91
ApiFuture <Void > deleteTopic (TopicPath path );
92
92
93
93
/**
94
94
* Get the list of subscriptions for the topic with id {@code id} if it exists.
95
95
*
96
96
* @param path The path of the topic to retrieve.
97
- * @return A future that will have either an error {@link io.grpc.StatusException } or the list of
98
- * subscriptions on success.
97
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException } or
98
+ * the list of subscriptions on success.
99
99
*/
100
100
ApiFuture <List <SubscriptionPath >> listTopicSubscriptions (TopicPath path );
101
101
102
102
/**
103
103
* Create the provided subscription if it does not yet exist.
104
104
*
105
105
* @param subscription The subscription to create.
106
- * @return A future that will have either an error {@link io.grpc.StatusException } or the
107
- * subscription on success.
106
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException } or
107
+ * the subscription on success.
108
108
*/
109
109
ApiFuture <Subscription > createSubscription (Subscription subscription );
110
110
111
111
/**
112
112
* Get the subscription with id {@code id} if it exists.
113
113
*
114
114
* @param path The path of the subscription to retrieve.
115
- * @return A future that will have either an error {@link io.grpc.StatusException } or the
116
- * subscription on success.
115
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException } or
116
+ * the subscription on success.
117
117
*/
118
118
ApiFuture <Subscription > getSubscription (SubscriptionPath path );
119
119
120
120
/**
121
121
* List all subscriptions for the specified project.
122
122
*
123
123
* @param path The path of the project to list subscriptions for.
124
- * @return A future that will have either an error {@link io.grpc.StatusException } or the list of
125
- * subscription paths on success.
124
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException } or
125
+ * the list of subscription paths on success.
126
126
*/
127
127
ApiFuture <List <Subscription >> listSubscriptions (LocationPath path );
128
128
@@ -131,19 +131,20 @@ static AdminClient create(AdminClientSettings settings) throws StatusException {
131
131
*
132
132
* @param subscription The subscription to update.
133
133
* @param mask The mask indicating which fields should be updated.
134
- * @return A future that will have either an error {@link io.grpc.StatusException} or the
135
- * resulting subscription on success. Updating nonexistent subscriptions will cause the future
136
- * to have an exception with status {@link io.grpc.Status.Code#NOT_FOUND}
134
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException} or
135
+ * the resulting subscription on success. Updating nonexistent subscriptions will cause the
136
+ * future to have an exception with status {@link
137
+ * com.google.api.gax.rpc.StatusCode.Code#NOT_FOUND}
137
138
*/
138
139
ApiFuture <Subscription > updateSubscription (Subscription subscription , FieldMask mask );
139
140
140
141
/**
141
142
* Delete the subscription with id {@code id} if it exists.
142
143
*
143
144
* @param path The path of the subscription to retrieve.
144
- * @return A future that will have either an error {@link io.grpc.StatusException } or void on
145
- * success. Deleting nonexistent subscriptions will cause the future to have an exception with
146
- * status {@link io.grpc.Status .Code#NOT_FOUND}
145
+ * @return A future that will have either an error {@link com.google.api.gax.rpc.ApiException } or
146
+ * void on success. Deleting nonexistent subscriptions will cause the future to have an
147
+ * exception with status {@link com.google.api.gax.rpc.StatusCode .Code#NOT_FOUND}
147
148
*/
148
149
ApiFuture <Void > deleteSubscription (SubscriptionPath path );
149
150
}
0 commit comments