ImportStream
Extends:
A stream that imports xml files in parallel.
Test:
Method Summary
Public Methods | ||
public |
handleOutputArguments(file: vinyl~File, outputArguments: node-opcua~Variant[], callback: function(err: ?Error)) Checks if the import succeeded and calls |
|
public |
inputArguments(file: vinyl~File): node-opcua~Variant[] Returns the arguments the |
|
public |
processErrorMessage(file: vinyl~File): string Returns an error message specifically for the given file. |
Inherited Summary
From class Stream | ||
private |
|
|
private |
Called just before the stream is closed: Closes the open session. |
From class QueueStream | ||
public get |
|
|
public get |
The number of processed chunks per second. |
|
public get |
The number of chunks already processed. |
|
public get |
|
|
private |
The maximum of parallel tasks to execute |
|
private |
The number of chunks processed so far. |
|
private |
The number of running operations. |
|
private |
_queued: *[] The queued chunks. |
|
private |
The timestamp of the date when the stream was created. |
|
public abstract |
processChunk(chunk: *, handleErrors: function(err: Error, statusCode: node-opcua~StatusCodes, onSuccess: function)) The function to call when a chunk is ready to be processed. |
|
public abstract |
processErrorMessage(chunk: *): string The error message to use when processing a chunk fails. |
|
private |
_enqueueChunk(chunk: *) Enqueues the given chunk for processing. |
|
private |
Waits for pending operations to complete. |
|
private |
_processChunk(chunk: *) Calls QueueStream#processChunk and handles errors and invalid status codes. |
|
private |
_transform(chunk: *, enc: string, callback: Function) Calls QueueStream#_enqueueChunk as soon as the stream's session is opened. |
From class CallMethodStream | ||
public get |
The NodeId of the object from which the method should get called. |
|
public get |
Must be implemented in all subclasses: The NodeId of the method to call. |
|
public |
Creates a call method request object for a file. |
|
public |
handleOutputArguments(file: vinyl~File, outputArgs: node-opcua~Variant[], callback: function(err: Error)) Must be implemented by all subclasses: If the method call returns a status code of node-opcua~StatusCodes.Good, this method decides if the output matches the expected results. |
|
public |
inputArguments(file: vinyl~File): node-opcua~Variant[] The input arguments the method should be called with for a file. |
|
public |
processChunk(file: vinyl~File, handleErrors: function(err: Error, status: node-opcua~StatusCodes, success: function)) Performs an opcua method call for the given file. |
|
public |
processErrorMessage(file: vinyl~File): string Returns an error message specifically for the given file. |
Public Members
public get methodId: NodeId source
Id of the importNodes
OPC-UA method.
Override:
CallMethodStream#methodIdTest:
Public Methods
public handleOutputArguments(file: vinyl~File, outputArguments: node-opcua~Variant[], callback: function(err: ?Error)) source
Checks if the import succeeded and calls callback
with an error otherwise.
Params:
Name | Type | Attribute | Description |
file | vinyl~File | The file that was processed. |
|
outputArguments | node-opcua~Variant[] |
|
The import status output arguments (Array with a single entry). |
callback | function(err: ?Error) | The callback called with an error if import failed. |
public inputArguments(file: vinyl~File): node-opcua~Variant[] source
Returns the arguments the importNodes
needs to be called with for the given file.
Override:
CallMethodStream#inputArgumentsParams:
Name | Type | Attribute | Description |
file | vinyl~File | The file being processed. |
Return:
node-opcua~Variant[] | The arguments for the
|
public processErrorMessage(file: vinyl~File): string source
Returns an error message specifically for the given file.
Override:
CallMethodStream#processErrorMessageParams:
Name | Type | Attribute | Description |
file | vinyl~File | The file to generate the error message for. |