public class S3BinaryManager extends BinaryCachingManager
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 |
AbstractBinaryManager.NullBinaryScrambler
A
BinaryScrambler that does nothing. |
static class |
AbstractBinaryManager.ScrambledBinary
A
Binary that is unscrambled on read using a
BinaryScrambler . |
static class |
AbstractBinaryManager.ScrambledFileInputStream
A
FileInputStream that is unscrambled on read using a
BinaryScrambler . |
static class |
AbstractBinaryManager.ScrambledStreamSource
A
FileSource that is unscrambled on read using a
BinaryScrambler . |
class |
S3BinaryManager.S3BinaryFileCache |
static class |
S3BinaryManager.S3BinaryGarbageCollector
Garbage collector for S3 binaries that stores the marked (in use)
binaries in memory.
|
Modifier and Type | Field and Description |
---|---|
static String |
AWS_ID_ENV_KEY |
static String |
AWS_ID_KEY |
static String |
AWS_SECRET_ENV_KEY |
static String |
AWS_SECRET_KEY |
static String |
BUCKET_NAME_KEY |
static String |
BUCKET_REGION_KEY |
static String |
CACHE_SIZE_KEY |
static String |
DEFAULT_BUCKET_REGION |
static String |
DEFAULT_CACHE_SIZE |
static int |
DEFAULT_DEPTH |
static String |
DEFAULT_DIGEST |
static String |
KEYSTORE_FILE_KEY |
static String |
KEYSTORE_PASS_KEY |
static int |
MAX_BUF_SIZE |
static int |
MIN_BUF_SIZE |
static String |
PRIVKEY_ALIAS_KEY |
static String |
PRIVKEY_PASS_KEY |
static String |
PROXY_HOST_KEY |
static String |
PROXY_LOGIN_KEY |
static String |
PROXY_PASSWORD_KEY |
static String |
PROXY_PORT_KEY |
Constructor and Description |
---|
S3BinaryManager() |
Modifier and Type | Method and Description |
---|---|
BinaryFileCache |
fileCache() |
Binary |
getBinary(InputStream in)
Saves the given input stream into a
Binary . |
BinaryGarbageCollector |
getGarbageCollector()
Returns the Binary Garbage Collector that can be used for this binary
manager.
|
void |
initialize(RepositoryDescriptor repositoryDescriptor)
Initializer.
|
static boolean |
isMD5(String digest) |
static String |
toHexString(byte[] data) |
getBinary
public static final String BUCKET_NAME_KEY
public static final String BUCKET_REGION_KEY
public static final String DEFAULT_BUCKET_REGION
public static final String AWS_ID_KEY
public static final String AWS_ID_ENV_KEY
public static final String AWS_SECRET_KEY
public static final String AWS_SECRET_ENV_KEY
public static final String CACHE_SIZE_KEY
public static final String DEFAULT_CACHE_SIZE
public static final String KEYSTORE_FILE_KEY
public static final String KEYSTORE_PASS_KEY
public static final String PRIVKEY_ALIAS_KEY
public static final String PRIVKEY_PASS_KEY
public static final String PROXY_HOST_KEY
public static final String PROXY_PORT_KEY
public static final String PROXY_LOGIN_KEY
public static final String PROXY_PASSWORD_KEY
public static final String DEFAULT_DIGEST
public static final int DEFAULT_DEPTH
public static final int MIN_BUF_SIZE
public static final int MAX_BUF_SIZE
public void initialize(RepositoryDescriptor repositoryDescriptor) throws IOException
BinaryManager
initialize
in interface BinaryManager
IOException
public Binary getBinary(InputStream in) throws IOException
BinaryManager
Binary
.
Returns a Binary
representing the stream. The Binary
includes a digest that is a sufficient representation to persist it.
The stream is closed after use.
getBinary
in interface BinaryManager
in
- the input streamIOException
public static boolean isMD5(String digest)
public BinaryFileCache fileCache()
fileCache
in class BinaryCachingManager
public static String toHexString(byte[] data)
public BinaryGarbageCollector getGarbageCollector()
BinaryManager
Several calls to this method will return the same GC, so that its status
can be monitored using BinaryGarbageCollector.isInProgress()
.
getGarbageCollector
in interface BinaryManager
Copyright © 2013 Nuxeo SA. All Rights Reserved.