Realm Store


RealmStore

class cfxdb.realmstore.RealmStore(db)[source]

Persistent realm store.

property db: Database

Database this schema is attached to.

property sessions: Optional[Sessions]

Sessions persisted in this realm store.

property idx_sessions_by_session_id: Optional[IndexSessionsBySessionId]

Index: (session, joined_at) -> app_session_oid

property publications: Optional[Publications]

Publications archive.

property events: Optional[Events]

Events archive.


Session


class cfxdb.realmstore.Session(from_fbs: Optional[_SessionGen] = None)[source]

Persisted session database object.

marshal()[source]
property arealm_oid: Optional[UUID]

OID of the application realm this session is/was joined on.

property oid: Optional[UUID]

Unlimited time, globally unique, long-term OID of this session. The pair of WAMP session ID and join time (session, joined_at) bidirectionally maps to session oid.

property session: Optional[int]

The WAMP session_id of the session.

property joined_at: Optional[datetime64]

Timestamp when the session was joined by the router. Epoch time in ns.

property left_at: Optional[datetime64]

Timestamp when the session left the router. Epoch time in ns.

property node_oid: Optional[UUID]

OID of the node of the router worker hosting this session.

property node_authid: Optional[str]

Name (management realm WAMP authid) of the node of the router worker hosting this session.

property worker_name: Optional[str]

Local worker name of the router worker hosting this session.

property worker_pid: Optional[int]

Local worker PID of the router worker hosting this session.

property transport: Optional[Dict[str, Any]]

Session transport information.

property proxy_node_oid: Optional[UUID]

From proxy (in proxy-router cluster setups): OID of the node of the proxy worker hosting this session.

property proxy_node_authid: Optional[str]

From proxy (in proxy-router cluster setups): Name (management realm WAMP authid) of the node of the proxy worker hosting this session.

property proxy_worker_name: Optional[str]

From proxy (in proxy-router cluster setups): Local worker name of the proxy worker hosting this session.

property proxy_worker_pid: Optional[int]

From proxy (in proxy-router cluster setups): Local worker PID of the proxy worker hosting this session.

property proxy_transport: Optional[Dict[str, Any]]

From proxy (in proxy-router cluster setups): Session transport information, the transport from the proxy to the backend router.

property realm: Optional[str]

The WAMP realm the session is/was joined on.

property authid: Optional[str]

The WAMP authid the session was authenticated under.

property authrole: Optional[str]

The WAMP authrole the session was authenticated under.

property authmethod: Optional[str]

The WAMP authmethod uses to authenticate the session.

property authprovider: Optional[str]

The WAMP authprovider that was handling the session authentication.

property authextra: Optional[Dict[str, Any]]

The WAMP authextra as provided to the authenticated session.

static cast(buf) Session[source]
build(builder)[source]
class cfxdb.realmstore.Sessions(slot=None, compress=None, build=None, cast=None)[source]

Bases: MapUuidFlatBuffers

Persisted session information table.

Map zlmdb.MapUuidFlatBuffers from session_oid to cfxdb.realmstore.Session

class cfxdb.realmstore.IndexSessionsBySessionId(slot=None, compress=None)[source]

Bases: MapUint64TimestampUuid

Index: (sessionid, joined_at) -> session_oid

Publication


class cfxdb.realmstore.Publication(from_fbs=None)[source]

Persisted publication database object.

ENC_ALGO_NONE = 0
ENC_ALGO_CRYPTOBOX = 1
ENC_ALGO_MQTT = 2
ENC_ALGO_XBR = 3
ENC_SER_NONE = 0
ENC_SER_JSON = 1
ENC_SER_MSGPACK = 2
ENC_SER_CBOR = 3
ENC_SER_UBJSON = 4
ENC_SER_OPAQUE = 5
ENC_SER_FLATBUFFERS = 6
marshal()[source]
property timestamp

Timestamp when the publication was accepted by the broker. Epoch time in ns.

Returns

epoch time in ns

Return type

int

property publication

WAMP publication ID that was assigned by the broker.

Returns

publication ID

Return type

int

property publisher

WAMP session ID of the publisher.

Returns

publisher ID

Return type

int

property topic

The WAMP or application URI of the PubSub topic the event was published to.

Returns

topic (URI) published to

Return type

str

property args

Positional values for application-defined event payload.

Returns

positional arguments (app payload) of the event (if any)

Return type

None or list

property kwargs

Keyword values for application-defined event payload.

Returns

keyword arguments (app payload) of the event (if any)

Return type

None or dict

property payload

Alternative, transparent payload. If given, args and kwargs must be left unset.

Returns

Transparent binary payload (see enc_algo) if applicable

Return type

None or bytes

property acknowledge

If True, the broker was asked to acknowledge the publication with a success or error response.

Returns

acknowledge flag

Return type

None or bool

property retain

If True, the broker was requested to retain this event.

Returns

retain flag

Return type

None or bool

property exclude_me

If True, the broker was asked to exclude the publisher from receiving the event.

Returns

exclude_me flag

Return type

None or bool

property exclude

List of WAMP session IDs to exclude from receiving this event.

Returns

list of excluded session IDs

Return type

list[int]

property exclude_authid

List of WAMP authids to exclude from receiving this event.

Returns

list of excluded authids

Return type

list[str]

property exclude_authrole

List of WAMP authroles to exclude from receiving this event.

Returns

list of excluded authroles

Return type

list[str]

property eligible

List of WAMP session IDs eligible to receive this event.

Returns

list of eligible session IDs

Return type

list[int]

property eligible_authid

List of WAMP authids eligible to receive this event.

Returns

list of eligible authids

Return type

list[str]

property eligible_authrole

List of WAMP authroles eligible to receive this event.

Returns

list of eligible authroles

Return type

list[str]

property enc_algo

When using payload transparency, the encoding algorithm that was used to encode the payload.

Returns

payload encryption algorithm

Return type

int

property enc_key

When using payload transparency with an encryption algorithm, the payload encryption key.

Returns

payload key

Return type

None or bytes

property enc_serializer

When using payload transparency, the payload object serializer that was used encoding the payload.

Returns

payload serializer

Return type

int

static cast(buf)[source]
build(builder)[source]
class cfxdb.realmstore.Publications(slot=None, compress=None, build=None, cast=None)[source]

Bases: MapOidFlatBuffers

Persisted publications archive.

Map zlmdb.MapOidFlatBuffers from publication to cfxdb.eventstore.Publication.

Event


class cfxdb.realmstore.Event(from_fbs=None)[source]

Persisted event database object.

marshal()[source]
property timestamp

Timestamp when the event was sent to the receiver. Epoch time in ns.

Returns

Epoc time in ns.

Return type

int

property subscription

The subscription ID this event is dispatched under.

Returns

The subscription ID.

Return type

int

property publication

The publication ID of the dispatched event.

Returns

The publication ID.

Return type

int

property receiver

The WAMP session ID of the receiver.

Returns

The receiver ID.

Return type

int

property retained

Whether the message was retained by the broker on the topic, rather than just published.

Returns

retained flag

Return type

bool

property acknowledged_delivery

Whether this Event was to be acknowledged by the receiver.

Returns

acknowledged delivery flag

Return type

bool

static cast(buf)[source]
build(builder)[source]
class cfxdb.realmstore.Events(slot=None, compress=None, build=None, cast=None)[source]

Bases: MapOidTimestampFlatBuffers

Persisted events archive.

Map zlmdb.MapOid3FlatBuffers from (subscription, time_ns) to cfxdb.eventstore.Event.