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 String
ACCOUNT_KEY_PROPERTY
static String
ACCOUNT_NAME_PROPERTY
protected com.microsoft.azure.storage.blob.CloudBlobClient
blobClient
protected com.microsoft.azure.storage.blob.CloudBlobContainer
container
static String
CONTAINER_PROPERTY
static String
ENDPOINT_PROTOCOL_PROPERTY
protected String
prefix
static String
PREFIX_PROPERTY
protected com.microsoft.azure.storage.CloudStorageAccount
storageAccount
static String
SYSTEM_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 String
getContentDispositionHeader(Blob blob, javax.servlet.http.HttpServletRequest servletRequest)
protected FileStorage
getFileStorage()
protected URI
getRemoteUri(String digest, ManagedBlob blob, javax.servlet.http.HttpServletRequest servletRequest)
protected String
getSystemPropertyPrefix()
Gets the prefix used for configuration using system properties.protected BinaryGarbageCollector
instantiateGarbageCollector()
protected static boolean
isMissingKey(com.microsoft.azure.storage.StorageException e)
protected long
lengthOfBlob(String digest)
void
removeBinaries(Collection<String> digests)
Remove definitively a set of binariesprotected void
removeBinary(String digest)
protected void
setupCloudClient()
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:AbstractCloudBinaryManager
Gets the prefix used for configuration using system properties.- Specified by:
getSystemPropertyPrefix
in classAbstractCloudBinaryManager
-
setupCloudClient
protected void setupCloudClient() throws IOException
Description copied from class:AbstractCloudBinaryManager
Configure Cloud client using properties- Specified by:
setupCloudClient
in classAbstractCloudBinaryManager
- Throws:
IOException
-
instantiateGarbageCollector
protected BinaryGarbageCollector instantiateGarbageCollector()
- Specified by:
instantiateGarbageCollector
in classAbstractCloudBinaryManager
-
getFileStorage
protected FileStorage getFileStorage()
- Specified by:
getFileStorage
in classAbstractCloudBinaryManager
-
getRemoteUri
protected URI getRemoteUri(String digest, ManagedBlob blob, javax.servlet.http.HttpServletRequest servletRequest) throws IOException
- Overrides:
getRemoteUri
in classAbstractCloudBinaryManager
- Throws:
IOException
-
getContentDispositionHeader
protected String getContentDispositionHeader(Blob blob, javax.servlet.http.HttpServletRequest servletRequest)
- Overrides:
getContentDispositionHeader
in classAbstractCloudBinaryManager
-
removeBinary
protected void removeBinary(String digest)
-
removeBinaries
public void removeBinaries(Collection<String> digests)
Description copied from interface:BinaryManager
Remove definitively a set of binaries- Specified by:
removeBinaries
in interfaceBinaryManager
- Specified by:
removeBinaries
in 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:
URISyntaxException
com.microsoft.azure.storage.StorageException
- Since:
- 11.5
-
isMissingKey
protected static boolean isMissingKey(com.microsoft.azure.storage.StorageException e)
- Since:
- 11.5
-
-