Table of Contents

Interface IDataBlockRegistry

Namespace
Datafication.Server.Core.Registry
Assembly
Datafication.Server.Core.dll

Defines a registry for managing DataBlock instances by unique identifiers.

public interface IDataBlockRegistry

Properties

Count

Gets the total number of registered DataBlocks.

int Count { get; }

Property Value

int

Methods

Contains(string)

Checks if a DataBlock with the specified identifier exists.

bool Contains(string id)

Parameters

id string

The unique identifier to check.

Returns

bool

True if the DataBlock exists; otherwise, false.

ContainsAsync(string, CancellationToken)

Asynchronously checks if a DataBlock with the specified identifier exists.

Task<bool> ContainsAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The unique identifier to check.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<bool>

True if the DataBlock exists; otherwise, false.

GetAllDataBlockIds()

Gets all registered DataBlock identifiers.

IEnumerable<string> GetAllDataBlockIds()

Returns

IEnumerable<string>

A collection of all registered DataBlock identifiers.

GetAllDataBlockIdsAsync(CancellationToken)

Asynchronously gets all registered DataBlock identifiers.

Task<IEnumerable<string>> GetAllDataBlockIdsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<IEnumerable<string>>

A collection of all registered DataBlock identifiers.

GetDataBlock(string)

Retrieves a DataBlock by its identifier.

DataBlock? GetDataBlock(string id)

Parameters

id string

The unique identifier of the DataBlock.

Returns

DataBlock

The DataBlock instance if found; otherwise, null.

GetDataBlockAsync(string, CancellationToken)

Asynchronously retrieves a DataBlock by its identifier.

Task<DataBlock?> GetDataBlockAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The unique identifier of the DataBlock.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<DataBlock>

The DataBlock instance if found; otherwise, null.

GetDataBlockMetadata(string)

Retrieves metadata for a DataBlock by its identifier.

DataBlockMetadata? GetDataBlockMetadata(string id)

Parameters

id string

The unique identifier of the DataBlock.

Returns

DataBlockMetadata

The metadata for the DataBlock if found; otherwise, null.

GetDataBlockMetadataAsync(string, CancellationToken)

Asynchronously retrieves metadata for a DataBlock by its identifier.

Task<DataBlockMetadata?> GetDataBlockMetadataAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The unique identifier of the DataBlock.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<DataBlockMetadata>

The metadata for the DataBlock if found; otherwise, null.

RegisterDataBlock(string, DataBlock, DataBlockMetadata?)

Registers a DataBlock with the specified identifier.

void RegisterDataBlock(string id, DataBlock dataBlock, DataBlockMetadata? metadata = null)

Parameters

id string

The unique identifier for the DataBlock.

dataBlock DataBlock

The DataBlock instance to register.

metadata DataBlockMetadata

Optional metadata associated with the DataBlock.

RegisterDataBlockAsync(string, DataBlock, DataBlockMetadata?, CancellationToken)

Asynchronously registers a DataBlock with the specified identifier.

Task RegisterDataBlockAsync(string id, DataBlock dataBlock, DataBlockMetadata? metadata = null, CancellationToken cancellationToken = default)

Parameters

id string

The unique identifier for the DataBlock.

dataBlock DataBlock

The DataBlock instance to register.

metadata DataBlockMetadata

Optional metadata associated with the DataBlock.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task

UnregisterDataBlock(string)

Removes a DataBlock from the registry.

bool UnregisterDataBlock(string id)

Parameters

id string

The unique identifier of the DataBlock to remove.

Returns

bool

True if the DataBlock was removed; otherwise, false.

UnregisterDataBlockAsync(string, CancellationToken)

Asynchronously removes a DataBlock from the registry.

Task<bool> UnregisterDataBlockAsync(string id, CancellationToken cancellationToken = default)

Parameters

id string

The unique identifier of the DataBlock to remove.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<bool>

True if the DataBlock was removed; otherwise, false.