Home Manual Reference Source Test
public class | source

CallMethodStream

Extends:

StreamQueueStream → CallMethodStream

Indirect Subclass:

CreateNodeStream

A stream that calls an OPC-UA method for all input files.

Test:

Member Summary

Public Members
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.

Method Summary

Public Methods
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

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

Returns an error message specifically for the given file.

Inherited Summary

From class Stream
private

true if the stream's atvise server session should be kept alive once the stream ends.

private

_flush(callback: function(err: ?Error, data: Object))

Called just before the stream is closed: Closes the open session.

From class QueueStream
public get

true if there are queued operations or an operation is running right now.

public get

The number of processed chunks per second.

public get

The number of chunks already processed.

public get

true if there are no queued operations.

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

The error message to use when processing a chunk fails.

private

_enqueueChunk(chunk: *)

Enqueues the given chunk for processing.

private

_flush(callback: Function)

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.

Public Members

public get methodBaseId: NodeId source

The NodeId of the object from which the method should get called. Defaults to the value of NodeId#parent of CallMethodStream#methodId.

Test:

public get methodId: NodeId source

Must be implemented in all subclasses: The NodeId of the method to call.

Test:

Public Methods

public callRequest(file: vinyl~File): node-opcua~CallMethodRequest source

Creates a call method request object for a file.

Params:

NameTypeAttributeDescription
file vinyl~File

The file beeing processed.

Return:

node-opcua~CallMethodRequest (nullable: true)

The resulting call request.

Test:

public handleOutputArguments(file: vinyl~File, outputArgs: node-opcua~Variant[], callback: function(err: Error)) source

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.

Params:

NameTypeAttributeDescription
file vinyl~File

The file beeing processed.

outputArgs node-opcua~Variant[]

The output arguments.

callback function(err: Error)

Call this method with an error to indicate the method call didn't work as expected.

Test:

public inputArguments(file: vinyl~File): node-opcua~Variant[] source

The input arguments the method should be called with for a file. Needs to be overridden by subclasses in most cases. Returning null indicates no method call is needed.

Params:

NameTypeAttributeDescription
file vinyl~File

The file beeing processed.

Return:

node-opcua~Variant[] (nullable: true)

The resulting input arguments.

Test:

public processChunk(file: vinyl~File, handleErrors: function(err: Error, status: node-opcua~StatusCodes, success: function)) source

Performs an opcua method call for the given file.

Override:

QueueStream#processChunk

Params:

NameTypeAttributeDescription
file vinyl~File

The file being processed.

handleErrors function(err: Error, status: node-opcua~StatusCodes, success: function)

The error handler to call. See QueueStream#processChunk for details.

Test:

public processErrorMessage(file: vinyl~File): string source

Returns an error message specifically for the given file.

Override:

QueueStream#processErrorMessage

Params:

NameTypeAttributeDescription
file vinyl~File

The file to generate the error message for.

Return:

string

The specific error message.

Test: