![]() |
Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
|
Base class for all job nodes. More...
Public Member Functions | |
| JobNode () | |
| Base class for all job nodes. More... | |
| override bool | Equals (object obj) |
| Determines whether the specified object is equal to the current object. More... | |
| override int | GetHashCode () |
| Serves as the default hash function. More... | |
| override string | ToString () |
| virtual Task | LogErrorAsync (string Body) |
| Logs an error message on the node. More... | |
| virtual Task | LogErrorAsync (string EventId, string Body) |
| Logs an error message on the node. More... | |
| virtual Task | LogWarningAsync (string Body) |
| Logs an warning message on the node. More... | |
| virtual Task | LogWarningAsync (string EventId, string Body) |
| Logs an warning message on the node. More... | |
| virtual Task | LogInformationAsync (string Body) |
| Logs an informational message on the node. More... | |
| virtual Task | LogInformationAsync (string EventId, string Body) |
| Logs an informational message on the node. More... | |
| virtual Task | LogMessageAsync (MessageType Type, string Body) |
| Logs a message on the node. More... | |
| virtual async Task | LogMessageAsync (MessageType Type, string EventId, string Body) |
| Logs a message on the node. More... | |
| virtual Task< bool > | RemoveErrorAsync () |
| Removes error messages with an empty event ID from the node. More... | |
| virtual Task< bool > | RemoveErrorAsync (string EventId) |
| Removes error messages with a given event ID from the node. More... | |
| virtual Task< bool > | RemoveWarningAsync () |
| Removes warning messages with an empty event ID from the node. More... | |
| virtual Task< bool > | RemoveWarningAsync (string EventId) |
| Removes warning messages with a given event ID from the node. More... | |
| virtual Task< bool > | RemoveInformationAsync () |
| Removes warning messages with an empty event ID from the node. More... | |
| virtual Task< bool > | RemoveInformationAsync (string EventId) |
| Removes an informational message on the node. More... | |
| virtual Task< bool > | RemoveMessageAsync (MessageType Type) |
| Removes messages with empty event IDs from the node. More... | |
| virtual async Task< bool > | RemoveMessageAsync (MessageType Type, string EventId) |
| Logs a message on the node. More... | |
| abstract Task< string > | GetTypeNameAsync (Language Language) |
| Gets the type name of the node. More... | |
| async Task< INode > | GetParent () |
| Gets the parent of the node. More... | |
| async Task< T > | GetAncestor< T > () |
| Tries to get an ancestor node of a given type, if one exists. More... | |
| virtual Task< bool > | CanViewAsync (RequestOrigin Caller) |
| If the node is visible to the caller. More... | |
| virtual Task< bool > | CanEditAsync (RequestOrigin Caller) |
| If the node can be edited by the caller. More... | |
| virtual Task< bool > | CanAddAsync (RequestOrigin Caller) |
| If the node can be added to by the caller. More... | |
| virtual Task< bool > | CanDestroyAsync (RequestOrigin Caller) |
| If the node can be destroyed to by the caller. More... | |
| virtual async Task< IEnumerable< Parameter > > | GetDisplayableParametersAsync (Language Language, RequestOrigin Caller) |
| Gets displayable parameters. More... | |
| async Task< Parameter[]> | GetDisplayableParameterAraryAsync (Language Language, RequestOrigin Caller) |
| Gets displayable parameters. More... | |
| virtual async Task< IEnumerable< Message > > | GetMessagesAsync (RequestOrigin Caller) |
| Gets messages logged on the node. More... | |
| async Task< Message[]> | GetMessageArrayAsync (RequestOrigin Caller) |
| Gets messages logged on the node. More... | |
| virtual async Task< bool > | MoveUpAsync (RequestOrigin Caller) |
| Tries to move the node up. More... | |
| virtual async Task< bool > | MoveDownAsync (RequestOrigin Caller) |
| Tries to move the node down. More... | |
| virtual async Task< bool > | MoveUpAsync (JobNode Child, RequestOrigin Caller) |
| Tries to move the child node up. More... | |
| virtual async Task< bool > | MoveDownAsync (JobNode Child, RequestOrigin Caller) |
| Tries to move the child node down. More... | |
| abstract Task< bool > | AcceptsParentAsync (INode Parent) |
| If the node accepts a presumptive parent, i.e. can be added to that parent (if that parent accepts the node as a child). More... | |
| abstract Task< bool > | AcceptsChildAsync (INode Child) |
| If the node accepts a presumptive child, i.e. can receive as a child (if that child accepts the node as a parent). More... | |
| virtual async Task | AddAsync (INode Child) |
| Adds a new child to the node. More... | |
| virtual async Task | UpdateAsync () |
| Updates the node (in persisted storage). More... | |
| virtual async Task< bool > | RemoveAsync (INode Child) |
| Removes a child from the node. More... | |
| virtual async Task | DestroyAsync () |
| Destroys the node. If it is a child to a parent node, it is removed from the parent first. More... | |
| virtual Task | AddedToRoot (Root Root) |
| Node has been added to the root node. More... | |
| virtual Task | RemovedFromRoot (Root Root) |
| Node has been removed from the root node. More... | |
Static Public Member Functions | |
| static implicit | operator ThingReference (JobNode Node) |
| Converts a JobNode to a ThingReference object. More... | |
| static async Task< string > | GetUniqueJobId (string JobId) |
| Gets a Job ID, based on JobId that is not already available in the database. More... | |
Protected Member Functions | |
| virtual JobNode[] | SortChildrenAfterLoadLocked (List< JobNode > Children) |
| Method that allows the node to sort its children, after they have been loaded. More... | |
| virtual JobNode[] | CheckOrderLocked (List< JobNode > Children) |
| Checks the ordering of children. More... | |
| virtual async Task | NodeUpdated () |
| Persists changes to the node, and generates a node updated event. More... | |
Properties | |
| Guid | ObjectId [get, set] |
| Object ID in persistence layer. More... | |
| Guid | ParentId [get, set] |
| Object ID of parent node in persistence layer. More... | |
| DateTime | Created [get, set] |
| When node was created. More... | |
| DateTime | Updated [get, set] |
| When node was last updated. If it has not been updated, value will be DateTime.MinValue. More... | |
| int | SiblingOrdinal [get, set] |
| Sibling ordinal, used to order siblings when ordered. More... | |
| string | NodeId [get, set] |
| ID of node. More... | |
| string | SourceId [get] |
| Optional ID of source containing node. More... | |
| string | Partition [get] |
| Optional partition in which the Node ID is unique. More... | |
| virtual string | LocalId [get] |
| If provided, an ID for the node, but unique locally between siblings. Can be null, if Local ID equal to Node ID. More... | |
| virtual string | LogId [get] |
| If provided, an ID for the node, as it would appear or be used in system logs. Can be null, if Log ID equal to Node ID. More... | |
| bool | HasChildren [get] |
| If the source has any child sources. More... | |
| virtual bool | ChildrenOrdered [get] |
| If the children of the node have an intrinsic order (true), or if the order is not important (false). More... | |
| virtual bool | IsReadable [get] |
| If the node can be read. More... | |
| virtual bool | IsControllable [get] |
| If the node can be controlled. More... | |
| virtual bool | HasCommands [get] |
| If the node has registered commands or not. More... | |
| INode | Parent [get] |
| Parent Node, or null if a root node. More... | |
| DateTime | LastChanged [get] |
| When the node was last updated. More... | |
| NodeState | State [get, set] |
| Current overall state of the node. More... | |
| Task< IEnumerable< INode > > | ChildNodes [get] |
| Child nodes. If no child nodes are available, null is returned. More... | |
| virtual Task< IEnumerable< ICommand > > | Commands [get] |
| Available command objects. If no commands are available, null is returned. More... | |
Events | |
| EventHandlerAsync | OnUpdate = null |
| Event raised when node has been updated. More... | |
Base class for all job nodes.
Definition at line 29 of file JobNode.cs.
| Waher.Jobs.JobNode.JobNode | ( | ) |
Base class for all job nodes.
Definition at line 48 of file JobNode.cs.
|
pure virtual |
If the node accepts a presumptive child, i.e. can receive as a child (if that child accepts the node as a parent).
| Child | Presumptive child node. |
Implements Waher.Things.INode.
Implemented in Waher.Jobs.Metering.NodeTypes.ReferenceNode, Waher.Jobs.Metering.NodeTypes.SensorDataReadoutTaskNode, Waher.Jobs.Script.NodeTypes.ScriptExecutionTaskNode, Waher.Jobs.NodeTypes.Job, and Waher.Jobs.NodeTypes.Root.
|
pure virtual |
If the node accepts a presumptive parent, i.e. can be added to that parent (if that parent accepts the node as a child).
| Parent | Presumptive parent node. |
Implements Waher.Things.INode.
Implemented in Waher.Jobs.Metering.NodeTypes.ReferenceNode, Waher.Jobs.NodeTypes.Job, Waher.Jobs.NodeTypes.JobTaskNode, and Waher.Jobs.NodeTypes.Root.
|
virtual |
Adds a new child to the node.
| Child | New child to add. |
Implements Waher.Things.INode.
Reimplemented in Waher.Jobs.NodeTypes.Root.
Definition at line 1093 of file JobNode.cs.
|
virtual |
Node has been added to the root node.
| Root | Root node. |
Reimplemented in Waher.Jobs.NodeTypes.Job.
Definition at line 1355 of file JobNode.cs.
|
virtual |
If the node can be added to by the caller.
| Caller | Information about caller. |
Implements Waher.Things.INode.
Definition at line 834 of file JobNode.cs.
|
virtual |
If the node can be destroyed to by the caller.
| Caller | Information about caller. |
Implements Waher.Things.INode.
Reimplemented in Waher.Jobs.NodeTypes.Root.
Definition at line 844 of file JobNode.cs.
|
virtual |
If the node can be edited by the caller.
| Caller | Information about caller. |
Implements Waher.Things.INode.
Reimplemented in Waher.Jobs.NodeTypes.Root.
Definition at line 824 of file JobNode.cs.
|
virtual |
If the node is visible to the caller.
| Caller | Information about caller. |
Implements Waher.Things.INode.
Definition at line 814 of file JobNode.cs.
Checks the ordering of children.
| Children | Child nodes. |
Definition at line 771 of file JobNode.cs.
|
virtual |
Destroys the node. If it is a child to a parent node, it is removed from the parent first.
Implements Waher.Things.INode.
Definition at line 1278 of file JobNode.cs.
| override bool Waher.Jobs.JobNode.Equals | ( | object | obj | ) |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
Definition at line 68 of file JobNode.cs.
| async Task< T > Waher.Jobs.JobNode.GetAncestor< T > | ( | ) |
Tries to get an ancestor node of a given type, if one exists.
| T | : | INode |
Definition at line 647 of file JobNode.cs.
| async Task< Parameter[]> Waher.Jobs.JobNode.GetDisplayableParameterAraryAsync | ( | Language | Language, |
| RequestOrigin | Caller | ||
| ) |
Gets displayable parameters.
| Language | Language to use. |
| Caller | Information about caller. |
Definition at line 909 of file JobNode.cs.
|
virtual |
Gets displayable parameters.
| Language | Language to use. |
| Caller | Information about caller. |
Implements Waher.Things.INode.
Reimplemented in Waher.Jobs.NodeTypes.Job.
Definition at line 855 of file JobNode.cs.
| override int Waher.Jobs.JobNode.GetHashCode | ( | ) |
Serves as the default hash function.
Definition at line 80 of file JobNode.cs.
| async Task< Message[]> Waher.Jobs.JobNode.GetMessageArrayAsync | ( | RequestOrigin | Caller | ) |
Gets messages logged on the node.
Definition at line 936 of file JobNode.cs.
|
virtual |
Gets messages logged on the node.
Implements Waher.Things.INode.
Definition at line 920 of file JobNode.cs.
| async Task< INode > Waher.Jobs.JobNode.GetParent | ( | ) |
Gets the parent of the node.
| Exception | If parent is not found. |
Implements Waher.Jobs.IJobNode.
Definition at line 628 of file JobNode.cs.
|
pure virtual |
Gets the type name of the node.
| Language | Language to use. |
Implements Waher.Things.INode.
Implemented in Waher.Jobs.Metering.NodeTypes.GroupReference, Waher.Jobs.Metering.NodeTypes.MeteringNodeReference, Waher.Jobs.Metering.NodeTypes.OutputReference, Waher.Jobs.Metering.NodeTypes.ProcessorReference, Waher.Jobs.Metering.NodeTypes.SensorDataReadoutTaskNode, Waher.Jobs.Script.NodeTypes.ScriptExecutionTaskNode, Waher.Jobs.NodeTypes.Job, and Waher.Jobs.NodeTypes.Root.
|
static |
Gets a Job ID, based on JobId that is not already available in the database.
| JobId | Desired Job ID |
Definition at line 537 of file JobNode.cs.
|
virtual |
Logs an error message on the node.
| Body | Message body. |
Implements Waher.Jobs.IJobNode.
Definition at line 193 of file JobNode.cs.
|
virtual |
Logs an error message on the node.
| EventId | Optional Event ID. |
| Body | Message body. |
Implements Waher.Jobs.IJobNode.
Definition at line 203 of file JobNode.cs.
|
virtual |
Logs an informational message on the node.
| Body | Message body. |
Implements Waher.Jobs.IJobNode.
Definition at line 231 of file JobNode.cs.
|
virtual |
Logs an informational message on the node.
| EventId | Optional Event ID. |
| Body | Message body. |
Implements Waher.Jobs.IJobNode.
Definition at line 241 of file JobNode.cs.
|
virtual |
Logs a message on the node.
| Type | Type of message. |
| Body | Message body. |
Implements Waher.Jobs.IJobNode.
Definition at line 251 of file JobNode.cs.
|
virtual |
Logs a message on the node.
| Type | Type of message. |
| EventId | Optional Event ID. |
| Body | Message body. |
Implements Waher.Jobs.IJobNode.
Definition at line 262 of file JobNode.cs.
|
virtual |
Logs an warning message on the node.
| Body | Message body. |
Implements Waher.Jobs.IJobNode.
Definition at line 212 of file JobNode.cs.
|
virtual |
Logs an warning message on the node.
| EventId | Optional Event ID. |
| Body | Message body. |
Implements Waher.Jobs.IJobNode.
Definition at line 222 of file JobNode.cs.
|
virtual |
Tries to move the child node down.
| Child | Child node to move. |
| Caller | Information about caller. |
Definition at line 1029 of file JobNode.cs.
|
virtual |
Tries to move the node down.
| Caller | Information about caller. |
Implements Waher.Things.INode.
Definition at line 964 of file JobNode.cs.
|
virtual |
Tries to move the child node up.
| Child | Child node to move. |
| Caller | Information about caller. |
Definition at line 978 of file JobNode.cs.
|
virtual |
Tries to move the node up.
| Caller | Information about caller. |
Implements Waher.Things.INode.
Definition at line 951 of file JobNode.cs.
|
protectedvirtual |
Persists changes to the node, and generates a node updated event.
Reimplemented in Waher.Jobs.NodeTypes.Job.
Definition at line 1174 of file JobNode.cs.
|
static |
Converts a JobNode to a ThingReference object.
| Node | Metering node. |
Definition at line 56 of file JobNode.cs.
|
virtual |
Removes a child from the node.
| Child | Child to remove. |
Implements Waher.Things.INode.
Reimplemented in Waher.Jobs.NodeTypes.Root.
Definition at line 1223 of file JobNode.cs.
|
virtual |
Node has been removed from the root node.
| Root | Root node. |
Reimplemented in Waher.Jobs.NodeTypes.Job.
Definition at line 1364 of file JobNode.cs.
|
virtual |
Removes error messages with an empty event ID from the node.
Implements Waher.Jobs.IJobNode.
Definition at line 358 of file JobNode.cs.
|
virtual |
Removes error messages with a given event ID from the node.
| EventId | Optional Event ID. |
Implements Waher.Jobs.IJobNode.
Definition at line 367 of file JobNode.cs.
|
virtual |
Removes warning messages with an empty event ID from the node.
Implements Waher.Jobs.IJobNode.
Definition at line 392 of file JobNode.cs.
|
virtual |
Removes an informational message on the node.
| EventId | Optional Event ID. |
Implements Waher.Jobs.IJobNode.
Definition at line 401 of file JobNode.cs.
|
virtual |
Removes messages with empty event IDs from the node.
| Type | Type of message. |
Implements Waher.Jobs.IJobNode.
Definition at line 410 of file JobNode.cs.
|
virtual |
Logs a message on the node.
| Type | Type of message. |
| EventId | Optional Event ID. |
Implements Waher.Jobs.IJobNode.
Definition at line 420 of file JobNode.cs.
|
virtual |
Removes warning messages with an empty event ID from the node.
Implements Waher.Jobs.IJobNode.
Definition at line 375 of file JobNode.cs.
|
virtual |
Removes warning messages with a given event ID from the node.
| EventId | Optional Event ID. |
Implements Waher.Jobs.IJobNode.
Definition at line 384 of file JobNode.cs.
|
protectedvirtual |
Method that allows the node to sort its children, after they have been loaded.
| Children | Loaded children. |
Definition at line 752 of file JobNode.cs.
| override string Waher.Jobs.JobNode.ToString | ( | ) |
Definition at line 168 of file JobNode.cs.
|
virtual |
Updates the node (in persisted storage).
Implements Waher.Things.INode.
Definition at line 1210 of file JobNode.cs.
|
get |
Child nodes. If no child nodes are available, null is returned.
Implements Waher.Things.INode.
Definition at line 694 of file JobNode.cs.
|
get |
If the children of the node have an intrinsic order (true), or if the order is not important (false).
Implements Waher.Things.INode.
Definition at line 596 of file JobNode.cs.
|
get |
Available command objects. If no commands are available, null is returned.
Implements Waher.Things.INode.
Definition at line 1337 of file JobNode.cs.
|
getset |
When node was created.
Definition at line 109 of file JobNode.cs.
|
get |
If the source has any child sources.
Implements Waher.Things.INode.
Definition at line 582 of file JobNode.cs.
|
get |
If the node has registered commands or not.
Implements Waher.Things.INode.
Definition at line 614 of file JobNode.cs.
|
get |
If the node can be controlled.
Implements Waher.Things.INode.
Definition at line 608 of file JobNode.cs.
|
get |
|
get |
When the node was last updated.
Implements Waher.Things.INode.
Definition at line 669 of file JobNode.cs.
|
get |
If provided, an ID for the node, but unique locally between siblings. Can be null, if Local ID equal to Node ID.
Implements Waher.Things.INode.
Definition at line 563 of file JobNode.cs.
|
get |
If provided, an ID for the node, as it would appear or be used in system logs. Can be null, if Log ID equal to Node ID.
Implements Waher.Things.INode.
Definition at line 569 of file JobNode.cs.
|
getset |
|
getset |
Object ID in persistence layer.
Definition at line 91 of file JobNode.cs.
|
get |
Parent Node, or null if a root node.
Implements Waher.Things.INode.
Definition at line 621 of file JobNode.cs.
|
getset |
Object ID of parent node in persistence layer.
Definition at line 100 of file JobNode.cs.
|
get |
Optional partition in which the Node ID is unique.
Implements Waher.Things.IThingReference.
Definition at line 165 of file JobNode.cs.
|
getset |
Sibling ordinal, used to order siblings when ordered.
Definition at line 129 of file JobNode.cs.
|
get |
Optional ID of source containing node.
Implements Waher.Things.IThingReference.
Definition at line 159 of file JobNode.cs.
|
getset |
Current overall state of the node.
Implements Waher.Things.INode.
Definition at line 684 of file JobNode.cs.
|
getset |
When node was last updated. If it has not been updated, value will be DateTime.MinValue.
Definition at line 119 of file JobNode.cs.
| EventHandlerAsync Waher.Jobs.JobNode.OnUpdate = null |
Event raised when node has been updated.
Definition at line 525 of file JobNode.cs.