Package org.nuxeo.ecm.blob.azure
Class AzureBinaryManager
- java.lang.Object
-
- org.nuxeo.ecm.core.blob.binary.AbstractBinaryManager
-
- org.nuxeo.ecm.core.blob.binary.CachingBinaryManager
-
- org.nuxeo.ecm.blob.AbstractCloudBinaryManager
-
- org.nuxeo.ecm.blob.azure.AzureBinaryManager
-
- All Implemented Interfaces:
BinaryManager,BlobProvider
- Direct Known Subclasses:
AzureCDNBinaryManager
public class AzureBinaryManager extends AbstractCloudBinaryManager
- Since:
- 7.10
- Author:
- Arnaud Kervern
-
-
Field Summary
Fields Modifier and Type Field Description static StringACCOUNT_KEY_PROPERTYstatic StringACCOUNT_NAME_PROPERTYprotected com.microsoft.azure.storage.blob.CloudBlobClientblobClientprotected com.microsoft.azure.storage.blob.CloudBlobContainercontainerstatic StringCONTAINER_PROPERTYstatic StringENDPOINT_PROTOCOL_PROPERTYprotected Stringprefixstatic StringPREFIX_PROPERTYprotected com.microsoft.azure.storage.CloudStorageAccountstorageAccountstatic StringSYSTEM_PROPERTY_PREFIX-
Fields inherited from class org.nuxeo.ecm.blob.AbstractCloudBinaryManager
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, DIGEST_ALGORITHM_PROPERTY, directDownload, DIRECTDOWNLOAD_EXPIRE_PROPERTY, DIRECTDOWNLOAD_PROPERTY, directDownloadExpire, namespace, transientFlag
-
Fields inherited from class org.nuxeo.ecm.core.blob.binary.CachingBinaryManager
cachedir, fileCache, fileStorage
-
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
Constructors Constructor Description AzureBinaryManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetContentDispositionHeader(Blob blob, javax.servlet.http.HttpServletRequest servletRequest)protected FileStoragegetFileStorage()protected URIgetRemoteUri(String digest, ManagedBlob blob, javax.servlet.http.HttpServletRequest servletRequest)protected StringgetSystemPropertyPrefix()Gets the prefix used for configuration using system properties.protected BinaryGarbageCollectorinstantiateGarbageCollector()protected static booleanisMissingKey(com.microsoft.azure.storage.StorageException e)protected longlengthOfBlob(String digest)voidremoveBinaries(Collection<String> digests)Remove definitively a set of binariesprotected voidremoveBinary(String digest)protected voidsetupCloudClient()Configure Cloud client using properties-
Methods inherited from class org.nuxeo.ecm.blob.AbstractCloudBinaryManager
getBinaryManager, getBooleanProperty, getContentTypeHeader, getDefaultDigestAlgorithm, getIntProperty, getIntProperty, getProperties, getProperty, getProperty, getSystemPropertyName, getURI, initialize, isDirectDownload, isTransient, performsExternalAccessControl, readBlob, supportsUserUpdate, supportsUserUpdateDefaultTrue, writeBlob
-
Methods inherited from class org.nuxeo.ecm.core.blob.binary.CachingBinaryManager
close, getBinary, getBinary, getFile, initializeCache, initializeCache, initializeCache
-
Methods inherited from class org.nuxeo.ecm.core.blob.binary.AbstractBinaryManager
computeDigestPattern, getBinary, getDescriptor, getDigestAlgorithm, getGarbageCollector, isValidDigest, 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, close, deleteBlob, getAppLinks, getAvailableConversions, getBinaryGarbageCollector, getFile, getStatus, getStream, getStream, getThumbnail, hasCreateFromKeyPermission, isColdStorageMode, isRecordMode, isTransactional, isVersion, readBlob, supportsSync, updateBlob, writeBlob
-
-
-
-
Field Detail
-
ENDPOINT_PROTOCOL_PROPERTY
public static final String ENDPOINT_PROTOCOL_PROPERTY
- See Also:
- Constant Field Values
-
SYSTEM_PROPERTY_PREFIX
public static final String SYSTEM_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
ACCOUNT_NAME_PROPERTY
public static final String ACCOUNT_NAME_PROPERTY
- See Also:
- Constant Field Values
-
ACCOUNT_KEY_PROPERTY
public static final String ACCOUNT_KEY_PROPERTY
- See Also:
- Constant Field Values
-
CONTAINER_PROPERTY
public static final String CONTAINER_PROPERTY
- See Also:
- Constant Field Values
-
PREFIX_PROPERTY
public static final String PREFIX_PROPERTY
- Since:
- 10.10
- See Also:
- Constant Field Values
-
storageAccount
protected com.microsoft.azure.storage.CloudStorageAccount storageAccount
-
blobClient
protected com.microsoft.azure.storage.blob.CloudBlobClient blobClient
-
container
protected com.microsoft.azure.storage.blob.CloudBlobContainer container
-
prefix
protected String prefix
-
-
Method Detail
-
getSystemPropertyPrefix
protected String getSystemPropertyPrefix()
Description copied from class:AbstractCloudBinaryManagerGets the prefix used for configuration using system properties.- Specified by:
getSystemPropertyPrefixin classAbstractCloudBinaryManager
-
setupCloudClient
protected void setupCloudClient() throws IOExceptionDescription copied from class:AbstractCloudBinaryManagerConfigure Cloud client using properties- Specified by:
setupCloudClientin classAbstractCloudBinaryManager- Throws:
IOException
-
instantiateGarbageCollector
protected BinaryGarbageCollector instantiateGarbageCollector()
- Specified by:
instantiateGarbageCollectorin classAbstractCloudBinaryManager
-
getFileStorage
protected FileStorage getFileStorage()
- Specified by:
getFileStoragein classAbstractCloudBinaryManager
-
getRemoteUri
protected URI getRemoteUri(String digest, ManagedBlob blob, javax.servlet.http.HttpServletRequest servletRequest) throws IOException
- Overrides:
getRemoteUriin classAbstractCloudBinaryManager- Throws:
IOException
-
getContentDispositionHeader
protected String getContentDispositionHeader(Blob blob, javax.servlet.http.HttpServletRequest servletRequest)
- Overrides:
getContentDispositionHeaderin classAbstractCloudBinaryManager
-
removeBinary
protected void removeBinary(String digest)
-
removeBinaries
public void removeBinaries(Collection<String> digests)
Description copied from interface:BinaryManagerRemove definitively a set of binaries- Specified by:
removeBinariesin interfaceBinaryManager- Specified by:
removeBinariesin classAbstractCloudBinaryManager- Parameters:
digests- a set of digests, must not benull.
-
lengthOfBlob
protected long lengthOfBlob(String digest) throws URISyntaxException, com.microsoft.azure.storage.StorageException
- Returns:
- the length of the blob with the given
digest, or -1 if missing - Throws:
URISyntaxExceptioncom.microsoft.azure.storage.StorageException- Since:
- 11.5
-
isMissingKey
protected static boolean isMissingKey(com.microsoft.azure.storage.StorageException e)
- Since:
- 11.5
-
-