public class S3ConfigurationSource
extends java.lang.Object
implements com.netflix.config.PolledConfigurationSource
Properties.load(InputStream) - just like
URLConfigurationSource.
Poll requests throw exceptions in line with
AmazonS3.getObject(GetObjectRequest) and
Properties.load(InputStream) for the obvious reasons
(file not found, bad credentials, no network connection, malformed file...)| Constructor and Description |
|---|
S3ConfigurationSource(com.amazonaws.services.s3.AmazonS3 client,
java.lang.String bucketName,
java.lang.String key)
Create the instance with the provided
AmazonS3,
bucket and key. |
S3ConfigurationSource(com.amazonaws.auth.AWSCredentialsProvider credentialsProvider,
java.lang.String bucketName,
java.lang.String key)
Create the instance with the specified credentials, bucket and key.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
inputStreamToMap(java.io.InputStream is) |
com.netflix.config.PollResult |
poll(boolean initial,
java.lang.Object checkPoint) |
public S3ConfigurationSource(com.amazonaws.auth.AWSCredentialsProvider credentialsProvider,
java.lang.String bucketName,
java.lang.String key)
AmazonS3Client.credentialsProvider - bucketName - The S3 bucket containing the configuration file.key - The key of the file within that bucket.public S3ConfigurationSource(com.amazonaws.services.s3.AmazonS3 client,
java.lang.String bucketName,
java.lang.String key)
AmazonS3,
bucket and key. Suitable for injecting a custom client for testing,
messing around with endpoints etc.client - to be used to retrieve the object.bucketName - The S3 bucket containing the configuration file.key - The key of the file within that bucket.public com.netflix.config.PollResult poll(boolean initial,
java.lang.Object checkPoint)
throws java.io.IOException,
com.amazonaws.AmazonServiceException
poll in interface com.netflix.config.PolledConfigurationSourcejava.io.IOExceptioncom.amazonaws.AmazonServiceExceptionprotected java.util.Map<java.lang.String,java.lang.Object> inputStreamToMap(java.io.InputStream is)
throws java.io.IOException
java.io.IOException