StreamManagementClient Class
The receiver's side of the Event Stream Management API of one transmitter (SSF 1.0 Section 8.1): stream lifecycle, status, subjects and verification, each method speaking to the endpoint the transmitter's configuration metadata advertises.
public sealed class StreamManagementClientInheritance System.Object → StreamManagementClient
Remarks
Outcomes the specification gives the receiver a distinct reaction to are answers, not exceptions: a create that hits an existing stream (409), an update the transmitter accepted but has not processed (202), a verification or subject call the transmitter throttled (429). Everything else - authorization, unknown streams on writes, malformed requests - surfaces as the System.Net.Http.HttpRequestException the transport already speaks.
Every configuration document read back is checked to assert the transmitter's own issuer, as Sections 8.1.1.1 through 8.1.1.4 require of the receiver. Authentication is the System.Net.Http.HttpClient's configuration, not this type's concern.
Constructors
StreamManagementClient(HttpClient, TransmitterConfiguration) Constructor
The receiver's side of the Event Stream Management API of one transmitter (SSF 1.0 Section 8.1): stream lifecycle, status, subjects and verification, each method speaking to the endpoint the transmitter's configuration metadata advertises.
public StreamManagementClient(System.Net.Http.HttpClient httpClient, Abblix.SharedSignals.Model.TransmitterConfiguration transmitter);Parameters
httpClient System.Net.Http.HttpClient
The client the API is spoken through.
transmitter TransmitterConfiguration
The transmitter's configuration metadata: the endpoints and the issuer identity every response is held to.
Remarks
Outcomes the specification gives the receiver a distinct reaction to are answers, not exceptions: a create that hits an existing stream (409), an update the transmitter accepted but has not processed (202), a verification or subject call the transmitter throttled (429). Everything else - authorization, unknown streams on writes, malformed requests - surfaces as the System.Net.Http.HttpRequestException the transport already speaks.
Every configuration document read back is checked to assert the transmitter's own issuer, as Sections 8.1.1.1 through 8.1.1.4 require of the receiver. Authentication is the System.Net.Http.HttpClient's configuration, not this type's concern.
Methods
StreamManagementClient.AddSubjectAsync(AddSubjectRequest, CancellationToken) Method
Adds a subject to a stream (SSF 1.0 Section 8.1.3.2).
public System.Threading.Tasks.Task<bool> AddSubjectAsync(Abblix.SharedSignals.Model.AddSubjectRequest request, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
request AddSubjectRequest
The stream, the subject, and optionally whether it is verified.
cancellationToken System.Threading.CancellationToken
Cancels the call.
Returns
System.Threading.Tasks.Task<System.Boolean>
True when the transmitter answered success - which deliberately proves nothing about the
subject being known or added, so the response cannot be used to probe who the
transmitter knows (SSF 1.0 Section 9.1); false when it throttled the request (429).
StreamManagementClient.CreateAsync(CreateStreamRequest, CancellationToken) Method
Creates an Event Stream (SSF 1.0 Section 8.1.1.1).
public System.Threading.Tasks.Task<Abblix.SharedSignals.Model.StreamConfiguration?> CreateAsync(Abblix.SharedSignals.Model.CreateStreamRequest request, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
request CreateStreamRequest
The receiver-supplied half of the configuration.
cancellationToken System.Threading.CancellationToken
Cancels the call.
Returns
System.Threading.Tasks.Task<StreamConfiguration>
The stream's configuration as the transmitter created it, or null on "409 Conflict" -
the transmitter allows one stream per receiver and it already exists, so the receiver's
move is to read it and update or replace what differs.
StreamManagementClient.DeleteAsync(string, CancellationToken) Method
Deletes a stream (SSF 1.0 Section 8.1.1.5).
public System.Threading.Tasks.Task DeleteAsync(string streamId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
streamId System.String
The stream to delete.
cancellationToken System.Threading.CancellationToken
Cancels the call.
Returns
StreamManagementClient.GetAsync(string, CancellationToken) Method
Reads one stream's configuration (SSF 1.0 Section 8.1.1.2).
public System.Threading.Tasks.Task<Abblix.SharedSignals.Model.StreamConfiguration?> GetAsync(string streamId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
streamId System.String
The stream to read.
cancellationToken System.Threading.CancellationToken
Cancels the call.
Returns
System.Threading.Tasks.Task<StreamConfiguration>
The configuration, or null when no stream with this identifier exists for this
receiver.
StreamManagementClient.GetStatusAsync(string, CancellationToken) Method
Reads a stream's current status (SSF 1.0 Section 8.1.2.1).
public System.Threading.Tasks.Task<Abblix.SharedSignals.Model.StreamStatus?> GetStatusAsync(string streamId, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
streamId System.String
The stream whose status is being queried.
cancellationToken System.Threading.CancellationToken
Cancels the call.
Returns
System.Threading.Tasks.Task<StreamStatus>
The status document, or null when no stream with this identifier exists for
this receiver.
StreamManagementClient.ListAsync(CancellationToken) Method
Lists every stream configured for this receiver (SSF 1.0 Section 8.1.1.2). An empty list is the answer for a receiver with no streams, never an error.
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Abblix.SharedSignals.Model.StreamConfiguration>> ListAsync(System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
cancellationToken System.Threading.CancellationToken
Cancels the call.
Returns
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<StreamConfiguration>>
StreamManagementClient.RemoveSubjectAsync(RemoveSubjectRequest, CancellationToken) Method
Removes a subject from a stream (SSF 1.0 Section 8.1.3.3).
public System.Threading.Tasks.Task<bool> RemoveSubjectAsync(Abblix.SharedSignals.Model.RemoveSubjectRequest request, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
request RemoveSubjectRequest
The stream and the subject.
cancellationToken System.Threading.CancellationToken
Cancels the call.
Returns
System.Threading.Tasks.Task<System.Boolean>
True on success, under the same no-probing caveat as
AddSubjectAsync(AddSubjectRequest, CancellationToken); false when throttled (429).
StreamManagementClient.ReplaceAsync(UpdateStreamRequest, CancellationToken) Method
Replaces a stream's configuration: the request carries the full receiver-supplied set, and a member absent from it is deleted (SSF 1.0 Section 8.1.1.4).
public System.Threading.Tasks.Task<Abblix.SharedSignals.Model.StreamConfiguration?> ReplaceAsync(Abblix.SharedSignals.Model.UpdateStreamRequest request, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
request UpdateStreamRequest
The stream identifier and the full receiver-supplied set.
cancellationToken System.Threading.CancellationToken
Cancels the call.
Returns
System.Threading.Tasks.Task<StreamConfiguration>
The entire updated configuration, or null on "202 Accepted", as with
UpdateAsync(UpdateStreamRequest, CancellationToken).
StreamManagementClient.RequestVerificationAsync(VerificationRequest, CancellationToken) Method
Requests a Verification Event over a stream (SSF 1.0 Section 8.1.4.2).
public System.Threading.Tasks.Task<bool> RequestVerificationAsync(Abblix.SharedSignals.Model.VerificationRequest request, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
request VerificationRequest
The stream and optionally the state to be echoed back.
cancellationToken System.Threading.CancellationToken
Cancels the call.
Returns
System.Threading.Tasks.Task<System.Boolean>
True when the transmitter will transmit the event - possibly asynchronously and in no
particular order, so the receiver must not wait on it; false when the request was
throttled (429), see "min_verification_interval" in the stream's configuration.
StreamManagementClient.UpdateAsync(UpdateStreamRequest, CancellationToken) Method
Updates a stream's configuration: present receiver-supplied members change, absent ones stay (SSF 1.0 Section 8.1.1.3).
public System.Threading.Tasks.Task<Abblix.SharedSignals.Model.StreamConfiguration?> UpdateAsync(Abblix.SharedSignals.Model.UpdateStreamRequest request, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
request UpdateStreamRequest
The stream identifier and the members to change.
cancellationToken System.Threading.CancellationToken
Cancels the call.
Returns
System.Threading.Tasks.Task<StreamConfiguration>
The entire updated configuration, or null on "202 Accepted" - the transmitter took the
request but has not processed it, and the receiver may repeat the same request later for
the result.
StreamManagementClient.UpdateStatusAsync(StreamStatus, CancellationToken) Method
Updates a stream's status (SSF 1.0 Section 8.1.2.2).
public System.Threading.Tasks.Task<Abblix.SharedSignals.Model.StreamStatus?> UpdateStatusAsync(Abblix.SharedSignals.Model.StreamStatus request, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));Parameters
request StreamStatus
The stream, the new status, and optionally why.
cancellationToken System.Threading.CancellationToken
Cancels the call.
Returns
System.Threading.Tasks.Task<StreamStatus>
The updated status as the transmitter echoes it, or null on "202 Accepted" - taken but
not yet processed, repeatable later for the result.