\r\n

51Degrees Pipeline Node.js  4.4

51Degrees Pipeline for Node.js

CloudEngine Class Reference

Detailed Description

This is a template for all 51Degrees cloud engines.

It requires the 51Degrees cloudRequestEngine to be placed in a pipeline before it. It takes that raw JSON response and parses it to extract the device part. It also uses this data to generate a list of properties and an evidence key filter

Inheritance diagram for CloudEngine:

[legend]

Collaboration diagram for CloudEngine:

[legend]

Public Member Functions

 constructor ()
 handlePipelineRegistration (pipeline, flowElement)
Handles the registration of the Cloud Engine in a pipeline. More...
 updateEngineWhenCloudRequestEngineReady (resolve, reject)
Updates the Cloud Engine when the CloudRequestEngine is ready. More...
 ready ()
Checks if the Cloud Engine is ready. More...
 processInternal (flowData)
Internal process method for all cloud engines. More...

Public Member Functions inherited from Engine

 constructor ({ cache, restrictedProperties, dataFile }={})
Constructor for an Engine. More...
 inCache (flowData)
Checks cache and returns cached result if found. More...
 process (flowData)
An engine's process function checks cache for an item (calling inCache) If found it returns the cached object If not found it runs the standard processInternal function and adds it to the cache (if a cache is present) More...
 refresh ()
Callback which runs when an attached DataFile is updated Needs to be overriden by a specific engine to do anything. More...
 registerDataFile (dataFile)
Function to attach a DataFile to the engine and register it with a DataFileUpdateService if needed. More...

Public Member Functions inherited from FlowElement

 constructor ({ processInternal, dataKey, properties={}, evidenceKeyFilter }={})
Constructor for flowElement class. More...
 onRegistration (pipeline, flowElement)
Internal function to be called when a FlowElement is added to pipeline, runs through any registrationCallbacks on the FlowElement. More...
 ready ()
Function called to check if a FlowElement is ready Used when there are asynchronous initialisation steps. More...
 processInternal (flowData)
Internal process function for a particular flowElement called (via the flowElement.process() method) when flowData generated by a pipleline is processsed. More...
 process (flowData)
To allow actions to take place before and after a FlowElement's processInternal function runs, a process wrapper is run first. More...
 updateProperties ()
Call this function to update the properties meta database in all the pipelines this flowElement has been added to. More...
 getProperties ()
Get a flowElement's properties. More...
 _log (type, message)

Member Function Documentation

◆ handlePipelineRegistration()

CloudEngine::handlePipelineRegistration (   pipeline,
  flowElement  
)
inline

Handles the registration of the Cloud Engine in a pipeline.

This method is called when a pipeline is registered, and it ensures that the CloudRequestEngine is present in the pipeline.

Parameters
{Pipeline} - pipeline - The pipeline being registered.
{FlowElement} - flowElement - The flow element associated with the Cloud Engine.

◆ processInternal()

CloudEngine::processInternal (   flowData )
inline

Internal process method for all cloud engines.

Parameters
{FlowData} - flowData FlowData to process
Returns
{void}

◆ ready()

CloudEngine::ready ( )
inline

Checks if the Cloud Engine is ready.

This method returns a Promise that resolves if the CloudRequestEngine is ready, indicating that properties and evidence keys have been successfully fetched.

Returns
{Promise} A Promise that resolves if the CloudRequestEngine is ready and rejects if there is an error.

◆ updateEngineWhenCloudRequestEngineReady()

CloudEngine::updateEngineWhenCloudRequestEngineReady (   resolve,
  reject  
)
inline

Updates the Cloud Engine when the CloudRequestEngine is ready.

This method fetches properties and evidence keys from the CloudRequestEngine, updating the Cloud Engine accordingly.

Parameters
{Function} - resolve - Callback to be called on successful completion.
{Function} - reject - Callback to be called if there is an error.