Search Results for

    Show / Hide Table of Contents

    Class BlobStorage

    Acts as the base class for blob storage implementations

    Inheritance
    System.Object
    BlobStorage
    CloudBlobStorage
    LocalBlobStorage
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: TimeCockpit.Data.Database
    Assembly: TimeCockpit.Data.dll
    Syntax
    public abstract class BlobStorage

    Constructors

    BlobStorage(Guid)

    Initializes a new instance of the BlobStorage class

    Declaration
    protected BlobStorage(Guid clientReplicaId)
    Parameters
    Type Name Description
    System.Guid clientReplicaId

    Replica id of the client to which this blob storage belongs

    Properties

    BlobEncryptionKey

    Gets or sets the optional encryption key used for storing blobs. Blob encryption key must be 32 Bytes/256 bits long or null to disable encryption support.

    Declaration
    protected byte[] BlobEncryptionKey { get; set; }
    Property Value
    Type Description
    System.Byte[]

    CurrentContainer

    Gets the current container (based on tenant replica, internal for testing purposes).

    Declaration
    protected string CurrentContainer { get; }
    Property Value
    Type Description
    System.String

    Methods

    CreateBlob(Guid, Guid, Guid, Byte[])

    Creates or replaces a blob in the blob storage

    Declaration
    public void CreateBlob(Guid blobId, Guid entityId, Guid propertyId, byte[] blobContent)
    Parameters
    Type Name Description
    System.Guid blobId

    Guid of the blob

    System.Guid entityId

    Guid of the entity to which the blob belongs

    System.Guid propertyId

    Guid of the property to which the blob belongs

    System.Byte[] blobContent

    Content of the blob

    CreateBlob(String, String, String, Byte[])

    Creates or replaces a blob in the blob storage

    Declaration
    protected abstract 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

    CreateBlobAsync(Guid, Guid, Guid, Byte[])

    Creates or replaces a blob in the blob storage asynchronously.

    Declaration
    public Task CreateBlobAsync(Guid blobId, Guid entityId, Guid propertyId, byte[] blobContent)
    Parameters
    Type Name Description
    System.Guid blobId

    Guid of the blob.

    System.Guid entityId

    Guid of the entity to which the blob belongs.

    System.Guid propertyId

    Guid of the property to which the blob belongs.

    System.Byte[] blobContent

    Content of the blob.

    Returns
    Type Description
    System.Threading.Tasks.Task

    The task representing the operation.

    CreateBlobAsync(String, String, String, Byte[])

    Creates or replaces a blob in the blob storage

    Declaration
    protected abstract 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.

    CreateContainer(String)

    Creates a container in the blob storage

    Declaration
    protected abstract void CreateContainer(string containerName)
    Parameters
    Type Name Description
    System.String containerName

    Name of the container

    DeleteBlob(Guid, Guid, Guid)

    Delets a blob in the blob storage

    Declaration
    public void DeleteBlob(Guid blobId, Guid entityId, Guid propertyId)
    Parameters
    Type Name Description
    System.Guid blobId

    Guid of the blob

    System.Guid entityId

    Guid of the entity to which the blob belongs

    System.Guid propertyId

    Guid of the property to which the blob belongs

    DeleteBlob(String, String, String)

    Delets a blob in the blob storage

    Declaration
    protected abstract 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

    GetBlobContent(Guid, Guid, Guid)

    Gets the content of a blob in the blob storage

    Declaration
    public byte[] GetBlobContent(Guid blobId, Guid entityId, Guid propertyId)
    Parameters
    Type Name Description
    System.Guid blobId

    Guid of the blob that should be read

    System.Guid entityId

    Guid of the entity to which the blob belongs

    System.Guid propertyId

    Guid of the property to which the blob belongs

    Returns
    Type Description
    System.Byte[]

    Content of the requested blob

    GetBlobContent(String, String, String)

    Gets the content of a blob in the blob storage

    Declaration
    protected abstract 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[]

    Content of the requested blob

    GetBlobContentAsync(Guid, Guid, Guid)

    Gets the blob content asynchronously.

    Declaration
    public Task<byte[]> GetBlobContentAsync(Guid blobId, Guid entityId, Guid propertyId)
    Parameters
    Type Name Description
    System.Guid blobId

    Guid of the blob that should be read

    System.Guid entityId

    Guid of the entity to which the blob belongs

    System.Guid propertyId

    Guid of the property to which the blob belongs

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Byte[]>

    A task Producing

    GetBlobContentAsync(String, String, String)

    Gets the content of a blob in the blob storage asynchronously.

    Declaration
    protected abstract 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[]>

    Content of the requested blob

    OpenCurrentContainer()

    Opens the tenant's container which already exist.

    Declaration
    public abstract void OpenCurrentContainer()
    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 abstract void OpenOrCreateCurrentContainer()
    In This Article
    Back to top Copyright © 2020 software architects gmbh