2727import com .google .api .gax .grpc .ChannelProvider ;
2828import com .google .api .gax .grpc .ExecutorProvider ;
2929import com .google .api .gax .grpc .InstantiatingExecutorProvider ;
30- import com .google .auth .Credentials ;
3130import com .google .auth .oauth2 .GoogleCredentials ;
3231import com .google .common .annotations .VisibleForTesting ;
3332import com .google .common .base .Optional ;
@@ -196,7 +195,8 @@ public FlowControlSettings getFlowControlSettings() {
196195 * Initiates service startup and returns immediately.
197196 *
198197 * <p>Example of receiving a specific number of messages.
199- * <pre> {@code
198+ *
199+ * <pre>{@code
200200 * Subscriber subscriber = Subscriber.defaultBuilder(subscription, receiver).build();
201201 * subscriber.addListener(new Subscriber.Listener() {
202202 * public void failed(Subscriber.State from, Throwable failure) {
@@ -209,7 +209,6 @@ public FlowControlSettings getFlowControlSettings() {
209209 * done.get();
210210 * subscriber.stopAsync().awaitTerminated();
211211 * }</pre>
212- *
213212 */
214213 @ Override
215214 public ApiService startAsync () {
@@ -450,7 +449,6 @@ public static final class Builder {
450449 .build ();
451450
452451 SubscriptionName subscriptionName ;
453- Optional <Credentials > credentials = Optional .absent ();
454452 MessageReceiver receiver ;
455453
456454 Duration ackExpirationPadding = DEFAULT_ACK_EXPIRATION_PADDING ;
@@ -471,16 +469,6 @@ public static final class Builder {
471469 this .receiver = receiver ;
472470 }
473471
474- /**
475- * Credentials to authenticate with.
476- *
477- * <p>Must be properly scoped for accessing Cloud Pub/Sub APIs.
478- */
479- public Builder setCredentials (Credentials credentials ) {
480- this .credentials = Optional .of (Preconditions .checkNotNull (credentials ));
481- return this ;
482- }
483-
484472 /**
485473 * {@code ChannelProvider} to use to create Channels, which must point at Cloud Pub/Sub
486474 * endpoint.
@@ -539,15 +527,15 @@ public Builder setExecutorProvider(ExecutorProvider executorProvider) {
539527 return this ;
540528 }
541529
542- /**
543- * Gives the ability to set a custom executor for managing lease extensions. If none is
544- * provided a shared one will be used by all {@link Subscriber} instances.
530+ /**
531+ * Gives the ability to set a custom executor for managing lease extensions. If none is provided
532+ * a shared one will be used by all {@link Subscriber} instances.
545533 */
546534 public Builder setLeaseAlarmsExecutorProvider (ExecutorProvider executorProvider ) {
547535 this .alarmsExecutorProvider = Preconditions .checkNotNull (executorProvider );
548536 return this ;
549537 }
550-
538+
551539 /** Gives the ability to set a custom clock. */
552540 Builder setClock (ApiClock clock ) {
553541 this .clock = Optional .of (clock );
0 commit comments