Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Waher.Persistence.Ledger Class Reference

Static interface for ledger persistence. In order to work, a ledger provider has to be assigned to it. This is ideally done as one of the first steps in the startup of an application. More...

Static Public Member Functions

static void Register (ILedgerProvider LedgerProvider)
 Registers a ledger provider for use from the static Ledger class, throughout the lifetime of the application. More...
 
static void Register (ILedgerProvider LedgerProvider, bool Lock)
 Registers a ledger provider for use from the static Ledger class, throughout the lifetime of the application. More...
 
static async Task NewEntry (object Object)
 Adds an entry to the ledger. More...
 
static async Task UpdatedEntry (object Object)
 Updates an entry in the ledger. More...
 
static async Task DeletedEntry (object Object)
 Deletes an entry in the ledger. More...
 
static async Task ClearedCollection (string Collection)
 Clears a collection in the ledger. More...
 
static Task< ILedgerEnumerator< T > > GetEnumerator< T > ()
 Gets an eumerator for objects of type T . More...
 
static Task< ILedgerEnumerator< object > > GetEnumerator (string CollectionName)
 Gets an eumerator for objects in a collection. More...
 
static Task< string[]> GetCollections ()
 Gets an array of available collections. More...
 
static Task< bool > Export (ILedgerExport Output)
 Performs an export of the entire ledger. More...
 
static Task< bool > Export (ILedgerExport Output, LedgerExportRestriction Restriction)
 Performs an export of the entire ledger. More...
 
static Task< bool > Export (ILedgerExport Output, LedgerExportRestriction Restriction, ProfilerThread Thread)
 Performs an export of the entire ledger. More...
 
static void StartListeningToDatabaseEvents ()
 Makes the ledger listen on database events. Each call to StartListeningToDatabaseEvents must be followed by a call to StopListeningToDatabaseEvents when listening should stop. More...
 
static void StopListeningToDatabaseEvents ()
 Makes the ledger listen on database events. Each call to StartListeningToDatabaseEvents must be followed by a call to StopListeningToDatabaseEvents when listening should stop. More...
 

Properties

static ILedgerProvider Provider [get]
 Registered ledger provider. More...
 
static bool HasProvider [get]
 If a ledger provider is registered. More...
 
static bool Locked [get]
 If the datbase provider has been locked for the rest of the run-time of the application. More...
 

Events

static ObjectEventHandler EntryAdded = null
 Event raised when an entry has been added to the ledger. More...
 
static ObjectEventHandler EntryUpdated = null
 Event raised when an entry has been updated in the ledger. More...
 
static ObjectEventHandler EntryDeleted = null
 Event raised when an entry has been deleted in the ledger. More...
 
static CollectionEventHandler CollectionCleared = null
 Event raised when a collection has been cleared. More...
 

Detailed Description

Static interface for ledger persistence. In order to work, a ledger provider has to be assigned to it. This is ideally done as one of the first steps in the startup of an application.

Definition at line 13 of file Ledger.cs.

Member Function Documentation

◆ ClearedCollection()

static async Task Waher.Persistence.Ledger.ClearedCollection ( string  Collection)
static

Clears a collection in the ledger.

Parameters
CollectionCleared collection.

Definition at line 211 of file Ledger.cs.

◆ DeletedEntry()

static async Task Waher.Persistence.Ledger.DeletedEntry ( object  Object)
static

Deletes an entry in the ledger.

Parameters
ObjectDeleted object.

Definition at line 180 of file Ledger.cs.

◆ Export() [1/3]

static Task< bool > Waher.Persistence.Ledger.Export ( ILedgerExport  Output)
static

Performs an export of the entire ledger.

Parameters
OutputLedger will be output to this interface.
Returns
If export process was completed (true), or terminated by Output (false).

Definition at line 272 of file Ledger.cs.

◆ Export() [2/3]

static Task< bool > Waher.Persistence.Ledger.Export ( ILedgerExport  Output,
LedgerExportRestriction  Restriction 
)
static

Performs an export of the entire ledger.

Parameters
OutputLedger will be output to this interface.
RestrictionOptional restrictions to apply. If null, all information available in the ledger will be exported.
Returns
If export process was completed (true), or terminated by Output (false).

Definition at line 284 of file Ledger.cs.

◆ Export() [3/3]

static Task< bool > Waher.Persistence.Ledger.Export ( ILedgerExport  Output,
LedgerExportRestriction  Restriction,
ProfilerThread  Thread 
)
static

Performs an export of the entire ledger.

