OperationResult

OperationResult

OperationResult contains information about the result of a job operation. Operations may include bagging, validation, uploading, etc.

Constructor

new OperationResult(operation, provider)

Creates a new OperationResult.

Parameters:
Name Type Description
operation string

The name of the operation that was attempted.

provider string

The name of the plugin that attempted to perform the operation.

Source:

Members

attempt :string

The number of times DART attempted this operation.

Source:

completed :Date

Time at which DART completed this operation.

Source:

errors :Array.<string>

Error messages describing what went wrong during the operation.

Source:

fileMtime :Date

The modification timestamp of the file that packaged, stored, validated or otherwise operated on.

Source:

filepath :string

The path to the file that packaged, stored, validated or otherwise operated on.

Source:

filesize :string

The size of the file that packaged, stored, validated or otherwise operated on.

Source:

info :string

Informational message about the operation. This can be used for logging, debugging, or display.

Source:

operation :string

The name of the operation that was attempted. For example, 'bagging', 'validation', 'upload', etc. Full list is yet to be determined.

Source:

provider :string

The name of the plugin that attempted to perform the operation.

Source:

remoteChecksum :string

remoteChecksum is the checksum returned by the remote storage service after upload, if applicable. For S3 storage, this will be the e-tag. For FTP transfers and bagging operations, this will remain null.

Source:

remoteURL :string

The URL of the object or file in the remote storage service. This will be set only on upload operations. It describes where the file was uploaded.

Source:

started :Date

Time at which DART last attempted this operation.

Source:

warning :string

Warning message about the operation.

Source:

Methods

(static) inflateFrom(data) → {OperationResult}

This converts the JSON representation of an OperationResult to a full-fledged OperationResult object with all of the expected methods.

Parameters:
Name Type Description
data Object

A JavaScript hash.

Source:

finish(errors)

Sets the completed attribute to the current datetime, and sets the errors attribute.

Parameters:
Name Type Description
errors string | Array.<string>

An optional error message or array of error messages. If this is passed in, it will be appended the errors array.

Source:

firstError() → {string}

Returns the first error message in the result's errors array, or undefined if there are no errors. This is useful for handling error events emitted by plugins.

Source:

hasErrors() → {boolean}

Returns true if any errors occurred.

Source:

lastError() → {string}

Returns the last error message in the result's errors array, or undefined if there are no errors. This is useful for handling error events emitted by plugins.

Source:

reset()

This resets all of the properties of the OperationResult, except operation, provider, and attempt. DART calls this before it retries a failed operation.

Source:

start()

This resets all of the properties of the OperationResult, except operation, provider, and attempt, and sets the started attribute to the current datetime. It also increments the attempt attribute.

Source:

succeeded() → {boolean}

Returns true or false, indicating whether the operation succeeded. To have succeeded, the operation must have been attempted, must be completed, and must have no errors.

Source: