Table of Contents

ITenantCatalog Interface

Store of tenant routing information: the tenants, the shards that host them and the external identifiers that map to tenants.

Remarks

The catalog holds only logical routing data (tenant to shard id, statuses, names); it never stores connection settings or credentials of the shard databases. The default implementation is Aurelius.Tenancy.Catalog.Db.TDbTenantCatalog, which persists the catalog in a database. Custom implementations (for example, a client to a remote catalog service) should descend from TCustomTenantCatalog. Lookup methods return an empty record when the item is unknown. Save methods are idempotent upserts; read-only implementations may raise ENotSupportedException from them.

Syntax

Unit: Aurelius.Tenancy.Catalog

ITenantCatalog = interface(IInterface);

Methods

Name Description
FindShard Returns the catalog record of a shard.
FindTenant Returns the catalog record of a tenant.
FindTenantBy​Identifier Returns the tenant associated with an external identifier, such as an API client id, a custom domain or a user id.
GetShards Returns all shards registered in the catalog.
RemoveIdentifier Removes an external identifier. Nothing happens if the identifier is unknown.
SaveIdentifier Associates an external identifier with a tenant, replacing any previous association of the same identifier.
SaveShard Creates or updates a shard record.
SaveTenant Creates or updates a tenant record.