public class S3BinaryManager extends AbstractCloudBinaryManager
The BLOBs are cached locally on first access for efficiency.
Because the BLOB length can be accessed independently of the binary stream, it is also cached in a simple text file if accessed before the stream.
Modifier and Type | Class and Description |
---|---|
static class |
S3BinaryManager.S3BinaryGarbageCollector
Garbage collector for S3 binaries that stores the marked (in use) binaries in memory.
|
class |
S3BinaryManager.S3FileStorage |
Modifier and Type | Field and Description |
---|---|
protected com.amazonaws.services.s3.AmazonS3 |
amazonS3 |
static String |
AWS_ID_ENV |
static String |
AWS_ID_PROPERTY |
static String |
AWS_SECRET_ENV |
static String |
AWS_SECRET_PROPERTY |
protected com.amazonaws.auth.AWSCredentialsProvider |
awsCredentialsProvider |
static String |
BUCKET_NAME_PROPERTY |
static String |
BUCKET_PREFIX_PROPERTY |
static String |
BUCKET_REGION_PROPERTY |
protected String |
bucketName |
protected String |
bucketNamePrefix |
protected com.amazonaws.ClientConfiguration |
clientConfiguration |
static String |
CONNECTION_MAX_PROPERTY
AWS ClientConfiguration default 50
|
static String |
CONNECTION_RETRY_PROPERTY
AWS ClientConfiguration default 3 (with exponential backoff)
|
static String |
CONNECTION_TIMEOUT_PROPERTY
AWS ClientConfiguration default 50*1000 = 50s
|
protected com.amazonaws.services.s3.model.CryptoConfiguration |
cryptoConfiguration |
static String |
DEFAULT_BUCKET_REGION |
static String |
DIRECTDOWNLOAD_EXPIRE_PROPERTY_COMPAT |
static String |
DIRECTDOWNLOAD_PROPERTY_COMPAT |
protected com.amazonaws.services.s3.model.EncryptionMaterials |
encryptionMaterials |
static String |
ENDPOINT_PROPERTY |
protected boolean |
isEncrypted |
static String |
KEYSTORE_FILE_PROPERTY |
static String |
KEYSTORE_PASS_PROPERTY |
static String |
PRIVKEY_ALIAS_PROPERTY |
static String |
PRIVKEY_PASS_PROPERTY |
static String |
SERVERSIDE_ENCRYPTION_PROPERTY |
static String |
SOCKET_TIMEOUT_PROPERTY
AWS ClientConfiguration default 50*1000 = 50s
|
static String |
SYSTEM_PROPERTY_PREFIX |
protected com.amazonaws.services.s3.transfer.TransferManager |
transferManager |
protected boolean |
userServerSideEncryption |
CACHE_COUNT_PROPERTY, CACHE_MIN_AGE_PROPERTY, CACHE_SIZE_PROPERTY, DEFAULT_CACHE_COUNT, DEFAULT_CACHE_MIN_AGE, DEFAULT_CACHE_SIZE, DEFAULT_DIRECTDOWNLOAD, DEFAULT_DIRECTDOWNLOAD_EXPIRE, directDownload, DIRECTDOWNLOAD_EXPIRE_PROPERTY, DIRECTDOWNLOAD_PROPERTY, directDownloadExpire, properties
cachedir, fileCache, fileStorage
blobProviderId, DEFAULT_DEPTH, DEFAULT_DIGEST, descriptor, DIGESTS_BY_LENGTH, garbageCollector, MAX_BUF_SIZE, MD5_DIGEST, MD5_DIGEST_LENGTH, MIN_BUF_SIZE, SHA1_DIGEST, SHA1_DIGEST_LENGTH, SHA256_DIGEST, SHA256_DIGEST_LENGTH
PROP_KEY, PROP_PATH
Constructor and Description |
---|
S3BinaryManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
abortOldUploads()
Aborts uploads that crashed and are older than 1 day.
|
void |
close()
Closes the binary manager and releases all resources and temporary objects held by it.
|
protected String |
getDefaultDigestAlgorithm()
Gets the default message digest to use to hash binaries.
|
protected FileStorage |
getFileStorage() |
protected URI |
getRemoteUri(String digest,
ManagedBlob blob,
javax.servlet.http.HttpServletRequest servletRequest) |
protected String |
getSystemPropertyPrefix()
Gets the prefix used for configuration using system properties.
|
protected BinaryGarbageCollector |
instantiateGarbageCollector() |
static boolean |
isMD5(String digest) |
protected static boolean |
isMissingKey(com.amazonaws.AmazonClientException e) |
void |
removeBinaries(Collection<String> digests)
Remove definitively a set of binaries
|
protected void |
removeBinary(String digest) |
protected void |
setupCloudClient()
Configure Cloud client using properties
|
getBinaryManager, getContentDispositionHeader, getContentTypeHeader, getIntProperty, getProperty, getProperty, getSystemPropertyName, getURI, initialize, isDirectDownload, performsExternalAccessControl, readBlob, supportsUserUpdate, supportsUserUpdateDefaultTrue, writeBlob
getBinary, getBinary, getFile, initializeCache, initializeCache, initializeCache
getBinary, getDescriptor, getDigestAlgorithm, getGarbageCollector, storeAndDigest, toHexString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAppLinks, getAvailableConversions, getStream, getThumbnail, isVersion
public static final String SYSTEM_PROPERTY_PREFIX
public static final String BUCKET_NAME_PROPERTY
public static final String BUCKET_PREFIX_PROPERTY
public static final String BUCKET_REGION_PROPERTY
public static final String DEFAULT_BUCKET_REGION
public static final String AWS_ID_PROPERTY
public static final String AWS_ID_ENV
public static final String AWS_SECRET_PROPERTY
public static final String AWS_SECRET_ENV
public static final String CONNECTION_MAX_PROPERTY
public static final String CONNECTION_RETRY_PROPERTY
public static final String CONNECTION_TIMEOUT_PROPERTY
public static final String SOCKET_TIMEOUT_PROPERTY
public static final String KEYSTORE_FILE_PROPERTY
public static final String KEYSTORE_PASS_PROPERTY
public static final String SERVERSIDE_ENCRYPTION_PROPERTY
public static final String PRIVKEY_ALIAS_PROPERTY
public static final String PRIVKEY_PASS_PROPERTY
public static final String ENDPOINT_PROPERTY
public static final String DIRECTDOWNLOAD_PROPERTY_COMPAT
public static final String DIRECTDOWNLOAD_EXPIRE_PROPERTY_COMPAT
protected String bucketName
protected String bucketNamePrefix
protected com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider
protected com.amazonaws.ClientConfiguration clientConfiguration
protected com.amazonaws.services.s3.model.EncryptionMaterials encryptionMaterials
protected boolean isEncrypted
protected com.amazonaws.services.s3.model.CryptoConfiguration cryptoConfiguration
protected boolean userServerSideEncryption
protected com.amazonaws.services.s3.AmazonS3 amazonS3
protected com.amazonaws.services.s3.transfer.TransferManager transferManager
public S3BinaryManager()
protected String getDefaultDigestAlgorithm()
AbstractBinaryManager
getDefaultDigestAlgorithm
in class AbstractBinaryManager
public void close()
BinaryManager
close
in interface BinaryManager
close
in interface BlobProvider
close
in class CachingBinaryManager
protected void abortOldUploads() throws IOException
IOException
protected void setupCloudClient() throws IOException
AbstractCloudBinaryManager
setupCloudClient
in class AbstractCloudBinaryManager
IOException
protected void removeBinary(String digest)
protected String getSystemPropertyPrefix()
AbstractCloudBinaryManager
getSystemPropertyPrefix
in class AbstractCloudBinaryManager
protected BinaryGarbageCollector instantiateGarbageCollector()
instantiateGarbageCollector
in class AbstractCloudBinaryManager
public void removeBinaries(Collection<String> digests)
BinaryManager
removeBinaries
in interface BinaryManager
removeBinaries
in class AbstractCloudBinaryManager
digests
- a set of digests, must not be null
.protected static boolean isMissingKey(com.amazonaws.AmazonClientException e)
protected FileStorage getFileStorage()
getFileStorage
in class AbstractCloudBinaryManager
protected URI getRemoteUri(String digest, ManagedBlob blob, javax.servlet.http.HttpServletRequest servletRequest) throws IOException
getRemoteUri
in class AbstractCloudBinaryManager
IOException
Copyright © 2017 Nuxeo. All rights reserved.