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
-
-
-
Method Detail
-
init
public void init() throws DataStoreException
- Throws:
DataStoreException
-
write
public void write(DataIdentifier identifier, 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 InputStream read(DataIdentifier identifier) throws DataStoreException
- Throws:
DataStoreException
-
getAllIdentifiers
public Iterator<DataIdentifier> getAllIdentifiers() throws DataStoreException
- Throws:
DataStoreException
-
deleteRecord
public void deleteRecord(DataIdentifier identifier) throws DataStoreException
- Throws:
DataStoreException
-
close
public void close()
-
getBucket
public String getBucket()
-
setBucket
public void setBucket(String bucket)
-
setProperties
public void setProperties(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(InputStream input, String name) throws DataStoreException
- Throws:
DataStoreException
-
addMetadataRecord
public void addMetadataRecord(File input, String name) throws DataStoreException
- Throws:
DataStoreException
-
getMetadataRecord
public DataRecord getMetadataRecord(String name)
-
getAllMetadataRecords
public List<DataRecord> getAllMetadataRecords(String prefix)
-
deleteMetadataRecord
public boolean deleteMetadataRecord(String name)
-
deleteAllMetadataRecords
public void deleteAllMetadataRecords(String prefix)
-
getAllRecords
public 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(String name)
-
-