Class AESBlobStore
- All Implemented Interfaces:
BlobStore
- Since:
- 11.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInput stream that decrypts while reading.static classOutput stream that encrypts while writing.Nested classes/interfaces inherited from class org.nuxeo.ecm.core.blob.LocalBlobStore
LocalBlobStore.LocalBlobGarbageCollectorNested classes/interfaces inherited from interface org.nuxeo.ecm.core.blob.BlobStore
BlobStore.OptionalOrUnknown<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AESBlobStoreConfigurationprotected static final byte[]protected static final intprotected static final Randomprotected static final intprotected static final intFields inherited from class org.nuxeo.ecm.core.blob.LocalBlobStore
gc, pathStrategyFields inherited from class org.nuxeo.ecm.core.blob.AbstractBlobStore
blobProviderId, BYTE_RANGE_SEP, keyStrategy, name -
Constructor Summary
ConstructorsConstructorDescriptionAESBlobStore(String name, KeyStrategy keyStrategy, PathStrategy pathStrategy, AESBlobStoreConfiguration aesConfig) -
Method Summary
Modifier and TypeMethodDescriptionbooleancopyBlobIsOptimized(BlobStore sourceStore) Checks if blob copy/move from another blob store to this one can be done efficiently.copyOrMoveBlob(String key, BlobStore sourceStore, String sourceKey, boolean atomicMove) Writes a file based on a key, as an optimized copy/move from a source in another compatible blob store.Gets an already-existing file containing the blob for the given key, if present.Gets the stream of the blob for the given key, if present.booleanReads a blob based on its key into the given file.protected voidwrite(BlobWriteContext blobWriteContext, Path file) Methods inherited from class org.nuxeo.ecm.core.blob.LocalBlobStore
clear, copyBlob, copyBlobGeneric, deleteBlob, exists, getBinaryGarbageCollector, getDirectory, getPathStrategy, getStoredFile, writeBlobGenericMethods inherited from class org.nuxeo.ecm.core.blob.AbstractBlobStore
deleteBlob, getBlobKeyReplacement, getByteRangeFromKey, getKeyStrategy, getName, hasVersioning, logTrace, logTrace, logTrace, notifyAsyncDigest, randomLong, randomString, setByteRangeInKey, stripBlobKeyPrefix, stripBlobKeyVersionSuffix, transfer, transfer, transfer, unwrap, useAsyncDigest, writeBlob, writeBlob, writeBlobProperties, writeBlobUsingOptimizedCopyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.ecm.core.blob.BlobStore
copyBlob, hasDefaultStorageClass
-
Field Details
-
FILE_MAGIC
protected static final byte[] FILE_MAGIC -
FILE_VERSION_1
protected static final int FILE_VERSION_1- See Also:
-
USE_KEYSTORE
protected static final int USE_KEYSTORE- See Also:
-
USE_PBKDF2
protected static final int USE_PBKDF2- See Also:
-
RANDOM
-
aesConfig
-
-
Constructor Details
-
AESBlobStore
public AESBlobStore(String name, KeyStrategy keyStrategy, PathStrategy pathStrategy, AESBlobStoreConfiguration aesConfig)
-
-
Method Details
-
write
- Overrides:
writein classLocalBlobStore- Throws:
IOException
-
getFile
Description copied from interface:BlobStoreGets an already-existing file containing the blob for the given key, if present.Note that this method is best-effort, it may return unknown even though the blob exists in the store, it's just that it's not handily available locally in a file.
- Specified by:
getFilein interfaceBlobStore- Overrides:
getFilein classLocalBlobStore- Parameters:
key- the blob key- Returns:
- the file containing the blob, or empty if the blob cannot be found, or unknown if no file is available locally
-
getStream
Description copied from interface:BlobStoreGets the stream of the blob for the given key, if present.Note that this method is best-effort, it may return unknown even though the blob exists in the store, it's just that it's not efficient to return it as a stream.
- Specified by:
getStreamin interfaceBlobStore- Overrides:
getStreamin classLocalBlobStore- Parameters:
key- the blob key- Returns:
- the blob stream, or empty if the blob cannot be found, or unknown if no stream is efficiently available
- Throws:
IOException
-
readBlob
Description copied from interface:BlobStoreReads a blob based on its key into the given file.- Specified by:
readBlobin interfaceBlobStore- Overrides:
readBlobin classLocalBlobStore- Parameters:
key- the blob keydest- the file to use to store the fetched data- Returns:
trueif the file was fetched,falseif the file was not found- Throws:
IOException
-
copyBlobIsOptimized
Description copied from interface:BlobStoreChecks if blob copy/move from another blob store to this one can be done efficiently.- Specified by:
copyBlobIsOptimizedin interfaceBlobStore- Overrides:
copyBlobIsOptimizedin classLocalBlobStore- Parameters:
sourceStore- the source store- Returns:
trueif the copy/move can be done efficiently
-
copyOrMoveBlob
public String copyOrMoveBlob(String key, BlobStore sourceStore, String sourceKey, boolean atomicMove) throws IOException Description copied from interface:BlobStoreWrites a file based on a key, as an optimized copy/move from a source in another compatible blob store.The target
keymay benull, which is a signal from the caller that it has determined that deduplication is enabled and async digest computation is enabled, but the needed digest hasn't been computed, so this method should either find the digest in an efficient way if it can, or otherwise trigger an async digest computation.If the copy/move is requested to be atomic, then the destination file is created atomically. In case of atomic move, in some stores the destination will be created atomically but the source will only be deleted afterwards.
The returned key may be different than the passed one when versioning is used.
- Specified by:
copyOrMoveBlobin interfaceBlobStore- Overrides:
copyOrMoveBlobin classLocalBlobStore- Parameters:
key- the key; ornullif the store should choose it or trigger async digest computationsourceStore- the source storesourceKey- the source keyatomicMove-truefor an atomic move,falsefor a regular copy- Returns:
- the key of the copied/moved file, or
nullif copy/move failed - Throws:
IOException
-