2using System.Collections.Generic;
3using System.Threading.Tasks;
81 public override string[]
DefaultArgumentNames =>
new string[] {
"NodeId",
"SourceId",
"Partition",
"JID" };
115 object Arg0 =
Arguments[0].AssociatedObjectValue;
139 string NodeId = Arg0?.ToString() ??
string.Empty;
140 object Arg1 =
Arguments[1].AssociatedObjectValue;
142 SourceId = Arg1?.
ToString() ??
string.Empty;
149 Result = await Source.GetNodeAsync(
new ThingReference(NodeId, SourceId));
153 object Arg2 =
Arguments[2].AssociatedObjectValue;
154 string PartitionId = Arg2?.
ToString() ??
string.Empty;
161 Result = await Source.GetNodeAsync(
new ThingReference(NodeId, SourceId, PartitionId));
165 object Arg3 =
Arguments[3].AssociatedObjectValue;
166 string Jid = Arg3?.
ToString().Trim() ??
string.Empty;
173 Result = await Source.GetNodeAsync(
new ThingReference(NodeId, SourceId, PartitionId));
176 Result =
new ExternalNode(NodeId, SourceId, PartitionId, Jid);
189 throw new UnauthorizedAccessException(
"Access to node denied.");
203 return Origin.GetOrigin();
205 return Origin2.GetOrigin();
207 return Origin3.GetOrigin();
226 if (Sources != sources)
228 Dictionary<string, IDataSource> SourceById =
new Dictionary<string, IDataSource>();
229 Add(SourceById, Sources);
230 sourceById = SourceById;
234 return sourceById.TryGetValue(SourceId, out Source);
237 private static void Add(Dictionary<string, IDataSource> SourceById, IEnumerable<IDataSource> Sources)
241 SourceById[Source.
SourceID] = Source;
249 private static Dictionary<string, IDataSource> sourceById =
null;
Static class managing the runtime environment of the IoT Gateway.
static XmppClient XmppClient
XMPP Client connection of gateway.
Represents an external node.
Gets a node object on the gateway.
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
GetNode(ScriptNode NodeId, ScriptNode SourceId, int Start, int Length, Expression Expression)
Gets a node object on the gateway.
GetNode(ScriptNode NodeId, int Start, int Length, Expression Expression)
Gets a node object on the gateway.
override string[] DefaultArgumentNames
Default Argument names
static Task< RequestOrigin > GetOriginOfRequest(Variables Variables)
Gets the origin of a request.
GetNode(ScriptNode NodeId, ScriptNode SourceId, ScriptNode Partition, ScriptNode Jid, int Start, int Length, Expression Expression)
Gets a node object on the gateway.
override async Task< IElement > EvaluateAsync(IElement[] Arguments, Variables Variables)
Evaluates the function.
static bool TryGetDataSource(string SourceId, out IDataSource Source)
Tries to get a data source, from its data source ID.
override string FunctionName
Name of the function
override IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the function.
GetNode(ScriptNode NodeId, ScriptNode SourceId, ScriptNode Partition, int Start, int Length, Expression Expression)
Gets a node object on the gateway.
Static class that dynamically manages types and interfaces available in the runtime environment.
static bool TryGetModuleParameter(string Name, out object Value)
Tries to get a module parameter value.
Class managing a script expression.
Base class for multivariate funcions.
ScriptNode[] Arguments
Function arguments.
static readonly ArgumentType[] argumentTypes2Scalar
Two scalar parameters.
static readonly ArgumentType[] argumentTypes3Scalar
Three scalar parameters.
static readonly ArgumentType[] argumentTypes1Scalar
One scalar parameter.
static readonly ArgumentType[] argumentTypes4Scalar
Four scalar parameters.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
override string ToString()
Expression Expression
Expression of which the node is a part.
int Start
Start position in script expression.
static readonly ObjectValue Null
Null value.
Contains information about a variable.
virtual bool TryGetVariable(string Name, out Variable Variable)
Tries to get a variable object, given its name.
Defines the Metering Topology data source. This data source contains a tree structure of persistent r...
const string SourceID
Source ID for the metering topology data source.
Tokens available in request.
Contains a reference to a thing
string SourceId
Optional ID of source containing node.
Basic interface for all types of elements.
Interface for datasources that are published through the concentrator interface.
bool HasChildren
If the source has any child sources.
IEnumerable< IDataSource > ChildSources
Child sources. If no child sources are available, null is returned.
string SourceID
ID of data source.
Interface for nodes that are published through the concentrator interface.
Task< bool > CanViewAsync(RequestOrigin Caller)
If the node is visible to the caller.
Interface for requestors that can act as an origin for distributed requests.
Interface for thing references.