Table of Contents

Class LinksSessions

Namespace
Foundation.Data.Doublets.Cli.Protocol
Assembly
Foundation.Data.Doublets.Cli.dll

A store served to many sessions, each with its subject (issue #149): what a LinksServer gives every connection, without the network.

public sealed class LinksSessions
Inheritance
LinksSessions
Inherited Members

Remarks

Without Permissions every session sees and changes the whole store, exactly as before permissions existed. With them, a session sees the store through a PermissionsDecorator<TLinkAddress> of its subject, and every request is atomic: one that fails is undone whole, the writes the store made on its own (cascades, merges) and the names it took included, even where they touched links the subject cannot see.

(auth: token) sets the subject of the session to the one Authenticate gives the token, and answers (subject: i); an unknown token, or a server without an authenticator, answers (error: 'Forbidden: authentication failed').

With Triplets every request is about triplets (TripletsOperation), and the permissions move above the triplets (TripletsPermissionsDecorator<TLinkAddress>): the wrappers and pairs that store a triplet are written straight to the store below, still inside the transaction of the request.

Constructors

public LinksSessions(INamedTypesLinks<uint> links, LinksServerOptions? options = null)

Parameters

links INamedTypesLinks<uint>

The store.

options LinksServerOptions

The options of the server; only the permissions, authentication and references matter.

Properties

The store.

public INamedTypesLinks<uint> Links { get; }

Property Value

INamedTypesLinks<uint>

Options

The options.

public LinksServerOptions Options { get; }

Property Value

LinksServerOptions

Sessions

The sessions that are open.

public IReadOnlyList<LinksSession> Sessions { get; }

Property Value

IReadOnlyList<LinksSession>

Methods

Open(uint?)

Opens a session of subject, by default Subject.

public LinksSession Open(uint? subject = null)

Parameters

subject uint?

Returns

LinksSession