Class ClientEntity
- Namespace
- Microsoft.Azure.ServiceBus
- Assembly
- Microsoft.Azure.ServiceBus.dll
Contract for all client entities with Open-Close/Abort state m/c main-purpose: closeAll related entities
public abstract class ClientEntity : IClientEntity
- Inheritance
-
ClientEntity
- Implements
- Derived
- Inherited Members
Constructors
ClientEntity(string, string, RetryPolicy)
protected ClientEntity(string clientTypeName, string postfix, RetryPolicy retryPolicy)
Parameters
clientTypeName
stringpostfix
stringretryPolicy
RetryPolicy
Properties
ClientId
Gets the ID to identify this client. This can be used to correlate logs and exceptions.
public string ClientId { get; }
Property Value
Remarks
Every new client has a unique ID (in that process).
IsClosedOrClosing
Returns true if the client is closed or closing.
public bool IsClosedOrClosing { get; }
Property Value
OperationTimeout
Duration after which individual operations will timeout.
public abstract TimeSpan OperationTimeout { get; set; }
Property Value
Path
Gets the name of the entity.
public abstract string Path { get; }
Property Value
RegisteredPlugins
Gets a list of currently registered plugins for this client.
public abstract IList<ServiceBusPlugin> RegisteredPlugins { get; }
Property Value
RetryPolicy
Gets the RetryPolicy defined on the client.
public RetryPolicy RetryPolicy { get; }
Property Value
ServiceBusConnection
Connection object to the service bus namespace.
public abstract ServiceBusConnection ServiceBusConnection { get; }
Property Value
Methods
CloseAsync()
Closes the Client. Closes the connections opened by it.
public Task CloseAsync()
Returns
GenerateClientId(string, string)
Generates a new client id that can be used to identify a specific client in logs and error messages.
protected static string GenerateClientId(string clientTypeName, string postfix = "")
Parameters
Returns
GetNextId()
protected static long GetNextId()
Returns
OnClosingAsync()
protected abstract Task OnClosingAsync()
Returns
RegisterPlugin(ServiceBusPlugin)
Registers a ServiceBusPlugin to be used with this client.
public abstract void RegisterPlugin(ServiceBusPlugin serviceBusPlugin)
Parameters
serviceBusPlugin
ServiceBusPluginThe ServiceBusPlugin to register.
ThrowIfClosed()
Throw an OperationCanceledException if the object is Closing.
protected virtual void ThrowIfClosed()
UnregisterPlugin(string)
Unregisters a ServiceBusPlugin.
public abstract void UnregisterPlugin(string serviceBusPluginName)