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

Class handling the reception of data from a query. More...

Inheritance diagram for Waher.Things.Queries.Query:
Waher.Events.IObservableLayer Waher.Things.Queries.CompoundQuery

Public Member Functions

 Query (string CommandId, string QueryId, object State, Language Language, INode NodeReference, RequestOrigin Origin)
 Class handling the reception of data from a query. More...
 
int NextSequenceNumber ()
 Gets the next sequence number. More...
 
virtual async Task Abort ()
 Aborts the query. More...
 
Task Start ()
 Starts query execution. More...
 
async Task Done ()
 Query execution completed. More...
 
Task NewTable (string TableId, string TableName, params Column[] Columns)
 Defines a new table in the query output. More...
 
Task NewRecords (string TableId, params Record[] Records)
 Reports a new set of records in a table. More...
 
Task TableDone (string TableId)
 Reports a table as being complete. More...
 
Task NewObject (object Object)
 Reports a new object. More...
 
Task LogMessage (Exception Exception)
 Logs an Exception as a query message. More...
 
Task LogMessage (QueryEventLevel Level, Exception Exception)
 Logs an Exception as a query message. More...
 
Task LogMessage (QueryEventType Type, QueryEventLevel Level, string Body)
 Logs a query message. More...
 
Task SetTitle (string Title)
 Sets the title of the report. More...
 
Task SetStatus (string Status)
 Sets the current status of the query execution. More...
 
Task BeginSection (string Header)
 Begins a new section. Sections can be nested. Each call to BeginSection(string) must be followed by a call to EndSection(). More...
 
Task EndSection ()
 Ends a section. Each call to BeginSection(string) must be followed by a call to EndSection(). More...
 
void Information (string Comment)
 Called to inform the viewer of something. More...
 
void Warning (string Warning)
 Called to inform the viewer of a warning state. More...
 
void Error (string Error)
 Called to inform the viewer of an error state. More...
 
void Exception (Exception Exception)
 Called to inform the viewer of an exception state. More...
 
void Exception (string Exception)
 Called to inform the viewer of an exception state. More...
 
void Information (DateTime Timestamp, string Comment)
 Called to inform the viewer of something. More...
 
void Warning (DateTime Timestamp, string Warning)
 Called to inform the viewer of a warning state. More...
 
void Error (DateTime Timestamp, string Error)
 Called to inform the viewer of an error state. More...
 
void Exception (DateTime Timestamp, string Exception)
 Called to inform the viewer of an exception state. More...
 
void Exception (DateTime Timestamp, Exception Exception)
 Called to inform the viewer of an exception state. More...
 

Properties

string CommandID [get]
 Command ID More...
 
string QueryID [get]
 Query ID More...
 
object State [get]
 State object. More...
 
Language Language [get]
 Language of query. More...
 
INode NodeReference [get]
 Node reference. More...
 
RequestOrigin Origin [get]
 Origin of request to execute the query. More...
 
bool IsStarted [get]
 If the query has been started. More...
 
bool IsAborted [get]
 If the query is aborted. More...
 
bool IsDone [get]
 If the query is done. More...
 
int SequenceNumber [get]
 Curernt sequence number counter. More...
 
int NrSectionsBegun [get]
 Number of sectios begun. More...
 
int NrSectionsEnded [get]
 Number of sectios ended. More...
 
int NrTablesStarted [get]
 Number of tables started. More...
 
int NrTablesCompleted [get]
 Number of tables compeleted. More...
 
int NrObjectsReported [get]
 Number of objects reported. More...
 
int NrMessagesReported [get]
 Number of messages reported. More...
 
int NrRecordsReported [get]
 Number of records reported. More...
 
int NrTotalItemsReported [get]
 Number of items (total) reported. More...
 
bool HasTitle [get]
 If a title has been set More...
 
bool HasReported [get]
 If anything has been reported. More...
 
bool DecoupledEvents [get]
 If events raised from the communication layer are decoupled, i.e. executed in parallel with the source that raised them. More...
 

Events

EventHandlerAsync< QueryEventArgsOnAborted = null
 Event raised when the query has been aborted. More...
 
EventHandlerAsync< QueryEventArgsOnStarted = null
 Event raised when the query has been aborted. More...
 
EventHandlerAsync< QueryEventArgsOnDone = null
 Event raised when query has been completed. More...
 
EventHandlerAsync< QueryNewTableEventArgsOnNewTable = null
 Event raised when a new table has been created. More...
 
