Class TenantsAccessor
- Namespace
- GroupeIsa.Neos.ClusterCommunication.Multitenant
- Assembly
- GroupeIsa.Neos.ClusterCommunication.dll
Provides access to information about tenants of application.
public class TenantsAccessor : ITenantsAccessor
- Inheritance
-
TenantsAccessor
- Implements
- Inherited Members
Constructors
TenantsAccessor(IStateStore, IServiceProvider, INeosLogger<TenantsAccessor>, ITenantDataCache)
Initializes a new instance of the TenantsAccessor class.
public TenantsAccessor(IStateStore stateStore, IServiceProvider serviceProvider, INeosLogger<TenantsAccessor> logger, ITenantDataCache cache)
Parameters
stateStoreIStateStoreThe state store.
serviceProviderIServiceProviderThe serviceProvider.
loggerINeosLogger<TenantsAccessor>The logger.
cacheITenantDataCacheThe tenant data cache.
Methods
GetAuthorizedTenantsAsync(string, string, CancellationToken)
Tries to get the authorized tenants for the specified user on a cluster.
public Task<IEnumerable<AuthorizedTenant>> GetAuthorizedTenantsAsync(string clusterName, string userId, CancellationToken cancellationToken = default)
Parameters
clusterNamestringThe cluster name.
userIdstringThe user identifier.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<IEnumerable<AuthorizedTenant>>
The authorized tenant identifiers.
GetClustersAsync(string, CancellationToken)
Gets the clusters associated with the specified tenant identifier.
public Task<IEnumerable<ClusterIdentifier>> GetClustersAsync(string tenantIdentifier, CancellationToken cancellationToken = default)
Parameters
tenantIdentifierstringThe identifier of the tenant.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<IEnumerable<ClusterIdentifier>>
A task that represents the asynchronous operation. The task result contains the list of cluster identifiers.
GetTenantInfoAsync(string, string, string, CancellationToken)
Gets information about the specified tenant.
public Task<NeosTenantInfo?> GetTenantInfoAsync(string clusterName, string clusterVersion, string tenantIdentifier, CancellationToken cancellationToken = default)
Parameters
clusterNamestringThe cluster name.
clusterVersionstringThe cluster version.
tenantIdentifierstringThe tenant identifier.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<NeosTenantInfo>
The tenant information or null if the tenant doesn't exist.