ConfigurationStreamStore Class
The stream store of a closed deployment: the stream set is the operator's file rather than something receivers create over the network. Right where the receivers are the operator's own products - known in advance, changed by editing configuration.
public sealed class ConfigurationStreamStore : Abblix.SharedSignals.Transmitter.IStreamStoreInheritance System.Object → ConfigurationStreamStore
Implements IStreamStore
Remarks
Two things own a stream, and this store keeps them apart. The FILE owns what the stream is - the receiver, the identifier, the audiences, the events, the delivery endpoint, the subjects mode - and the RECEIVER owns what it has since done through the management API: the status it set (SSF 1.0 Section 8.1.2), the subjects it added and removed (Section 8.1.3), and when it last asked for verification (Section 8.1.4.2). The store reconciles the two against a backing store: declared fields are written from the file, receiver-owned fields are carried over from whatever is already there.
That split is what makes the file editable and the API meaningful at the same time. Rebuilding the whole state from the file instead - the obvious reading of "configuration is truth" - looks harmless and is not: under None the subjects a receiver added ARE the stream's coverage, so it would silently unsubscribe the receiver from everything it subscribed to, and Section 9.1 tells that receiver a success says nothing about the transmitter's state, so it never asks and never finds out.
A stream in the backing store that the file no longer declares is deleted, because in this store the file IS the stream set: leaving it would keep delivering security events to a receiver the operator removed, which is the failure that matters of the two directions.
Which backing store it is decides how far the receiver-owned half reaches. The default is in memory, which is right for one instance; a transmitter running several takes a shared one, or a receiver's pause is honoured by whichever instance took the request while the rest keep delivering - and since the delivery claim moves between instances from pass to pass, the pause appears to be respected intermittently rather than not at all, which is the harder shape to diagnose.
Constructors
ConfigurationStreamStore(SharedSignalsTransmitterOptions, PollEndpointLocator, IReadOnlyList<ConfiguredStream>, IStreamStore) Constructor
Materializes the configured streams: the transmitter's half - issuer, supported and delivered sets - comes from options, and the poll endpoint from pollEndpoints, exactly as the dynamic create would supply them.
public ConfigurationStreamStore(Abblix.SharedSignals.Transmitter.SharedSignalsTransmitterOptions options, Abblix.SharedSignals.Transmitter.PollEndpointLocator pollEndpoints, System.Collections.Generic.IReadOnlyList<Abblix.SharedSignals.Transmitter.ConfiguredStream> streams, Abblix.SharedSignals.Transmitter.IStreamStore backingStore);Parameters
options SharedSignalsTransmitterOptions
The deployment's one-time decisions.
pollEndpoints PollEndpointLocator
Where a declared poll stream is polled.
streams System.Collections.Generic.IReadOnlyList<ConfiguredStream>
The declared streams.
backingStore IStreamStore
Where the reconciled streams live. In memory unless the deployment supplies a shared one, which is what carries the receiver-owned half between instances.
Exceptions
System.InvalidOperationException
Two declarations share a receiver and stream identifier, or a poll stream is declared on
a transmitter that offers no poll delivery - configuration bugs, refused loudly at
startup rather than surfacing as a broken stream later.
Methods
ConfigurationStreamStore.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.
ConfigurationStreamStore.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.
ConfigurationStreamStore.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>>
ConfigurationStreamStore.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>>
ConfigurationStreamStore.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.
ConfigurationStreamStore.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.