EventHandlerAsync< QueryNewRecordsEventArgsOnNewRecords = null
 Event raised when new records are reported for a table. More...
 
EventHandlerAsync< QueryTableEventArgsOnTableDone = null
 Event raised when a table is completed. More...
 
EventHandlerAsync< QueryObjectEventArgsOnNewObject = null
 Event raised when new records are reported for a table. More...
 
EventHandlerAsync< QueryMessageEventArgsOnMessage = null
 Event raised when a new message has been received. More...
 
EventHandlerAsync< QueryTitleEventArgsOnTitle = null
 Event raised when the report title has been set. More...
 
EventHandlerAsync< QueryStatusEventArgsOnStatus = null
 Event raised when the current status changes. More...
 
EventHandlerAsync< QueryTitleEventArgsOnBeginSection = null
 Event raised when a new section is created. More...
 
EventHandlerAsync< QueryEventArgsOnEndSection = null
 Event raised when a section is closed. More...
 

Detailed Description

Class handling the reception of data from a query.

Definition at line 11 of file Query.cs.

Constructor & Destructor Documentation

◆ Query()

Waher.Things.Queries.Query.Query ( string  CommandId,
string  QueryId,
object  State,
Language  Language,
INode  NodeReference,
RequestOrigin  Origin 
)

Class handling the reception of data from a query.

Parameters
CommandIdCommand ID
QueryIdQuery ID
StateState object.
LanguageLanguage of query.
NodeReferenceNode reference.
OriginOrigin of request to execute the query.

Definition at line 41 of file Query.cs.

Member Function Documentation

◆ Abort()

virtual async Task Waher.Things.Queries.Query.Abort ( )
virtual

Aborts the query.

Reimplemented in Waher.Things.Queries.CompoundQuery.

Definition at line 177 of file Query.cs.

◆ BeginSection()

Task Waher.Things.Queries.Query.BeginSection ( string  Header)

Begins a new section. Sections can be nested. Each call to BeginSection(string) must be followed by a call to EndSection().

Parameters
HeaderSection Title.

Definition at line 483 of file Query.cs.

◆ Done()

async Task Waher.Things.Queries.Query.Done ( )

Query execution completed.

Definition at line 241 of file Query.cs.

◆ EndSection()

Task Waher.Things.Queries.Query.EndSection ( )

Ends a section. Each call to BeginSection(string) must be followed by a call to EndSection().

Definition at line 504 of file Query.cs.

◆ Error() [1/2]

void Waher.Things.Queries.Query.Error ( DateTime  Timestamp,
string  Error 
)

Called to inform the viewer of an error state.

Parameters
TimestampTimestamp of event.
ErrorError.

Implements Waher.Events.IObservableLayer.

◆ Error() [2/2]

void Waher.Things.Queries.Query.Error ( string  Error)

Called to inform the viewer of an error state.

Parameters
ErrorError.

Implements Waher.Events.IObservableLayer.

◆ Exception() [1/4]

void Waher.Things.Queries.Query.Exception ( DateTime  Timestamp,
Exception  Exception 
)

Called to inform the viewer of an exception state.

Parameters
TimestampTimestamp of event.
ExceptionException.

Implements Waher.Events.IObservableLayer.

◆ Exception() [2/4]

void Waher.Things.Queries.Query.Exception ( DateTime  Timestamp,
string  Exception 
)

Called to inform the viewer of an exception state.

Parameters
TimestampTimestamp of event.
ExceptionException.

Implements Waher.Events.IObservableLayer.

◆ Exception() [3/4]

void Waher.Things.Queries.Query.Exception ( Exception  Exception)

Called to inform the viewer of an exception state.

Parameters
ExceptionException.

Implements Waher.Events.IObservableLayer.

◆ Exception() [4/4]

void Waher.Things.Queries.Query.Exception ( string  Exception)

Called to inform the viewer of an exception state.

Parameters
ExceptionException.

Implements Waher.Events.IObservableLayer.

◆ Information() [1/2]

void Waher.Things.Queries.Query.Information ( DateTime  Timestamp,
string  Comment 
)

Called to inform the viewer of something.

Parameters
TimestampTimestamp of event.
CommentComment.

Implements Waher.Events.IObservableLayer.

◆ Information() [2/2]

void Waher.Things.Queries.Query.Information ( string  Comment)

Called to inform the viewer of something.

Parameters
CommentComment.

Implements Waher.Events.IObservableLayer.

