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
Modifier and TypeClassDescriptionprotected static class
Deprecated.A binary backed by GridFS.class
Deprecated. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Deprecated.Prefix used to retrieve a MongoDB connection fromMongoDBConnectionService
.protected String
Deprecated.static final String
Deprecated.protected com.mongodb.client.MongoCollection<org.bson.Document>
Deprecated.protected com.mongodb.client.gridfs.GridFSBucket
Deprecated.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_LENGTH
Fields inherited from interface org.nuxeo.ecm.core.blob.binary.BinaryManager
PROP_KEY, PROP_PATH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Deprecated.Closes this blob provider and releases resources that may be held by it.protected Binary
getBinary
(InputStream in) Deprecated.Creates a binary value from the given input stream.Deprecated.Returns aBinary
corresponding 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.GridFSBucket
Deprecated.Deprecated.Returns the properties of the blob provider.void
initialize
(String blobProviderId, Map<String, String> properties) Deprecated.Initializes the binary manager.boolean
Deprecated.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 aBlob
from storage.boolean
Deprecated.Checks if user update is supported.Deprecated.Writes aBlob
to 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, toHexString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:BinaryManager
Initializes the binary manager.- Specified by:
initialize
in interfaceBinaryManager
- Specified by:
initialize
in interfaceBlobProvider
- Overrides:
initialize
in classAbstractBinaryManager
- Parameters:
blobProviderId
- the blob provider id for this binary managerproperties
- initialization properties- Throws:
IOException
-
close
public void close()Deprecated.Description copied from interface:BlobProvider
Closes this blob provider and releases resources that may be held by it.- Specified by:
close
in interfaceBinaryManager
- Specified by:
close
in interfaceBlobProvider
-
getBinaryManager
Deprecated.Description copied from interface:BlobProvider
Gets the associated binary manager, if any.- Specified by:
getBinaryManager
in 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:BinaryManager
Saves the given blob into aBinary
.Returns a
Binary
representing the stream. TheBinary
includes 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:
getBinary
in interfaceBinaryManager
- Overrides:
getBinary
in classAbstractBinaryManager
- Parameters:
blob
- the blob- Returns:
- the corresponding binary
- Throws:
IOException
-
getBinary
Deprecated.Description copied from class:AbstractBinaryManager
Creates a binary value from the given input stream.- Specified by:
getBinary
in classAbstractBinaryManager
- Throws:
IOException
-
getBinary
Deprecated.Description copied from interface:BinaryManager
Returns aBinary
corresponding to the given digest.A
null
is returned if the digest could not be found.- Specified by:
getBinary
in interfaceBinaryManager
- Specified by:
getBinary
in classAbstractBinaryManager
- Parameters:
digest
- the digest, ornull
- Returns:
- the corresponding binary
-
readBlob
Deprecated.Description copied from interface:BlobProvider
Reads aBlob
from storage.- Specified by:
readBlob
in interfaceBlobProvider
- Parameters:
blobInfo
- the blob information- Returns:
- the blob
- Throws:
IOException
-
writeBlob
Deprecated.Description copied from interface:BlobProvider
Writes aBlob
to storage and returns information about it.Called to store a user-created blob.
- Specified by:
writeBlob
in interfaceBlobProvider
- Parameters:
blob
- the blob- Returns:
- the blob key
- Throws:
IOException
-
supportsUserUpdate
public boolean supportsUserUpdate()Deprecated.Description copied from interface:BlobProvider
Checks 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:
supportsUserUpdate
in interfaceBlobProvider
- Returns:
true
if user update is supported
-
isTransient
public boolean isTransient()Deprecated.Description copied from interface:BlobProvider
Checks 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:
isTransient
in interfaceBlobProvider
-
getProperties
Deprecated.Description copied from interface:BlobProvider
Returns the properties of the blob provider.- Specified by:
getProperties
in interfaceBlobProvider
-
GridFSBlobProvider
instead