Class TransportMetadataProvider<TTransportMetadata>
Defines a method for retrieving transport metadata for a service contract in a given application.
Inheritance
System.Object
TransportMetadataProvider<TTransportMetadata>
Implements
ITransportMetadataProvider <TTransportMetadata>
Namespace: Copper.Conventions.Method.Common.V1
Assembly: Copper.Conventions.Method.Common.dll
Syntax
public abstract class TransportMetadataProvider<TTransportMetadata> : ITransportMetadataProvider<TTransportMetadata> where TTransportMetadata : class
Type Parameters
Name | Description |
---|---|
TTransportMetadata | The transport metadata type. |
Constructors
View SourceTransportMetadataProvider(IDiscoveryClientBuilderFactory, IOptionsMonitor<TransportMetadataProviderOptions>, IDistributedCache)
Initializes a new instance of the TransportMetadataProvider<TTransportMetadata> class.
Declaration
protected TransportMetadataProvider(IDiscoveryClientBuilderFactory discoveryClientBuilderFactory, IOptionsMonitor<TransportMetadataProviderOptions> transportMetadataProviderOptions, IDistributedCache distributedCache)
Parameters
Type | Name | Description |
---|---|---|
IDiscovery |
discoveryClientBuilderFactory | The discovery client builder factory. |
IOptions |
transportMetadataProviderOptions | The transport metadata provider options. |
IDistributed |
distributedCache | The distributed cache. |
Methods
View SourceGetServiceDiscoveryCriteriaFor<TContract>(String)
Gets the service discovery criteria.
Declaration
protected abstract ServiceDiscoveryCriteria GetServiceDiscoveryCriteriaFor<TContract>(string applicationName)
where TContract : class
Parameters
Type | Name | Description |
---|---|---|
System. |
applicationName | The application name. |
Returns
Type | Description |
---|---|
Service |
The service discovery metadata. |
Type Parameters
Name | Description |
---|---|
TContract | The contract type. |
GetTransportMetadataFor<TContract>(ServiceDiscoveryResponse)
Gets the transport metadata.
Declaration
protected abstract TTransportMetadata GetTransportMetadataFor<TContract>(ServiceDiscoveryResponse serviceDiscoveryResponse)
where TContract : class
Parameters
Type | Name | Description |
---|---|---|
Service |
serviceDiscoveryResponse | The service discovery response. |
Returns
Type | Description |
---|---|
TTransport |
The transport metadata. |
Type Parameters
Name | Description |
---|---|
TContract | The contract type. |
RetrieveTransportMetadataFor<TContract>(String, Boolean)
Retrieves the transport metadata for a service contract in a given application.
Declaration
public async Task<TTransportMetadata> RetrieveTransportMetadataFor<TContract>(string applicationName, bool useCachedTransportMetadataIfAvailable)
where TContract : class
Parameters
Type | Name | Description |
---|---|---|
System. |
applicationName | The Application name. |
System. |
useCachedTransportMetadataIfAvailable |
|
Returns
Type | Description |
---|---|
System. |
The transport metadata. |
Type Parameters
Name | Description |
---|---|
TContract | The contract type. |