◆ LogMessage() [1/3]

Task Waher.Things.Queries.Query.LogMessage ( Exception  Exception)

Logs an Exception as a query message.

Parameters
ExceptionException being logged.

Definition at line 381 of file Query.cs.

◆ LogMessage() [2/3]

Task Waher.Things.Queries.Query.LogMessage ( QueryEventLevel  Level,
Exception  Exception 
)

Logs an Exception as a query message.

Parameters
LevelEvent level.
ExceptionException being logged.

Definition at line 391 of file Query.cs.

◆ LogMessage() [3/3]

Task Waher.Things.Queries.Query.LogMessage ( QueryEventType  Type,
QueryEventLevel  Level,
string  Body 
)

Logs a query message.

Parameters
TypeEvent type.
LevelEvent level.
BodyEvent message body.

Definition at line 403 of file Query.cs.

◆ NewObject()

Task Waher.Things.Queries.Query.NewObject ( object  Object)

Reports a new object.

Parameters
ObjectObject

Definition at line 354 of file Query.cs.

◆ NewRecords()

Task Waher.Things.Queries.Query.NewRecords ( string  TableId,
params Record[]  Records 
)

Reports a new set of records in a table.

Parameters
TableIdTable ID
RecordsNew records.

Definition at line 300 of file Query.cs.

◆ NewTable()

Task Waher.Things.Queries.Query.NewTable ( string  TableId,
string  TableName,
params Column[]  Columns 
)

Defines a new table in the query output.

Parameters
TableIdID of table.
TableNameLocalized name of table.
ColumnsColumns.

Definition at line 272 of file Query.cs.

◆ NextSequenceNumber()

int Waher.Things.Queries.Query.NextSequenceNumber ( )

Gets the next sequence number.

Returns
Next sequence number.

Definition at line 169 of file Query.cs.

◆ SetStatus()

Task Waher.Things.Queries.Query.SetStatus ( string  Status)

Sets the current status of the query execution.

Parameters
StatusStatus message.

Definition at line 457 of file Query.cs.

◆ SetTitle()

Task Waher.Things.Queries.Query.SetTitle ( string  Title)

Sets the title of the report.

Parameters
TitleTitle.

Definition at line 430 of file Query.cs.

◆ Start()

Task Waher.Things.Queries.Query.Start ( )

Starts query execution.

Definition at line 213 of file Query.cs.

◆ TableDone()

Task Waher.Things.Queries.Query.TableDone ( string  TableId)

Reports a table as being complete.

Parameters
TableIdID of table.

Definition at line 327 of file Query.cs.

◆ Warning() [1/2]

void Waher.Things.Queries.Query.Warning ( DateTime  Timestamp,
string  Warning 
)

Called to inform the viewer of a warning state.

Parameters
TimestampTimestamp of event.
WarningWarning.

Implements Waher.Events.IObservableLayer.

◆ Warning() [2/2]

void Waher.Things.Queries.Query.Warning ( string  Warning)

Called to inform the viewer of a warning state.

Parameters
WarningWarning.

Implements Waher.Events.IObservableLayer.

Property Documentation

◆ CommandID

string Waher.Things.Queries.Query.CommandID
get

Command ID

Definition at line 55 of file Query.cs.

◆ DecoupledEvents

bool Waher.Things.Queries.Query.DecoupledEvents
get

If events raised from the communication layer are decoupled, i.e. executed in parallel with the source that raised them.

Implements Waher.Events.IObservableLayer.

Definition at line 527 of file Query.cs.

◆ HasReported

bool Waher.Things.Queries.Query.HasReported
get

If anything has been reported.

Definition at line 163 of file Query.cs.

◆ HasTitle

bool Waher.Things.Queries.Query.HasTitle
get

If a title has been set

Definition at line 158 of file Query.cs.

◆ IsAborted

bool Waher.Things.Queries.Query.IsAborted
get

If the query is aborted.

Definition at line 90 of file Query.cs.

◆ IsDone

bool Waher.Things.Queries.Query.IsDone
get

If the query is done.

Definition at line 95 of file Query.cs.

◆ IsStarted

bool Waher.Things.Queries.Query.IsStarted
get

If the query has been started.

Definition at line 85 of file Query.cs.

◆ Language

Language Waher.Things.Queries.Query.Language
get

Language of query.

Definition at line 70 of file Query.cs.

◆ NodeReference

INode Waher.Things.Queries.Query.NodeReference
get

Node reference.

Definition at line 75 of file Query.cs.

