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 |
---|---|---|
IDiscoveryClientBuilderFactory | discoveryClientBuilderFactory | The discovery client builder factory. |
IOptionsMonitor<TransportMetadataProviderOptions> | transportMetadataProviderOptions | The transport metadata provider options. |
IDistributedCache | 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.String | applicationName | The application name. |
Returns
Type | Description |
---|---|
ServiceDiscoveryCriteria | 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 |
---|---|---|
ServiceDiscoveryResponse | serviceDiscoveryResponse | The service discovery response. |
Returns
Type | Description |
---|---|
TTransportMetadata | 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.String | applicationName | The Application name. |
System.Boolean | useCachedTransportMetadataIfAvailable |
|
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TTransportMetadata> | The transport metadata. |
Type Parameters
Name | Description |
---|---|
TContract | The contract type. |