Class AMiddlewareClient
- Assembly
- Skyline.DataMiner.DataSources.CommunicationGatewayMiddleware.Common.dll
A class that represents a single gRPC connection that can be used to handle a particular gRPC service's communication. This requires the CommunicationGateway DxM to be available.
'Channel' refers to a virtual connection to a conceptual endpoint in the DxM. 'Connection' refers to an active gRPC (HTTP2) connection with an endpoint. 'DataSource' refers to a conceptual endpoint and its identifying parameters.
public abstract class AMiddlewareClient : IMiddlewareClient
- Inheritance
-
AMiddlewareClient
- Implements
- Extension Methods
Properties
- ChannelId
The channel ID helps identify the source when investigating logging and traces. It also makes the subjects to communicate over the message broker with unique.
- ChannelName
The name assigned to this channel for users to identify it more easily than with the channel ID.
- IsConnected
Gets a boolean indicating if there is a connection with the channel.
- Logger
The logger instance that is wrapped so it will not throw exceptions.
- WorkloadMonitor
Allows you to retrieve a snapshot of some workload-related information.
Methods
- AddConnectionMetadata(GrpcMetadata)
Adds metadata key-value pairs to the gRPC channel's metadata that is sent with every request. Duplicate keys will be dropped and will not be present in the return value.
- ChangeConfiguration(DataSourceConfiguration)
When the configuration is different, this will trigger a disconnect and update the data source configuration to then reconnect.
- Connect()
Registers the channel with a CommunicationGateway DxM and makes the DxM attempt a connection with the endpoint.
- Disconnect()
Closes the connection with the endpoint and unregisters the channel with the DxM.
- Dispose()
The dispose will also call Disconnect.
- Dispose(bool)
Disposing the object.
- LogException(Exception)
Logs an error message if the logger exists.
- LogIfError(ErrorCode)
Logs the error code with its friendly name as a warning if the code is not OK. The full description is logged on the debug level.
- RemoveConnectionMetadata(params string[])
Removes metadata keys and their associated values from the gRPC channel's metadata that is sent with every request. Keys that cannot be found will not be present in the return value. Note that keys for binary values (byte arrays) should end with "-bin".
- Unsubscribe(string)
Removes a subscription from the endpoint.
Events
- ConnectionStateChanged
Action that will be called when the connection state has changed.
- SubscriptionDataCleared
Action that will be called when the subscription handlers have been cleared. This is expected to happen on a disconnect from the API, but not when the connection is lost and an attempt is made to reconnect automatically.
- SubscriptionLost
Action that will be called when a subscription is lost and could not be recovered. The LostSubscriptionArgs will include details about the lost subscription.