Package software.amazon.nio.spi.s3
Class S3ClientStore
- java.lang.Object
-
- software.amazon.nio.spi.s3.S3ClientStore
-
public class S3ClientStore extends java.lang.ObjectA Singleton cache of clients for buckets configured for the region of those buckets
-
-
Field Summary
Fields Modifier and Type Field Description protected software.amazon.awssdk.services.s3.S3CrtAsyncClientBuilderasyncClientBuilderDefault S3CrtAsyncClientBuilderstatic software.amazon.awssdk.services.s3.S3AsyncClientDEFAULT_ASYNC_CLIENTDefault asynchronous client using the "https://s3.us-east-1.amazonaws.com" endpointstatic software.amazon.awssdk.services.s3.S3ClientDEFAULT_CLIENTDefault client using the "https://s3.us-east-1.amazonaws.com" endpoint
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected software.amazon.awssdk.services.s3.S3AsyncClientgenerateAsyncClient(java.lang.String bucketName)Generate an asynchronous client for the named bucket using a default client to determine the location of the named bucketprotected software.amazon.awssdk.services.s3.S3AsyncClientgenerateAsyncClient(java.lang.String bucketName, software.amazon.awssdk.services.s3.S3Client locationClient)Generate an asynchronous client for the named bucket using a default client to determine the location of the named clientprotected software.amazon.awssdk.services.s3.S3ClientgenerateClient(java.lang.String bucketName)Generate a client for the named bucket using a default client to determine the location of the named bucketprotected software.amazon.awssdk.services.s3.S3ClientgenerateClient(java.lang.String bucketName, software.amazon.awssdk.services.s3.S3Client locationClient)Generate a client for the named bucket using a default client to determine the location of the named clientsoftware.amazon.awssdk.services.s3.S3AsyncClientgetAsyncClientForBucketName(java.lang.String bucketName)Get an existing async client or generate a new client for the named bucket if one doesn't existsoftware.amazon.awssdk.services.s3.S3ClientgetClientForBucketName(java.lang.String bucketName)Get an existing client or generate a new client for the named bucket if one doesn't existstatic S3ClientStoregetInstance()Get the ClientStore instance
-
-
-
Field Detail
-
asyncClientBuilder
protected software.amazon.awssdk.services.s3.S3CrtAsyncClientBuilder asyncClientBuilder
Default S3CrtAsyncClientBuilder
-
DEFAULT_CLIENT
public static final software.amazon.awssdk.services.s3.S3Client DEFAULT_CLIENT
Default client using the "https://s3.us-east-1.amazonaws.com" endpoint
-
DEFAULT_ASYNC_CLIENT
public static final software.amazon.awssdk.services.s3.S3AsyncClient DEFAULT_ASYNC_CLIENT
Default asynchronous client using the "https://s3.us-east-1.amazonaws.com" endpoint
-
-
Method Detail
-
getInstance
public static S3ClientStore getInstance()
Get the ClientStore instance- Returns:
- a singleton
-
getClientForBucketName
public software.amazon.awssdk.services.s3.S3Client getClientForBucketName(java.lang.String bucketName)
Get an existing client or generate a new client for the named bucket if one doesn't exist- Parameters:
bucketName- the bucket name. If this value is null or empty a default client is returned- Returns:
- a client
-
getAsyncClientForBucketName
public software.amazon.awssdk.services.s3.S3AsyncClient getAsyncClientForBucketName(java.lang.String bucketName)
Get an existing async client or generate a new client for the named bucket if one doesn't exist- Parameters:
bucketName- the bucket name. If this value is null or empty a default client is returned- Returns:
- a client
-
generateClient
protected software.amazon.awssdk.services.s3.S3Client generateClient(java.lang.String bucketName)
Generate a client for the named bucket using a default client to determine the location of the named bucket- Parameters:
bucketName- the named of the bucket to make the client for- Returns:
- an S3 client appropriate for the region of the named bucket
-
generateAsyncClient
protected software.amazon.awssdk.services.s3.S3AsyncClient generateAsyncClient(java.lang.String bucketName)
Generate an asynchronous client for the named bucket using a default client to determine the location of the named bucket- Parameters:
bucketName- the named of the bucket to make the client for- Returns:
- an asynchronous S3 client appropriate for the region of the named bucket
-
generateClient
protected software.amazon.awssdk.services.s3.S3Client generateClient(java.lang.String bucketName, software.amazon.awssdk.services.s3.S3Client locationClient)Generate a client for the named bucket using a default client to determine the location of the named client- Parameters:
bucketName- the named of the bucket to make the client forlocationClient- the client used to determine the location of the named bucket, recommend using DEFAULT_CLIENT- Returns:
- an S3 client appropriate for the region of the named bucket
-
generateAsyncClient
protected software.amazon.awssdk.services.s3.S3AsyncClient generateAsyncClient(java.lang.String bucketName, software.amazon.awssdk.services.s3.S3Client locationClient)Generate an asynchronous client for the named bucket using a default client to determine the location of the named client- Parameters:
bucketName- the named of the bucket to make the client forlocationClient- the client used to determine the location of the named bucket, recommend using DEFAULT_CLIENT- Returns:
- an S3 client appropriate for the region of the named bucket
-
-