Parameters
OutputLedger will be output to this interface.
RestrictionOptional restrictions to apply. If null, all information available in the ledger will be exported.
ThreadOptional Profiler thread.
Returns
If export process was completed (true), or terminated by Output (false).

Definition at line 297 of file Ledger.cs.

◆ GetCollections()

static Task< string[]> Waher.Persistence.Ledger.GetCollections ( )
static

Gets an array of available collections.

Returns
Array of collections.

Definition at line 262 of file Ledger.cs.

◆ GetEnumerator()

static Task< ILedgerEnumerator< object > > Waher.Persistence.Ledger.GetEnumerator ( string  CollectionName)
static

Gets an eumerator for objects in a collection.

Parameters
CollectionNameCollection to enumerate.
Returns
Enumerator object.

Definition at line 253 of file Ledger.cs.

◆ GetEnumerator< T >()

static Task< ILedgerEnumerator< T > > Waher.Persistence.Ledger.GetEnumerator< T > ( )
static

Gets an eumerator for objects of type T .

Template Parameters
TType of object entries to enumerate.
Returns
Enumerator object.

Definition at line 243 of file Ledger.cs.

◆ NewEntry()

static async Task Waher.Persistence.Ledger.NewEntry ( object  Object)
static

Adds an entry to the ledger.

Parameters
ObjectNew object.

Definition at line 118 of file Ledger.cs.

◆ Register() [1/2]

static void Waher.Persistence.Ledger.Register ( ILedgerProvider  LedgerProvider)
static

Registers a ledger provider for use from the static Ledger class, throughout the lifetime of the application.

Note: Only one ledger provider can be registered.

Parameters
LedgerProviderLedger provider to use.

Definition at line 25 of file Ledger.cs.

◆ Register() [2/2]

static void Waher.Persistence.Ledger.Register ( ILedgerProvider  LedgerProvider,
bool  Lock 
)
static

Registers a ledger provider for use from the static Ledger class, throughout the lifetime of the application.

Note: Only one ledger provider can be registered.

Parameters
LedgerProviderLedger provider to use.
LockIf the ledger provider should be locked for the rest of the running time of the application.

Definition at line 38 of file Ledger.cs.

◆ StartListeningToDatabaseEvents()

static void Waher.Persistence.Ledger.StartListeningToDatabaseEvents ( )
static

Makes the ledger listen on database events. Each call to StartListeningToDatabaseEvents must be followed by a call to StopListeningToDatabaseEvents when listening should stop.

Definition at line 310 of file Ledger.cs.

◆ StopListeningToDatabaseEvents()

static void Waher.Persistence.Ledger.StopListeningToDatabaseEvents ( )
static

Makes the ledger listen on database events. Each call to StartListeningToDatabaseEvents must be followed by a call to StopListeningToDatabaseEvents when listening should stop.

Definition at line 332 of file Ledger.cs.

◆ UpdatedEntry()

static async Task Waher.Persistence.Ledger.UpdatedEntry ( object  Object)
static

Updates an entry in the ledger.

Parameters
ObjectUpdated object.

Definition at line 149 of file Ledger.cs.

Property Documentation

◆ HasProvider

bool Waher.Persistence.Ledger.HasProvider
staticget

If a ledger provider is registered.

Definition at line 104 of file Ledger.cs.

◆ Locked

bool Waher.Persistence.Ledger.Locked
staticget

If the datbase provider has been locked for the rest of the run-time of the application.

Definition at line 112 of file Ledger.cs.

◆ Provider

ILedgerProvider Waher.Persistence.Ledger.Provider
staticget

Registered ledger provider.

Definition at line 82 of file Ledger.cs.

Event Documentation

◆ CollectionCleared

CollectionEventHandler Waher.Persistence.Ledger.CollectionCleared = null
static

Event raised when a collection has been cleared.

Definition at line 236 of file Ledger.cs.

◆ EntryAdded

ObjectEventHandler Waher.Persistence.Ledger.EntryAdded = null
static

Event raised when an entry has been added to the ledger.

Definition at line 143 of file Ledger.cs.

◆ EntryDeleted

ObjectEventHandler Waher.Persistence.Ledger.EntryDeleted = null
static

Event raised when an entry has been deleted in the ledger.

Definition at line 205 of file Ledger.cs.

◆ EntryUpdated

ObjectEventHandler Waher.Persistence.Ledger.EntryUpdated = null
static

Event raised when an entry has been updated in the ledger.

Definition at line 174 of file Ledger.cs.


The documentation for this class was generated from the following file: