Class GridFSBinaryManager
- All Implemented Interfaces:
BinaryManager,BlobProvider
BinaryManager and BlobProvider interface using MongoDB GridFS.
This implementation does not use local caching.
This implementation may not always be ideal regarding streaming because of the usage of Binary interface that
exposes a File.
- Since:
- 7.10
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classDeprecated.A binary backed by GridFS.classDeprecated. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.Prefix used to retrieve a MongoDB connection fromMongoDBConnectionService.protected StringDeprecated.static final StringDeprecated.protected com.mongodb.client.MongoCollection<org.bson.Document> Deprecated.protected com.mongodb.client.gridfs.GridFSBucketDeprecated.Fields inherited from class org.nuxeo.ecm.core.blob.binary.AbstractBinaryManager
blobProviderId, DEFAULT_DEPTH, DEFAULT_DIGEST, descriptor, digestPattern, DIGESTS_BY_LENGTH, garbageCollector, MAX_BUF_SIZE, MD5_DIGEST, MD5_DIGEST_LENGTH, MIN_BUF_SIZE, properties, SHA1_DIGEST, SHA1_DIGEST_LENGTH, SHA256_DIGEST, SHA256_DIGEST_LENGTHFields inherited from interface org.nuxeo.ecm.core.blob.binary.BinaryManager
PROP_KEY, PROP_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deprecated.Closes this blob provider and releases resources that may be held by it.protected BinarygetBinary(InputStream in) Deprecated.Creates a binary value from the given input stream.Deprecated.Returns aBinarycorresponding to the given digest.Deprecated.Saves the given blob into aBinary.Deprecated.Gets the associated binary manager, if any.protected com.mongodb.client.MongoCollection<org.bson.Document> Deprecated.protected com.mongodb.client.gridfs.GridFSBucketDeprecated.Deprecated.Returns the properties of the blob provider.voidinitialize(String blobProviderId, Map<String, String> properties) Deprecated.Initializes the binary manager.booleanDeprecated.Checks whether this blob provider is transient: blobs may disappear after a while, so a caller should not rely on them being available forever.Deprecated.Reads aBlobfrom storage.booleanDeprecated.Checks if user update is supported.Deprecated.Writes aBlobto storage and returns information about it.Methods inherited from class org.nuxeo.ecm.core.blob.binary.AbstractBinaryManager
computeDigestPattern, getDefaultDigestAlgorithm, getDescriptor, getDigestAlgorithm, getGarbageCollector, isValidDigest, removeBinaries, setDescriptor, storeAndDigest, toHexStringMethods 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.BlobProvider
allowByteRange, allowDirectDownload, canConvert, deleteBlob, getAppLinks, getAvailableConversions, getBinaryGarbageCollector, getFile, getStatus, getStream, getStream, getThumbnail, getURI, hasCreateFromKeyPermission, isColdStorageMode, isRecordMode, isTransactional, isVersion, performsExternalAccessControl, readBlob, supportsSync, updateBlob, writeBlob
-
Field Details
-
BLOB_PROVIDER_CONNECTION_PREFIX
Deprecated.Prefix used to retrieve a MongoDB connection fromMongoDBConnectionService.The connection id will be
blobProvider/[BLOB_PROVIDER_ID].- See Also:
-
BUCKET_PROPERTY
Deprecated.- See Also:
-
gridFSBucket
protected com.mongodb.client.gridfs.GridFSBucket gridFSBucketDeprecated. -
filesColl
protected com.mongodb.client.MongoCollection<org.bson.Document> filesCollDeprecated. -
bucket
Deprecated.
-
-
Constructor Details
-
GridFSBinaryManager
public GridFSBinaryManager()Deprecated.
-
-
Method Details
-
initialize
Deprecated.Description copied from interface:BinaryManagerInitializes the binary manager.- Specified by:
initializein interfaceBinaryManager- Specified by:
initializein interfaceBlobProvider- Overrides:
initializein classAbstractBinaryManager- Parameters:
blobProviderId- the blob provider id for this binary managerproperties- initialization properties- Throws:
IOException
-
close
public void close()Deprecated.Description copied from interface:BlobProviderCloses this blob provider and releases resources that may be held by it.- Specified by:
closein interfaceBinaryManager- Specified by:
closein interfaceBlobProvider
-
getBinaryManager
Deprecated.Description copied from interface:BlobProviderGets the associated binary manager, if any.- Specified by:
getBinaryManagerin interfaceBlobProvider- Returns:
- the binary manager, or
null
-
getGridFSBucket
protected com.mongodb.client.gridfs.GridFSBucket getGridFSBucket()Deprecated. -
getFilesColl
protected com.mongodb.client.MongoCollection<org.bson.Document> getFilesColl()Deprecated. -
getBinary
Deprecated.Description copied from interface:BinaryManagerSaves the given blob into aBinary.Returns a
Binaryrepresenting the stream. TheBinaryincludes a digest that is a sufficient representation to persist it.If the blob is a temporary
FileBlob, then the temporary file may be reused as the final storage location after being moved.- Specified by:
getBinaryin interfaceBinaryManager- Overrides:
getBinaryin classAbstractBinaryManager- Parameters:
blob- the blob- Returns:
- the corresponding binary
- Throws:
IOException
-
getBinary
Deprecated.Description copied from class:AbstractBinaryManagerCreates a binary value from the given input stream.- Specified by:
getBinaryin classAbstractBinaryManager- Throws:
IOException
-
getBinary
Deprecated.Description copied from interface:BinaryManagerReturns aBinarycorresponding to the given digest.A
nullis returned if the digest could not be found.- Specified by:
getBinaryin interfaceBinaryManager- Specified by:
getBinaryin classAbstractBinaryManager- Parameters:
digest- the digest, ornull- Returns:
- the corresponding binary
-
readBlob
Deprecated.Description copied from interface:BlobProviderReads aBlobfrom storage.- Specified by:
readBlobin interfaceBlobProvider- Parameters:
blobInfo- the blob information- Returns:
- the blob
- Throws:
IOException
-
writeBlob
Deprecated.Description copied from interface:BlobProviderWrites aBlobto storage and returns information about it.Called to store a user-created blob.
- Specified by:
writeBlobin interfaceBlobProvider- Parameters:
blob- the blob- Returns:
- the blob key
- Throws:
IOException
-
supportsUserUpdate
public boolean supportsUserUpdate()Deprecated.Description copied from interface:BlobProviderChecks if user update is supported.A user update refers to the fact that a blob from this provider may be overwritten with another blob, wherever the original blob may occur (usually in a document property).
- Specified by:
supportsUserUpdatein interfaceBlobProvider- Returns:
trueif user update is supported
-
isTransient
public boolean isTransient()Deprecated.Description copied from interface:BlobProviderChecks whether this blob provider is transient: blobs may disappear after a while, so a caller should not rely on them being available forever.- Specified by:
isTransientin interfaceBlobProvider
-
getProperties
Deprecated.Description copied from interface:BlobProviderReturns the properties of the blob provider.- Specified by:
getPropertiesin interfaceBlobProvider
-
GridFSBlobProviderinstead