Class StorageSettings

java.lang.Object
com.google.api.gax.rpc.ClientSettings<StorageSettings>
com.google.storage.v2.StorageSettings

@Generated("by gapic-generator-java") public class StorageSettings extends com.google.api.gax.rpc.ClientSettings<StorageSettings>
Settings class to configure an instance of StorageClient.

The default instance has everything set to sensible defaults:

  • The default service address (storage.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) of deleteBucket:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 StorageSettings.Builder storageSettingsBuilder = StorageSettings.newBuilder();
 storageSettingsBuilder
     .deleteBucketSettings()
     .setRetrySettings(
         storageSettingsBuilder
             .deleteBucketSettings()
             .getRetrySettings()
             .toBuilder()
             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
             .setMaxAttempts(5)
             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
             .setRetryDelayMultiplier(1.3)
             .setRpcTimeoutMultiplier(1.5)
             .setTotalTimeoutDuration(Duration.ofSeconds(300))
             .build());
 StorageSettings storageSettings = storageSettingsBuilder.build();
 
Please refer to the [Client Side Retry Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for additional support in setting retries.
  • Constructor Details

  • Method Details

    • deleteBucketSettings

      public com.google.api.gax.rpc.UnaryCallSettings<DeleteBucketRequest,com.google.protobuf.Empty> deleteBucketSettings()
      Returns the object with the settings used for calls to deleteBucket.
    • getBucketSettings

      public com.google.api.gax.rpc.UnaryCallSettings<GetBucketRequest,Bucket> getBucketSettings()
      Returns the object with the settings used for calls to getBucket.
    • createBucketSettings

      public com.google.api.gax.rpc.UnaryCallSettings<CreateBucketRequest,Bucket> createBucketSettings()
      Returns the object with the settings used for calls to createBucket.
    • listBucketsSettings

      public com.google.api.gax.rpc.PagedCallSettings<ListBucketsRequest,ListBucketsResponse,StorageClient.ListBucketsPagedResponse> listBucketsSettings()
      Returns the object with the settings used for calls to listBuckets.
    • lockBucketRetentionPolicySettings

      public com.google.api.gax.rpc.UnaryCallSettings<LockBucketRetentionPolicyRequest,Bucket> lockBucketRetentionPolicySettings()
      Returns the object with the settings used for calls to lockBucketRetentionPolicy.
    • getIamPolicySettings

      public com.google.api.gax.rpc.UnaryCallSettings<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicySettings()
      Returns the object with the settings used for calls to getIamPolicy.
    • setIamPolicySettings

      public com.google.api.gax.rpc.UnaryCallSettings<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicySettings()
      Returns the object with the settings used for calls to setIamPolicy.
    • testIamPermissionsSettings

      public com.google.api.gax.rpc.UnaryCallSettings<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsSettings()
      Returns the object with the settings used for calls to testIamPermissions.
    • updateBucketSettings

      public com.google.api.gax.rpc.UnaryCallSettings<UpdateBucketRequest,Bucket> updateBucketSettings()
      Returns the object with the settings used for calls to updateBucket.
    • composeObjectSettings

      public com.google.api.gax.rpc.UnaryCallSettings<ComposeObjectRequest,Object> composeObjectSettings()
      Returns the object with the settings used for calls to composeObject.
    • deleteObjectSettings

      public com.google.api.gax.rpc.UnaryCallSettings<DeleteObjectRequest,com.google.protobuf.Empty> deleteObjectSettings()
      Returns the object with the settings used for calls to deleteObject.
    • restoreObjectSettings

      public com.google.api.gax.rpc.UnaryCallSettings<RestoreObjectRequest,Object> restoreObjectSettings()
      Returns the object with the settings used for calls to restoreObject.
    • cancelResumableWriteSettings

      public com.google.api.gax.rpc.UnaryCallSettings<CancelResumableWriteRequest,CancelResumableWriteResponse> cancelResumableWriteSettings()
      Returns the object with the settings used for calls to cancelResumableWrite.
    • getObjectSettings

      public com.google.api.gax.rpc.UnaryCallSettings<GetObjectRequest,Object> getObjectSettings()
      Returns the object with the settings used for calls to getObject.
    • readObjectSettings

      public com.google.api.gax.rpc.ServerStreamingCallSettings<ReadObjectRequest,ReadObjectResponse> readObjectSettings()
      Returns the object with the settings used for calls to readObject.
    • updateObjectSettings

      public com.google.api.gax.rpc.UnaryCallSettings<UpdateObjectRequest,Object> updateObjectSettings()
      Returns the object with the settings used for calls to updateObject.
    • writeObjectSettings

      public com.google.api.gax.rpc.StreamingCallSettings<WriteObjectRequest,WriteObjectResponse> writeObjectSettings()
      Returns the object with the settings used for calls to writeObject.
    • bidiWriteObjectSettings

      public com.google.api.gax.rpc.StreamingCallSettings<BidiWriteObjectRequest,BidiWriteObjectResponse> bidiWriteObjectSettings()
      Returns the object with the settings used for calls to bidiWriteObject.
    • listObjectsSettings

      public com.google.api.gax.rpc.PagedCallSettings<ListObjectsRequest,ListObjectsResponse,StorageClient.ListObjectsPagedResponse> listObjectsSettings()
      Returns the object with the settings used for calls to listObjects.
    • rewriteObjectSettings

      public com.google.api.gax.rpc.UnaryCallSettings<RewriteObjectRequest,RewriteResponse> rewriteObjectSettings()
      Returns the object with the settings used for calls to rewriteObject.
    • startResumableWriteSettings

      public com.google.api.gax.rpc.UnaryCallSettings<StartResumableWriteRequest,StartResumableWriteResponse> startResumableWriteSettings()
      Returns the object with the settings used for calls to startResumableWrite.
    • queryWriteStatusSettings

      public com.google.api.gax.rpc.UnaryCallSettings<QueryWriteStatusRequest,QueryWriteStatusResponse> queryWriteStatusSettings()
      Returns the object with the settings used for calls to queryWriteStatus.
    • moveObjectSettings

      public com.google.api.gax.rpc.UnaryCallSettings<MoveObjectRequest,Object> moveObjectSettings()
      Returns the object with the settings used for calls to moveObject.
    • create

      public static final StorageSettings create(StorageStubSettings stub) throws IOException
      Throws:
      IOException
    • defaultExecutorProviderBuilder

      public static com.google.api.gax.core.InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder()
      Returns a builder for the default ExecutorProvider for this service.
    • getDefaultEndpoint

      public static String getDefaultEndpoint()
      Returns the default service endpoint.
    • getDefaultServiceScopes

      public static List<String> getDefaultServiceScopes()
      Returns the default service scopes.
    • defaultCredentialsProviderBuilder

      public static com.google.api.gax.core.GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder()
      Returns a builder for the default credentials for this service.
    • defaultGrpcTransportProviderBuilder

      public static com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder()
      Returns a builder for the default ChannelProvider for this service.
    • defaultTransportChannelProvider

      public static com.google.api.gax.rpc.TransportChannelProvider defaultTransportChannelProvider()
    • defaultApiClientHeaderProviderBuilder

      public static com.google.api.gax.rpc.ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder()
    • newBuilder

      public static StorageSettings.Builder newBuilder()
      Returns a new builder for this class.
    • newBuilder

      public static StorageSettings.Builder newBuilder(com.google.api.gax.rpc.ClientContext clientContext)
      Returns a new builder for this class.
    • toBuilder

      public StorageSettings.Builder toBuilder()
      Returns a builder containing all the values of this settings class.
      Specified by:
      toBuilder in class com.google.api.gax.rpc.ClientSettings<StorageSettings>