Class S3Backend
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.blob.AbstractSharedBackend
-
- org.apache.jackrabbit.oak.blob.cloud.s3.S3Backend
-
- All Implemented Interfaces:
org.apache.jackrabbit.oak.spi.blob.SharedBackend
public class S3Backend extends org.apache.jackrabbit.oak.spi.blob.AbstractSharedBackend
A data store backend that stores data on Amazon S3.
-
-
Constructor Summary
Constructors Constructor Description S3Backend()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMetadataRecord(java.io.File input, java.lang.String name)
void
addMetadataRecord(java.io.InputStream input, java.lang.String name)
void
close()
void
deleteAllMetadataRecords(java.lang.String prefix)
boolean
deleteMetadataRecord(java.lang.String name)
void
deleteRecord(DataIdentifier identifier)
boolean
exists(DataIdentifier identifier)
Check if record identified by identifier exists in Amazon S3.java.util.Iterator<DataIdentifier>
getAllIdentifiers()
java.util.List<DataRecord>
getAllMetadataRecords(java.lang.String prefix)
java.util.Iterator<DataRecord>
getAllRecords()
java.lang.String
getBucket()
DataRecord
getMetadataRecord(java.lang.String name)
byte[]
getOrCreateReferenceKey()
DataRecord
getRecord(DataIdentifier identifier)
void
init()
boolean
metadataRecordExists(java.lang.String name)
java.io.InputStream
read(DataIdentifier identifier)
void
setBucket(java.lang.String bucket)
void
setProperties(java.util.Properties properties)
Properties used to configure the backend.void
write(DataIdentifier identifier, java.io.File file)
It uploads file to Amazon S3.
-
-
-
Method Detail
-
init
public void init() throws DataStoreException
- Throws:
DataStoreException
-
write
public void write(DataIdentifier identifier, java.io.File file) throws DataStoreException
It uploads file to Amazon S3. If file size is greater than 5MB, this method uses parallel concurrent connections to upload.- Throws:
DataStoreException
-
exists
public boolean exists(DataIdentifier identifier) throws DataStoreException
Check if record identified by identifier exists in Amazon S3.- Throws:
DataStoreException
-
read
public java.io.InputStream read(DataIdentifier identifier) throws DataStoreException
- Throws:
DataStoreException
-
getAllIdentifiers
public java.util.Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException
- Throws:
DataStoreException
-
deleteRecord
public void deleteRecord(DataIdentifier identifier) throws DataStoreException
- Throws:
DataStoreException
-
close
public void close()
-
getBucket
public java.lang.String getBucket()
-
setBucket
public void setBucket(java.lang.String bucket)
-
setProperties
public void setProperties(java.util.Properties properties)
Properties used to configure the backend. If provided explicitly before init is invoked then these take precedence- Parameters:
properties
- to configure S3Backend
-
addMetadataRecord
public void addMetadataRecord(java.io.InputStream input, java.lang.String name) throws DataStoreException
- Throws:
DataStoreException
-
addMetadataRecord
public void addMetadataRecord(java.io.File input, java.lang.String name) throws DataStoreException
- Throws:
DataStoreException
-
getMetadataRecord
public DataRecord getMetadataRecord(java.lang.String name)
-
getAllMetadataRecords
public java.util.List<DataRecord> getAllMetadataRecords(java.lang.String prefix)
-
deleteMetadataRecord
public boolean deleteMetadataRecord(java.lang.String name)
-
deleteAllMetadataRecords
public void deleteAllMetadataRecords(java.lang.String prefix)
-
getAllRecords
public java.util.Iterator<DataRecord> getAllRecords()
-
getRecord
public DataRecord getRecord(DataIdentifier identifier) throws DataStoreException
- Throws:
DataStoreException
-
getOrCreateReferenceKey
public byte[] getOrCreateReferenceKey() throws DataStoreException
- Overrides:
getOrCreateReferenceKey
in classorg.apache.jackrabbit.oak.spi.blob.AbstractSharedBackend
- Throws:
DataStoreException
-
metadataRecordExists
public boolean metadataRecordExists(java.lang.String name)
-
-