TenantStreamStore Class
Keeps each tenant's streams apart in a store shared by every tenant.
public sealed class TenantStreamStore : Abblix.SharedSignals.Transmitter.IStreamStoreInheritance System.Object → TenantStreamStore
Implements IStreamStore
Remarks
A stream is stored under its receiver's identifier prefixed with the tenant's space, which names the tenant and its generation, and handed back without it. So one tenant's receiver never finds another's stream, a listing returns only this tenant's streams, and a tenant created again under the identifier of one removed takes over none of them.
Constructors
TenantStreamStore(IStreamStore, TenantDefinition) Constructor
Keeps each tenant's streams apart in a store shared by every tenant.
public TenantStreamStore(Abblix.SharedSignals.Transmitter.IStreamStore inner, Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition tenant);Parameters
inner IStreamStore
The store every tenant shares.
tenant TenantDefinition
The tenant whose streams these are.
Remarks
A stream is stored under its receiver's identifier prefixed with the tenant's space, which names the tenant and its generation, and handed back without it. So one tenant's receiver never finds another's stream, a listing returns only this tenant's streams, and a tenant created again under the identifier of one removed takes over none of them.
Methods
TenantStreamStore.DeleteAsync(string, string, CancellationToken) Method
Deletes a stream (SSF 1.0 Section 8.1.1.5).
public System.Threading.Tasks.Task<bool> DeleteAsync(string receiverId, string streamId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
receiverId System.String
The receiver the stream belongs to.
streamId System.String
The stream's identifier.
cancellationToken System.Threading.CancellationToken
Cancels I/O a durable implementation performs.
Implements DeleteAsync(string, string, CancellationToken)
Returns
System.Threading.Tasks.Task<System.Boolean>
True when deleted; false when no such stream existed.
TenantStreamStore.FindAsync(string, string, CancellationToken) Method
Finds one stream of one receiver.
public System.Threading.Tasks.Task<Abblix.SharedSignals.Transmitter.StreamState?> FindAsync(string receiverId, string streamId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
receiverId System.String
The receiver the stream belongs to.
streamId System.String
The stream's identifier.
cancellationToken System.Threading.CancellationToken
Cancels I/O a durable implementation performs.
Implements FindAsync(string, string, CancellationToken)
Returns
System.Threading.Tasks.Task<StreamState>
The stream's state, or null when no such stream exists for this receiver.
TenantStreamStore.ListAllAsync(CancellationToken) Method
Lists every stream of every receiver - the dispatcher's view, since an event is matched against all streams at once.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Abblix.SharedSignals.Transmitter.StreamState>> ListAllAsync(System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
cancellationToken System.Threading.CancellationToken
Cancels I/O a durable implementation performs.
Implements ListAllAsync(CancellationToken)
Returns
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<StreamState>>
TenantStreamStore.ListAsync(string, CancellationToken) Method
Lists the streams of one receiver, for the list form of the configuration read (SSF 1.0 Section 8.1.1.2). An empty list is a receiver with no streams, never an error.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Abblix.SharedSignals.Transmitter.StreamState>> ListAsync(string receiverId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
receiverId System.String
The receiver whose streams are listed.
cancellationToken System.Threading.CancellationToken
Cancels I/O a durable implementation performs.
Implements ListAsync(string, CancellationToken)
Returns
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<StreamState>>
TenantStreamStore.TryCreateAsync(StreamState, CancellationToken) Method
Stores a new stream.
public System.Threading.Tasks.Task<bool> TryCreateAsync(Abblix.SharedSignals.Transmitter.StreamState stream, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
stream StreamState
The stream's initial state.
cancellationToken System.Threading.CancellationToken
Cancels I/O a durable implementation performs.
Implements TryCreateAsync(StreamState, CancellationToken)
Returns
System.Threading.Tasks.Task<System.Boolean>
True when stored; false when a stream with the same receiver and identifier
already exists.
TenantStreamStore.UpdateAsync(StreamState, CancellationToken) Method
Replaces a stream's state with a new snapshot, keyed by its receiver and identifier.
public System.Threading.Tasks.Task<bool> UpdateAsync(Abblix.SharedSignals.Transmitter.StreamState stream, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
stream StreamState
The new state.
cancellationToken System.Threading.CancellationToken
Cancels I/O a durable implementation performs.
Implements UpdateAsync(StreamState, CancellationToken)
Returns
System.Threading.Tasks.Task<System.Boolean>
True when replaced; false when no such stream exists to replace.