Table of Contents

Class DistributedTenantsUsersCache

Namespace
GroupeIsa.Neos.ClusterCommunication.Multitenant
Assembly
GroupeIsa.Neos.ClusterCommunication.dll

Represents the cache of authorized tenants for users.

public class DistributedTenantsUsersCache : ITenantUsersCache
Inheritance
DistributedTenantsUsersCache
Implements
Inherited Members

Constructors

DistributedTenantsUsersCache(IStateStore)

Initializes a new instance of the DistributedTenantsUsersCache class.

public DistributedTenantsUsersCache(IStateStore stateStore)

Parameters

stateStore IStateStore

The state store.

Methods

AddOrUpdateAsync(string, string, string, IEnumerable<AuthorizedTenant>)

Adds or updates the cache for the specified user.

public Task AddOrUpdateAsync(string clusterName, string clusterVersion, string userId, IEnumerable<AuthorizedTenant> tenants)

Parameters

clusterName string

The cluster name.

clusterVersion string

The cluster version.

userId string

The user identifier.

tenants IEnumerable<AuthorizedTenant>

The tenant info.

Returns

Task

A Task that will complete when the operation has completed.

RemoveAsync(params string[])

Removes the user from the cache.

public Task RemoveAsync(params string[] userIds)

Parameters

userIds string[]

The user identifiers to remove.

Returns

Task

A Task that will complete when the operation has completed.

RemoveTenantAsync(string)

Removes the tenant from the cache.

public Task RemoveTenantAsync(string tenantId)

Parameters

tenantId string

The tenant identifier.

Returns

Task

A Task that will complete when the operation has completed.

TryGetAsync(string, string, string)

Tries to get the authorized tenants for the specified user.

public Task<(IEnumerable<AuthorizedTenant>? Tenants, string Etag)> TryGetAsync(string clusterName, string clusterVersion, string userId)

Parameters

clusterName string

The cluster name.

clusterVersion string

The cluster version.

userId string

The user identifier.

Returns

Task<(IEnumerable<AuthorizedTenant> Tenants, string Etag)>

The authorized tenant identifiers or null when user is not cached.