◆ NrMessagesReported

int Waher.Things.Queries.Query.NrMessagesReported
get

Number of messages reported.

Definition at line 130 of file Query.cs.

◆ NrObjectsReported

int Waher.Things.Queries.Query.NrObjectsReported
get

Number of objects reported.

Definition at line 125 of file Query.cs.

◆ NrRecordsReported

int Waher.Things.Queries.Query.NrRecordsReported
get

Number of records reported.

Definition at line 135 of file Query.cs.

◆ NrSectionsBegun

int Waher.Things.Queries.Query.NrSectionsBegun
get

Number of sectios begun.

Definition at line 105 of file Query.cs.

◆ NrSectionsEnded

int Waher.Things.Queries.Query.NrSectionsEnded
get

Number of sectios ended.

Definition at line 110 of file Query.cs.

◆ NrTablesCompleted

int Waher.Things.Queries.Query.NrTablesCompleted
get

Number of tables compeleted.

Definition at line 120 of file Query.cs.

◆ NrTablesStarted

int Waher.Things.Queries.Query.NrTablesStarted
get

Number of tables started.

Definition at line 115 of file Query.cs.

◆ NrTotalItemsReported

int Waher.Things.Queries.Query.NrTotalItemsReported
get

Number of items (total) reported.

Definition at line 140 of file Query.cs.

◆ Origin

RequestOrigin Waher.Things.Queries.Query.Origin
get

Origin of request to execute the query.

Definition at line 80 of file Query.cs.

◆ QueryID

string Waher.Things.Queries.Query.QueryID
get

Query ID

Definition at line 60 of file Query.cs.

◆ SequenceNumber

int Waher.Things.Queries.Query.SequenceNumber
get

Curernt sequence number counter.

Definition at line 100 of file Query.cs.

◆ State

object Waher.Things.Queries.Query.State
get

State object.

Definition at line 65 of file Query.cs.

Event Documentation

◆ OnAborted

EventHandlerAsync<QueryEventArgs> Waher.Things.Queries.Query.OnAborted = null

Event raised when the query has been aborted.

Definition at line 208 of file Query.cs.

◆ OnBeginSection

EventHandlerAsync<QueryTitleEventArgs> Waher.Things.Queries.Query.OnBeginSection = null

Event raised when a new section is created.

Definition at line 498 of file Query.cs.

◆ OnDone

EventHandlerAsync<QueryEventArgs> Waher.Things.Queries.Query.OnDone = null

Event raised when query has been completed.

Definition at line 264 of file Query.cs.

◆ OnEndSection

EventHandlerAsync<QueryEventArgs> Waher.Things.Queries.Query.OnEndSection = null

Event raised when a section is closed.

Definition at line 519 of file Query.cs.

◆ OnMessage

EventHandlerAsync<QueryMessageEventArgs> Waher.Things.Queries.Query.OnMessage = null

Event raised when a new message has been received.

Definition at line 424 of file Query.cs.

◆ OnNewObject

EventHandlerAsync<QueryObjectEventArgs> Waher.Things.Queries.Query.OnNewObject = null

Event raised when new records are reported for a table.

Definition at line 375 of file Query.cs.

◆ OnNewRecords

EventHandlerAsync<QueryNewRecordsEventArgs> Waher.Things.Queries.Query.OnNewRecords = null

Event raised when new records are reported for a table.

Definition at line 321 of file Query.cs.

◆ OnNewTable

EventHandlerAsync<QueryNewTableEventArgs> Waher.Things.Queries.Query.OnNewTable = null

Event raised when a new table has been created.

Definition at line 293 of file Query.cs.

◆ OnStarted

EventHandlerAsync<QueryEventArgs> Waher.Things.Queries.Query.OnStarted = null

Event raised when the query has been aborted.

Definition at line 236 of file Query.cs.

◆ OnStatus

EventHandlerAsync<QueryStatusEventArgs> Waher.Things.Queries.Query.OnStatus = null

Event raised when the current status changes.

Definition at line 476 of file Query.cs.

◆ OnTableDone

EventHandlerAsync<QueryTableEventArgs> Waher.Things.Queries.Query.OnTableDone = null

Event raised when a table is completed.

Definition at line 348 of file Query.cs.

◆ OnTitle

EventHandlerAsync<QueryTitleEventArgs> Waher.Things.Queries.Query.OnTitle = null

Event raised when the report title has been set.

Definition at line 451 of file Query.cs.


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