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

Defines the Groups data source. This data source contains a tree structure of groups of nodes More...

Inheritance diagram for Waher.Groups.GroupSource:
Waher.Things.IDataSource

Public Member Functions

 GroupSource ()
 Defines the Metering Topology data source. This data source contains a tree structure of persistent readable and controllable devices More...
 
Task< string > GetNameAsync (Language Language)
 Gets the name of data source. More...
 
async Task< INodeGetNodeAsync (IThingReference NodeRef)
 Gets the node, given a reference to it. More...
 
Task< bool > CanViewAsync (RequestOrigin Caller)
 If the data source is visible to the caller. More...
 

Static Public Member Functions

static Task< GroupNodeGetNode (string NodeId)
 Gets a node from the Metering Topology More...
 
static async Task< GroupNodeGetNode (IThingReference NodeRef)
 Gets a node from the Metering Topology More...
 
static async Task< int > DeleteOldEvents (TimeSpan MaxAge)
 Deletes old data source events. More...
 
static async Task< int > DeleteOrphans ()
 Deletes orphaned nodes in the metering topology source. More...
 
static bool TryGetDataSource (string SourceId, out IDataSource Source)
 Tries to get a data source, given its Source ID. More...
 

Static Public Attributes

const string SourceID = "Groups"
 Source ID for the groups data source. More...
 

Properties

IEnumerable< IDataSourceChildSources [get]
 Child sources. If no child sources are available, null is returned. More...
 
bool HasChildren [get]
 If the source has any child sources. More...
 
DateTime LastChanged [get, set]
 When the source was last updated. More...
 
IEnumerable< INodeRootNodes [get]
 Root node references. If no root nodes are available, null is returned. More...
 
static Root Root [get]
 Root node. More...
 

Events

EventHandlerAsync< SourceEventOnEvent = null
 Event raised when a data source event has been raised. More...
 

Detailed Description

Defines the Groups data source. This data source contains a tree structure of groups of nodes

Definition at line 20 of file GroupSource.cs.

Constructor & Destructor Documentation

◆ GroupSource()

Waher.Groups.GroupSource.GroupSource ( )

Defines the Metering Topology data source. This data source contains a tree structure of persistent readable and controllable devices

Definition at line 39 of file GroupSource.cs.

Member Function Documentation

◆ CanViewAsync()

Task< bool > Waher.Groups.GroupSource.CanViewAsync ( RequestOrigin  Caller)

If the data source is visible to the caller.

Parameters
CallerInformation about caller.
Returns
If the source is visible to the caller.

Implements Waher.Things.IDataSource.

Definition at line 195 of file GroupSource.cs.

◆ DeleteOldEvents()

static async Task< int > Waher.Groups.GroupSource.DeleteOldEvents ( TimeSpan  MaxAge)
static

Deletes old data source events.

Parameters
MaxAgeMaximum age of events to keep.
Returns
Number of events deleted.

Definition at line 290 of file GroupSource.cs.

◆ DeleteOrphans()

static async Task< int > Waher.Groups.GroupSource.DeleteOrphans ( )
static

Deletes orphaned nodes in the metering topology source.

Returns
Number of nodes deleted.

Definition at line 332 of file GroupSource.cs.

◆ GetNameAsync()

Task< string > Waher.Groups.GroupSource.GetNameAsync ( Language  Language)

Gets the name of data source.

Parameters
LanguageLanguage to use.
Returns
Localized name of data source.

Implements Waher.Things.IDataSource.

Definition at line 81 of file GroupSource.cs.

◆ GetNode() [1/2]

static async Task< GroupNode > Waher.Groups.GroupSource.GetNode ( IThingReference  NodeRef)
static

Gets a node from the Metering Topology

Parameters
NodeRefNode reference
Returns
Node, if found, null otherwise.

Definition at line 111 of file GroupSource.cs.

◆ GetNode() [2/2]

static Task< GroupNode > Waher.Groups.GroupSource.GetNode ( string  NodeId)
static

Gets a node from the Metering Topology

Parameters
NodeIdNode ID
Returns
Node, if found, null otherwise.

Definition at line 101 of file GroupSource.cs.

◆ GetNodeAsync()

async Task< INode > Waher.Groups.GroupSource.GetNodeAsync ( IThingReference  NodeRef)

Gets the node, given a reference to it.

Parameters
NodeRefNode reference.
Returns
Node, if found, null otherwise.

Implements Waher.Things.IDataSource.

Definition at line 91 of file GroupSource.cs.

◆ TryGetDataSource()

static bool Waher.Groups.GroupSource.TryGetDataSource ( string  SourceId,
out IDataSource  Source 
)
static

Tries to get a data source, given its Source ID.

Parameters
SourceIdData Source ID.
SourceSource, if found.
Returns
If a source was found with the corresponding ID.

Definition at line 363 of file GroupSource.cs.

Member Data Documentation

◆ SourceID

const string Waher.Groups.GroupSource.SourceID = "Groups"
static

Source ID for the groups data source.

Definition at line 25 of file GroupSource.cs.

Property Documentation

◆ ChildSources

IEnumerable<IDataSource> Waher.Groups.GroupSource.ChildSources
get

Child sources. If no child sources are available, null is returned.

Implements Waher.Things.IDataSource.

Definition at line 53 of file GroupSource.cs.

◆ HasChildren

bool Waher.Groups.GroupSource.HasChildren
get

If the source has any child sources.

Implements Waher.Things.IDataSource.

Definition at line 58 of file GroupSource.cs.

◆ LastChanged

DateTime Waher.Groups.GroupSource.LastChanged
getset

When the source was last updated.

Implements Waher.Things.IDataSource.

Definition at line 63 of file GroupSource.cs.

◆ Root

Root Waher.Groups.GroupSource.Root
staticget

Root node.

Definition at line 217 of file GroupSource.cs.

◆ RootNodes

IEnumerable<INode> Waher.Groups.GroupSource.RootNodes
get

Root node references. If no root nodes are available, null is returned.

Implements Waher.Things.IDataSource.

Definition at line 203 of file GroupSource.cs.

Event Documentation

◆ OnEvent

EventHandlerAsync<SourceEvent> Waher.Groups.GroupSource.OnEvent = null

Event raised when a data source event has been raised.

Definition at line 320 of file GroupSource.cs.


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