Class AmazonS3FileSink
java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.amazons3.AmazonS3File
com.northconcepts.datapipeline.amazons3.AmazonS3FileSink
- All Implemented Interfaces:
DataExceptionContributor,JsonSerializable,RecordSerializable,XmlSerializable,FileSink,Serializable
A
FileSink that writes an Amazon S3 object with a multipart upload through an AmazonS3FileSystem,
connecting on demand if the file system is not open. The upload completes when the output stream is closed.- See Also:
-
Field Summary
Fields inherited from class com.northconcepts.datapipeline.amazons3.AmazonS3File
amazonS3FileSystem, bucketName, pathFields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromRecord(Record source) Loads this instance's state from a record and returnsthis(for fluid API call chaining).fromXmlElement(Element localFileSinkElement) Opens a new stream to write the file's content; the caller must close it.booleanisAppend()Indicates ifFileSink.getOutputStream()appends to an existing file instead of replacing it.setAmazonS3FileSystem(AmazonS3FileSystem amazonS3FileSystem) setBasicAWSCredentials(String accessKey, String secretKey) Authenticates this file'sAmazonS3FileSystemwith the given access key and secret key, replacing its credentials provider, unless aCredentialsResolveris set, which takes precedence.setBucketName(String bucketName) setCredentialsProvider(AwsCredentialsProvider credentialsProvider) Sets the AWS SDK credentials provider that this file'sAmazonS3FileSystemuses when noCredentialsResolveris set.setCredentialsResolver(CredentialsResolver credentialsResolver) Sets the backend-neutral resolver supplying this file's credentials — resolved on each connection, so rotated secrets are picked up automatically.Sets the key of this file's object within its bucket.toRecord()Converts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.toXmlElement(Document document) Returns an element, created withdocument, describing this object; the default implementation throws aDataException.useProfileCredentialsProvider(String profileName) Authenticates this file'sAmazonS3FileSystemusing the named profile from the AWS profile files, unless aCredentialsResolveris set, which takes precedence.Methods inherited from class com.northconcepts.datapipeline.amazons3.AmazonS3File
assertValid, clearFileSize, getAmazonS3FileSystem, getBucketName, getContentType, getCredentialsProvider, getCredentialsResolver, getFileSize, getFileType, getName, getPath, getUrlPath, isDebug, isLocal, refreshFileSize, retainFileSize, setDebugMethods inherited from class com.northconcepts.datapipeline.foundations.core.Bean
addExceptionProperties, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionProperties, exception, exception, exceptionMethods inherited from interface com.northconcepts.datapipeline.foundations.file.FileSink
getContentType, getFileSize, getFileType, getName, getPath, getUrlPath, isLocal
-
Constructor Details
-
AmazonS3FileSink
public AmazonS3FileSink()
-
-
Method Details
-
getOutputStream
Description copied from interface:FileSinkOpens a new stream to write the file's content; the caller must close it.- Specified by:
getOutputStreamin interfaceFileSink
-
setName
- Overrides:
setNamein classAmazonS3File
-
setPath
Description copied from class:AmazonS3FileSets the key of this file's object within its bucket.- Overrides:
setPathin classAmazonS3File
-
setBucketName
- Overrides:
setBucketNamein classAmazonS3File
-
setAmazonS3FileSystem
- Overrides:
setAmazonS3FileSystemin classAmazonS3File
-
setCredentialsProvider
Description copied from class:AmazonS3FileSets the AWS SDK credentials provider that this file'sAmazonS3FileSystemuses when noCredentialsResolveris set.- Overrides:
setCredentialsProviderin classAmazonS3File
-
setCredentialsResolver
Description copied from class:AmazonS3FileSets the backend-neutral resolver supplying this file's credentials — resolved on each connection, so rotated secrets are picked up automatically. Takes precedence overAmazonS3File.setCredentialsProvider(AwsCredentialsProvider)and the default provider chain.- Overrides:
setCredentialsResolverin classAmazonS3File
-
useProfileCredentialsProvider
Description copied from class:AmazonS3FileAuthenticates this file'sAmazonS3FileSystemusing the named profile from the AWS profile files, unless aCredentialsResolveris set, which takes precedence.- Overrides:
useProfileCredentialsProviderin classAmazonS3File
-
setBasicAWSCredentials
Description copied from class:AmazonS3FileAuthenticates this file'sAmazonS3FileSystemwith the given access key and secret key, replacing its credentials provider, unless aCredentialsResolveris set, which takes precedence.- Overrides:
setBasicAWSCredentialsin classAmazonS3File
-
isAppend
public boolean isAppend()Description copied from interface:FileSinkIndicates ifFileSink.getOutputStream()appends to an existing file instead of replacing it. -
toRecord
Description copied from interface:RecordSerializableConverts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.- Specified by:
toRecordin interfaceRecordSerializable- Overrides:
toRecordin classAmazonS3File
-
fromRecord
Description copied from interface:RecordSerializableLoads this instance's state from a record and returnsthis(for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.- Specified by:
fromRecordin interfaceFileSink- Specified by:
fromRecordin interfaceRecordSerializable- Overrides:
fromRecordin classAmazonS3File- Parameters:
source-- Returns:
- this instance.
-
toXmlElement
Description copied from interface:XmlSerializableReturns an element, created withdocument, describing this object; the default implementation throws aDataException.- Specified by:
toXmlElementin interfaceXmlSerializable- Overrides:
toXmlElementin classAmazonS3File
-
fromXmlElement
- Specified by:
fromXmlElementin interfaceXmlSerializable- Overrides:
fromXmlElementin classAmazonS3File
-