Class CloudBlobStorage
Implements access methods to local blob storage
Inherited Members
Namespace: TimeCockpit.Data.Database
Assembly: TimeCockpit.Data.dll
Syntax
public sealed class CloudBlobStorage : BlobStorage
Methods
Create(String, String, BlobStorageAccessType, Guid)
Creates a new instance of the CloudBlobStorage class.
Declaration
public static CloudBlobStorage Create(string azureBlobStorageAccountName, string azureAccessKey, BlobStorageAccessType accessType, Guid clientReplicaId)
Parameters
Type | Name | Description |
---|---|---|
System.String | azureBlobStorageAccountName | Account name used to connect to azure blob storage service |
System.String | azureAccessKey | Either the account key used to connect to azure blob storage service or the shared access signature |
BlobStorageAccessType | accessType | The type of authentication used to access the blob storage service |
System.Guid | clientReplicaId | Replica id of the client to which this blob storage belongs |
Returns
Type | Description |
---|---|
CloudBlobStorage | An instance of the CloudBlobStorage class. |
CreateBlob(String, String, String, Byte[])
Creates or replaces a blob in the blob storage
Declaration
protected override void CreateBlob(string containerName, string blobName, string categoryName, byte[] blobContent)
Parameters
Type | Name | Description |
---|---|---|
System.String | containerName | Name of the container |
System.String | blobName | Name of the blob |
System.String | categoryName | Name of the category to which the blob belongs |
System.Byte[] | blobContent | Content of the blob |
Overrides
CreateBlobAsync(String, String, String, Byte[])
Creates or replaces a blob in the blob storage
Declaration
protected override Task CreateBlobAsync(string containerName, string blobName, string categoryName, byte[] blobContent)
Parameters
Type | Name | Description |
---|---|---|
System.String | containerName | Name of the container |
System.String | blobName | Name of the blob |
System.String | categoryName | Name of the category to which the blob belongs |
System.Byte[] | blobContent | Content of the blob |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The task representing the operation. |
Overrides
CreateContainer(String)
Creates a container in the blob storage
Declaration
protected override void CreateContainer(string containerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | containerName | Name of the container |
Overrides
DeleteBlob(String, String, String)
Delets a blob in the blob storage
Declaration
protected override void DeleteBlob(string containerName, string blobName, string categoryName)
Parameters
Type | Name | Description |
---|---|---|
System.String | containerName | Name of the container |
System.String | blobName | Name of the blob |
System.String | categoryName | Name of the category to which the blob belongs |
Overrides
GetBlobContent(String, String, String)
Gets the content of a blob in the blob storage
Declaration
protected override byte[] GetBlobContent(string containerName, string blobName, string categoryName)
Parameters
Type | Name | Description |
---|---|---|
System.String | containerName | Name of the container |
System.String | blobName | Name of the blob |
System.String | categoryName | Name of the category to which the blob belongs |
Returns
Type | Description |
---|---|
System.Byte[] | Returns the content of the blob. |
Overrides
GetBlobContentAsync(String, String, String)
Gets the content of a blob in the blob storage asynchronously.
Declaration
protected override Task<byte[]> GetBlobContentAsync(string containerName, string blobName, string categoryName)
Parameters
Type | Name | Description |
---|---|---|
System.String | containerName | Name of the container |
System.String | blobName | Name of the blob |
System.String | categoryName | Name of the category to which the blob belongs |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Byte[]> | Returns the content of the blob. |
Overrides
OpenCurrentContainer()
Opens the tenant's container which already exist.
Declaration
public override void OpenCurrentContainer()
Overrides
Remarks
This methods is used for the share access key authenticatio method, where the tenant needs to be created via a key and name pair. A data context which provides name and the shared access signature is nt allowed to create a tenant
OpenOrCreateCurrentContainer()
Creates the tenant's container if it does not already exist.
Declaration
public override void OpenOrCreateCurrentContainer()