Table of Contents

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

stateStore IStateStore

The state store.

serviceProvider IServiceProvider

The serviceProvider.

logger INeosLogger<TenantsAccessor>

The logger.

cache ITenantDataCache

The 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

clusterName string

The cluster name.

userId string

The user identifier.

cancellationToken CancellationToken

The 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

tenantIdentifier string

The identifier of the tenant.

cancellationToken CancellationToken

The 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

clusterName string

The cluster name.

clusterVersion string

The cluster version.

tenantIdentifier string

The tenant identifier.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<NeosTenantInfo>

The tenant information or null if the tenant doesn't exist.