Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NullDatabaseProvider.cs
1using System;
2using System.Collections.Generic;
3using System.Threading.Tasks;
4using System.Xml;
8
9namespace Waher.Persistence
10{
15 {
20 {
21 }
22
27 public Task Insert(object Object) => Task.CompletedTask;
28
33 public Task Insert(params object[] Objects) => Task.CompletedTask;
34
39 public Task Insert(IEnumerable<object> Objects) => Task.CompletedTask;
40
46 public Task InsertLazy(object Object, ObjectCallback Callback) => Task.CompletedTask;
47
53 public Task InsertLazy(object[] Objects, ObjectsCallback Callback) => Task.CompletedTask;
54
60 public Task InsertLazy(IEnumerable<object> Objects, ObjectsCallback Callback) => Task.CompletedTask;
61
71 public Task<IEnumerable<T>> Find<T>(int Offset, int MaxCount, params string[] SortOrder)
72 where T : class
73 {
74 return Task.FromResult<IEnumerable<T>>(new T[0]);
75 }
76
87 public Task<IEnumerable<T>> Find<T>(int Offset, int MaxCount, Filter Filter, params string[] SortOrder)
88 where T : class
89 {
90 return Task.FromResult<IEnumerable<T>>(new T[0]);
91 }
92
102 public Task<IEnumerable<object>> Find(string Collection, int Offset, int MaxCount, params string[] SortOrder)
103 {
104 return Task.FromResult<IEnumerable<object>>(new object[0]);
105 }
106
117 public Task<IEnumerable<object>> Find(string Collection, int Offset, int MaxCount, Filter Filter, params string[] SortOrder)
118 {
119 return Task.FromResult<IEnumerable<object>>(new object[0]);
120 }
121
133 public Task<IEnumerable<T>> Find<T>(string Collection, int Offset, int MaxCount, Filter Filter, params string[] SortOrder)
134 where T : class
135 {
136 return Task.FromResult<IEnumerable<T>>(new T[0]);
137 }
138
147 public Task<IPage<T>> FindFirst<T>(int PageSize, params string[] SortOrder)
148 where T : class
149 {
150 return Task.FromResult<IPage<T>>(new EmptyPage<T>());
151 }
152
162 public Task<IPage<T>> FindFirst<T>(int PageSize, Filter Filter, params string[] SortOrder)
163 where T : class
164 {
165 return Task.FromResult<IPage<T>>(new EmptyPage<T>());
166 }
167
176 public Task<IPage<object>> FindFirst(string Collection, int PageSize, params string[] SortOrder)
177 {
178 return Task.FromResult<IPage<object>>(new EmptyPage<object>());
179 }
180
190 public Task<IPage<object>> FindFirst(string Collection, int PageSize, Filter Filter, params string[] SortOrder)
191 {
192 return Task.FromResult<IPage<object>>(new EmptyPage<object>());
193 }
194
205 public Task<IPage<T>> FindFirst<T>(string Collection, int PageSize, Filter Filter, params string[] SortOrder)
206 where T : class
207 {
208 return Task.FromResult<IPage<T>>(new EmptyPage<T>());
209 }
210
217 public Task<IPage<T>> FindNext<T>(IPage<T> Page)
218 where T : class
219 {
220 return Task.FromResult<IPage<T>>(new EmptyPage<T>());
221 }
222
228 public Task<IPage<object>> FindNext(IPage<object> Page)
229 {
230 return Task.FromResult<IPage<object>>(new EmptyPage<object>());
231 }
232
237 public Task Update(object Object) => Task.CompletedTask;
238
243 public Task Update(params object[] Objects) => Task.CompletedTask;
244
249 public Task Update(IEnumerable<object> Objects) => Task.CompletedTask;
250
256 public Task UpdateLazy(object Object, ObjectCallback Callback) => Task.CompletedTask;
257
263 public Task UpdateLazy(object[] Objects, ObjectsCallback Callback) => Task.CompletedTask;
264
270 public Task UpdateLazy(IEnumerable<object> Objects, ObjectsCallback Callback) => Task.CompletedTask;
271
276 public Task Delete(object Object) => Task.CompletedTask;
277
282 public Task Delete(params object[] Objects) => Task.CompletedTask;
283
288 public Task Delete(IEnumerable<object> Objects) => Task.CompletedTask;
289
295 public Task DeleteLazy(object Object, ObjectCallback Callback) => Task.CompletedTask;
296
302 public Task DeleteLazy(object[] Objects, ObjectsCallback Callback) => Task.CompletedTask;
303
309 public Task DeleteLazy(IEnumerable<object> Objects, ObjectsCallback Callback) => Task.CompletedTask;
310
320 public Task<IEnumerable<T>> FindDelete<T>(int Offset, int MaxCount, params string[] SortOrder)
321 where T : class
322 {
323 return Task.FromResult<IEnumerable<T>>(new T[0]);
324 }
325
336 public Task<IEnumerable<T>> FindDelete<T>(int Offset, int MaxCount, Filter Filter, params string[] SortOrder)
337 where T : class
338 {
339 return Task.FromResult<IEnumerable<T>>(new T[0]);
340 }
341
351 public Task<IEnumerable<object>> FindDelete(string Collection, int Offset, int MaxCount, params string[] SortOrder)
352 {
353 return Task.FromResult<IEnumerable<object>>(new object[0]);
354 }
355
366 public Task<IEnumerable<object>> FindDelete(string Collection, int Offset, int MaxCount, Filter Filter, params string[] SortOrder)
367 {
368 return Task.FromResult<IEnumerable<object>>(new object[0]);
369 }
370
380 public Task DeleteLazy<T>(int Offset, int MaxCount, string[] SortOrder, ObjectsCallback Callback)
381 where T : class => Task.CompletedTask;
382
393 public Task DeleteLazy<T>(int Offset, int MaxCount, Filter Filter, string[] SortOrder, ObjectsCallback Callback)
394 where T : class => Task.CompletedTask;
395
405 public Task DeleteLazy(string Collection, int Offset, int MaxCount, string[] SortOrder, ObjectsCallback Callback) => Task.CompletedTask;
406
417 public Task DeleteLazy(string Collection, int Offset, int MaxCount, Filter Filter, string[] SortOrder, ObjectsCallback Callback) => Task.CompletedTask;
418
425 public Task<T> TryLoadObject<T>(object ObjectId)
426 where T : class
427 {
428 return default;
429 }
430
438 public Task<T> TryLoadObject<T>(string CollectionName, object ObjectId)
439 where T : class
440 {
441 return default;
442 }
443
450 public Task<object> TryLoadObject(string CollectionName, object ObjectId)
451 {
452 return null;
453 }
454
461 public Task<bool> Export(IDatabaseExport Output, string[] CollectionNames) => Task.FromResult(true);
462
470 public Task<bool> Export(IDatabaseExport Output, string[] CollectionNames, ProfilerThread Thread) => Task.FromResult(true);
471
479 public Task Iterate<T>(IDatabaseIteration<T> Recipient, string[] CollectionNames)
480 where T : class
481 {
482 return Task.CompletedTask;
483 }
484
493 public Task Iterate<T>(IDatabaseIteration<T> Recipient, string[] CollectionNames, ProfilerThread Thread)
494 where T : class
495 {
496 return Task.CompletedTask;
497 }
498
504 public Task Clear(string CollectionName) => Task.CompletedTask;
505
514 public Task<string[]> Analyze(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData)
515 {
516 return Task.FromResult(new string[0]);
517 }
518
528 public Task<string[]> Analyze(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData, ProfilerThread Thread)
529 {
530 return Task.FromResult(new string[0]);
531 }
532
541 public Task<string[]> Repair(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData)
542 {
543 return Task.FromResult(new string[0]);
544 }
545
555 public Task<string[]> Repair(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData, ProfilerThread Thread)
556 {
557 return Task.FromResult(new string[0]);
558 }
559
569 public Task<string[]> Analyze(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData, bool Repair)
570 {
571 return Task.FromResult(new string[0]);
572 }
573
584 public Task<string[]> Analyze(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData, bool Repair, ProfilerThread Thread)
585 {
586 return Task.FromResult(new string[0]);
587 }
588
594 public Task<string[]> Repair(params string[] CollectionNames)
595 {
596 return Task.FromResult(new string[0]);
597 }
598
605 public Task<string[]> Repair(ProfilerThread Thread, params string[] CollectionNames)
606 {
607 return Task.FromResult(new string[0]);
608 }
609
616 public Task AddIndex(string CollectionName, string[] FieldNames) => Task.CompletedTask;
617
624 public Task RemoveIndex(string CollectionName, string[] FieldNames) => Task.CompletedTask;
625
629 public Task StartBulk() => Task.CompletedTask;
630
634 public Task EndBulk() => Task.CompletedTask;
635
639 public Task Start() => Task.CompletedTask;
640
644 public Task Stop() => Task.CompletedTask;
645
649 public Task Flush() => Task.CompletedTask;
650
654 public int ObjectIdByteCount => 0;
655
661 public Task<IPersistentDictionary> GetDictionary(string Collection) => throw new InvalidOperationException("Server is shutting down.");
662
667 public Task<string[]> GetDictionaries() => Task.FromResult(new string[0]);
668
673 public Task<string[]> GetCollections()
674 {
675 return Task.FromResult(new string[0]);
676 }
677
683 public Task<string> GetCollection(Type Type)
684 {
685 return Task.FromResult(string.Empty);
686 }
687
693 public Task<string> GetCollection(Object Object)
694 {
695 return Task.FromResult(string.Empty);
696 }
697
705 public Task<bool> IsLabel(string Collection, string Label)
706 {
707 return Task.FromResult(false);
708 }
709
714 public Task<string[]> GetLabels(string Collection)
715 {
716 return Task.FromResult(new string[0]);
717 }
718
724 public Task<object> TryGetObjectId(object Object)
725 {
726 return Task.FromResult<object>(null);
727 }
728
733 public Task DropCollection(string CollectionName) => Task.CompletedTask;
734
740 public Task<GenericObject> Generalize(object Object) => Task.FromResult<GenericObject>(null);
741
747 public Task<object> Specialize(GenericObject Object) => Task.FromResult<object>(null);
748
753 public string[] GetExcludedCollections() => new string[0];
754 }
755}
Represents an empty page of items.
Definition: EmptyPage.cs:12
Base class for all filter classes.
Definition: Filter.cs:15
Task< string[]> GetLabels(string Collection)
Gets an array of available labels for a collection.
Task Delete(params object[] Objects)
Deletes a collection of objects in the database.
string[] GetExcludedCollections()
Gets an array of collections that should be excluded from backups.
Task Flush()
Persists any pending changes.
Task< object > TryLoadObject(string CollectionName, object ObjectId)
Tries to load an object given its Object ID ObjectId and its collection name CollectionName .
Task Insert(object Object)
Inserts an object into the database.
Task DeleteLazy(string Collection, int Offset, int MaxCount, string[] SortOrder, ObjectsCallback Callback)
Finds objects in a given collection and deletes them in the same atomic operation.
Task< IEnumerable< T > > Find< T >(int Offset, int MaxCount, params string[] SortOrder)
Finds objects of a given class T .
Task< IPage< object > > FindNext(IPage< object > Page)
Finds the next page of objects in a given collection.
Task< string[]> Analyze(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData, bool Repair, ProfilerThread Thread)
Analyzes the database and exports findings to XML.
Task< IEnumerable< object > > Find(string Collection, int Offset, int MaxCount, params string[] SortOrder)
Finds objects in a given collection.
Task Update(IEnumerable< object > Objects)
Updates a collection of objects in the database.
Task DeleteLazy(object[] Objects, ObjectsCallback Callback)
Deletes a collection of objects in the database, if unlocked. If locked, objects will be deleted at n...
Task< bool > Export(IDatabaseExport Output, string[] CollectionNames)
Performs an export of the database.
Task< IEnumerable< object > > FindDelete(string Collection, int Offset, int MaxCount, params string[] SortOrder)
Finds objects in a given collection and deletes them in the same atomic operation.
Task Insert(IEnumerable< object > Objects)
Inserts a collection of objects into the database.
Task DeleteLazy(IEnumerable< object > Objects, ObjectsCallback Callback)
Deletes a collection of objects in the database, if unlocked. If locked, objects will be deleted at n...
Task DeleteLazy(string Collection, int Offset, int MaxCount, Filter Filter, string[] SortOrder, ObjectsCallback Callback)
Finds objects in a given collection and deletes them in the same atomic operation.
Task< IPage< object > > FindFirst(string Collection, int PageSize, params string[] SortOrder)
Finds the first page of objects in a given collection.
Task< string[]> Repair(ProfilerThread Thread, params string[] CollectionNames)
Repairs a set of collections.
Task< IEnumerable< T > > FindDelete< T >(int Offset, int MaxCount, params string[] SortOrder)
Finds objects of a given class T and deletes them in the same atomic operation.
Task< IPage< T > > FindNext< T >(IPage< T > Page)
Finds the next page of objects of a given class T .
Task Clear(string CollectionName)
Clears a collection of all objects.
Task InsertLazy(object[] Objects, ObjectsCallback Callback)
Inserts an object into the database, if unlocked. If locked, object will be inserted at next opportun...
Task Start()
Called when processing starts.
Task EndBulk()
Ends bulk-processing of data. Must be called once for every call to StartBulk.
Task AddIndex(string CollectionName, string[] FieldNames)
Adds an index to a collection, if one does not already exist.
Task< IEnumerable< object > > Find(string Collection, int Offset, int MaxCount, Filter Filter, params string[] SortOrder)
Finds objects in a given collection.
Task< string[]> Repair(params string[] CollectionNames)
Repairs a set of collections.
Task Update(object Object)
Updates an object in the database.
Task Update(params object[] Objects)
Updates a collection of objects in the database.
Task< IPersistentDictionary > GetDictionary(string Collection)
Gets a persistent dictionary containing objects in a collection.
Task Delete(IEnumerable< object > Objects)
Deletes a collection of objects in the database.
Task< string > GetCollection(Object Object)
Gets the collection corresponding to a given object.
Task< GenericObject > Generalize(object Object)
Creates a generalized representation of an object.
Task StartBulk()
Starts bulk-proccessing of data. Must be followed by a call to EndBulk.
Task UpdateLazy(object[] Objects, ObjectsCallback Callback)
Updates a collection of objects in the database, if unlocked. If locked, objects will be updated at n...
Task< string[]> Analyze(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData, ProfilerThread Thread)
Analyzes the database and exports findings to XML.
Task< IPage< object > > FindFirst(string Collection, int PageSize, Filter Filter, params string[] SortOrder)
Finds the first page of objects in a given collection.
Task UpdateLazy(IEnumerable< object > Objects, ObjectsCallback Callback)
Updates a collection of objects in the database, if unlocked. If locked, objects will be updated at n...
Task DeleteLazy< T >(int Offset, int MaxCount, string[] SortOrder, ObjectsCallback Callback)
Finds objects of a given class T and deletes them in the same atomic operation.
Task< string > GetCollection(Type Type)
Gets the collection corresponding to a given type.
Task RemoveIndex(string CollectionName, string[] FieldNames)
Removes an index from a collection, if one exist.
Task< bool > Export(IDatabaseExport Output, string[] CollectionNames, ProfilerThread Thread)
Performs an export of the database.
Task Delete(object Object)
Deletes an object in the database.
Task DropCollection(string CollectionName)
Drops a collection, if it exist.
Task< IPage< T > > FindFirst< T >(int PageSize, params string[] SortOrder)
Finds the first page of objects of a given class T .
Task Insert(params object[] Objects)
Inserts a collection of objects into the database.
Task< object > TryGetObjectId(object Object)
Tries to get the Object ID of an object, if it exists.
Task< string[]> Analyze(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData)
Analyzes the database and exports findings to XML.
Task InsertLazy(object Object, ObjectCallback Callback)
Inserts an object into the database, if unlocked. If locked, object will be inserted at next opportun...
Task< string[]> Analyze(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData, bool Repair)
Analyzes the database and exports findings to XML.
Task< string[]> GetDictionaries()
Gets an array of available dictionary collections.
Task< string[]> GetCollections()
Gets an array of available collections.
Task UpdateLazy(object Object, ObjectCallback Callback)
Updates an object in the database, if unlocked. If locked, object will be updated at next opportunity...
Task< IEnumerable< object > > FindDelete(string Collection, int Offset, int MaxCount, Filter Filter, params string[] SortOrder)
Finds objects in a given collection and deletes them in the same atomic operation.
Task< string[]> Repair(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData)
Analyzes the database and repairs it if necessary. Results are exported to XML.
Task< object > Specialize(GenericObject Object)
Creates a specialized representation of a generic object.
Task DeleteLazy(object Object, ObjectCallback Callback)
Deletes an object in the database, if unlocked. If locked, object will be deleted at next opportunity...
Task< bool > IsLabel(string Collection, string Label)
Checks if a string is a label in a given collection.
Task InsertLazy(IEnumerable< object > Objects, ObjectsCallback Callback)
Inserts an object into the database, if unlocked. If locked, object will be inserted at next opportun...
Task< string[]> Repair(XmlWriter Output, string XsltPath, string ProgramDataFolder, bool ExportData, ProfilerThread Thread)
Analyzes the database and repairs it if necessary. Results are exported to XML.
Task Stop()
Called when processing ends.
Generic object. Contains a sequence of properties.
Class that keeps track of events and timing for one thread.
Interface for database providers that can be plugged into the static Database class.
Interface for paginated results.
Definition: IPage.cs:11
Interface for iterations of database contents.
delegate void ObjectCallback(object Object)
Method called when a process has completed for an object.
delegate void ObjectsCallback(IEnumerable< object > Objects)
Method called when a process has completed for a set of objects.